mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
pep8
This commit is contained in:
parent
233817b48f
commit
8b79484d3a
@ -1434,8 +1434,7 @@ if __name__ == '__main__': # tests {{{
|
||||
test_identify_plugin(Amazon.name, tests, modify_plugin=lambda
|
||||
p:(setattr(p, 'testing_domain', domain), setattr(p, 'touched_fields', p.touched_fields - {'tags'})))
|
||||
|
||||
#do_test('com')
|
||||
do_test('ca')
|
||||
do_test('com')
|
||||
# do_test('de')
|
||||
|
||||
# }}}
|
||||
|
@ -541,6 +541,8 @@ class NoNamespaceTreeBuilder(TreeBuilder):
|
||||
body.set(to_xml_name(k), v)
|
||||
|
||||
# Input Stream {{{
|
||||
|
||||
|
||||
_regex_cache = {}
|
||||
|
||||
|
||||
@ -604,6 +606,7 @@ class FastStream(object):
|
||||
return (lnum + 1, offset)
|
||||
# }}}
|
||||
|
||||
|
||||
if len("\U0010FFFF") == 1: # UCS4 build
|
||||
replace_chars = re.compile("[\uD800-\uDFFF]")
|
||||
else:
|
||||
@ -689,9 +692,9 @@ def parse(raw, decoder=None, log=None, line_numbers=True, linenumber_attribute=N
|
||||
log.exception('Failed to parse as XML, parsing as tag soup')
|
||||
return parse_html5(raw, log=log, line_numbers=line_numbers, linenumber_attribute=linenumber_attribute, replace_entities=False, fix_newlines=False)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from lxml import etree
|
||||
root = parse_html5('\n<html><head><title>a\n</title><p b=1 c=2 a=0> \n<b>b<svg ass="wipe" viewbox="0">', discard_namespaces=False)
|
||||
print (etree.tostring(root, encoding='utf-8'))
|
||||
print()
|
||||
|
||||
|
@ -664,6 +664,7 @@ class EchoLine(Connection): # {{{
|
||||
self.rbuf.seek(pos + sent)
|
||||
# }}}
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
s = ServerLoop(EchoLine)
|
||||
with HandleInterrupt(s.wakeup):
|
||||
|
@ -525,6 +525,7 @@ def remove_dir_if_empty(path, ignore_metadata_caches=False):
|
||||
return
|
||||
raise
|
||||
|
||||
|
||||
if iswindows:
|
||||
# Python's expanduser is broken for non-ASCII usernames
|
||||
def expanduser(path):
|
||||
|
Loading…
x
Reference in New Issue
Block a user