mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
pep8
This commit is contained in:
parent
5ef48e96c3
commit
25e51e968f
@ -88,6 +88,7 @@ def XLINK(name):
|
|||||||
def CALIBRE(name):
|
def CALIBRE(name):
|
||||||
return '{%s}%s' % (CALIBRE_NS, name)
|
return '{%s}%s' % (CALIBRE_NS, name)
|
||||||
|
|
||||||
|
|
||||||
_css_url_re = re.compile(r'url\s*\([\'"]{0,1}(.*?)[\'"]{0,1}\)', re.I)
|
_css_url_re = re.compile(r'url\s*\([\'"]{0,1}(.*?)[\'"]{0,1}\)', re.I)
|
||||||
_css_import_re = re.compile(r'@import "(.*?)"')
|
_css_import_re = re.compile(r'@import "(.*?)"')
|
||||||
_archive_re = re.compile(r'[^ ]+')
|
_archive_re = re.compile(r'[^ ]+')
|
||||||
@ -121,6 +122,7 @@ def itercsslinks(raw):
|
|||||||
for match in _css_import_re.finditer(raw):
|
for match in _css_import_re.finditer(raw):
|
||||||
yield match.group(1), match.start(1)
|
yield match.group(1), match.start(1)
|
||||||
|
|
||||||
|
|
||||||
_link_attrs = set(html.defs.link_attrs) | {XLINK('href'), 'poster'}
|
_link_attrs = set(html.defs.link_attrs) | {XLINK('href'), 'poster'}
|
||||||
|
|
||||||
|
|
||||||
@ -402,6 +404,7 @@ def serialize(data, media_type, pretty_print=False):
|
|||||||
return data + b'\n'
|
return data + b'\n'
|
||||||
return bytes(data)
|
return bytes(data)
|
||||||
|
|
||||||
|
|
||||||
ASCII_CHARS = set(chr(x) for x in xrange(128))
|
ASCII_CHARS = set(chr(x) for x in xrange(128))
|
||||||
UNIBYTE_CHARS = set(chr(x) for x in xrange(256))
|
UNIBYTE_CHARS = set(chr(x) for x in xrange(256))
|
||||||
URL_SAFE = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
URL_SAFE = set('ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user