Skip to content

Commit

Permalink
Use triple-quoted raw strings in regexp constants
Browse files Browse the repository at this point in the history
This reduces the number of needed escape sequences, and fixes Python 3.6
warnings:

    grip/constants.py:32: DeprecationWarning: invalid escape sequence \(
    grip/constants.py:35: DeprecationWarning: invalid escape sequence \(
  • Loading branch information
jwilk committed Dec 30, 2016
1 parent 04a7b11 commit c253750
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions grip/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
# Style parsing
STYLE_URLS_SOURCE = 'https://github.com/joeyespo/grip'
STYLE_URLS_RE = (
'<link.+href=[\'"]?([^\'" >]+)[\'"]?.+media=[\'"]?(?:screen|all)[\'"]?.'
'+rel=[\'"]?stylesheet[\'"]?.+/>')
r'''<link.+href=['"]?([^'" >]+)['"]?.+media=['"]?(?:screen|all)['"]?.'''
r'''+rel=['"]?stylesheet['"]?.+/>''')
STYLE_ASSET_URLS_RE = (
'url\([\'"]?(/static/fonts/octicons/[^\'" \)]+)[\'"]?\)')
r'''url\(['"]?(/static/fonts/octicons/[^'" \)]+)['"]?\)''')
STYLE_ASSET_URLS_SUB_FORMAT = r'url("{0}\1")'
STYLE_ASSET_URLS_INLINE_FORMAT = (
'url\([\'"]?((?:/static|{0})/[^\'" \)]+)[\'"]?\)')
r'''url\(['"]?((?:/static|{0})/[^'" \)]+)['"]?\)''')

0 comments on commit c253750

Please sign in to comment.