mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Micro-optimization
This commit is contained in:
parent
13df7004df
commit
53ec8c5b8e
@ -375,7 +375,7 @@ class ParagraphStyle(object):
|
|||||||
setattr(self, p, binary_property(pPr, p, namespace.XPath, namespace.get))
|
setattr(self, p, binary_property(pPr, p, namespace.XPath, namespace.get))
|
||||||
|
|
||||||
for x in ('border', 'indent', 'justification', 'spacing', 'shd', 'numbering', 'frame'):
|
for x in ('border', 'indent', 'justification', 'spacing', 'shd', 'numbering', 'frame'):
|
||||||
f = globals()['read_%s' % x]
|
f = read_funcs[x]
|
||||||
f(pPr, self, namespace.XPath, namespace.get)
|
f(pPr, self, namespace.XPath, namespace.get)
|
||||||
|
|
||||||
for s in namespace.XPath('./w:pStyle[@w:val]')(pPr):
|
for s in namespace.XPath('./w:pStyle[@w:val]')(pPr):
|
||||||
@ -473,3 +473,6 @@ class ParagraphStyle(object):
|
|||||||
if bw is not inherit and bw and bs is not inherit and bs != 'none':
|
if bw is not inherit and bw and bs is not inherit and bs != 'none':
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
read_funcs = {k[5:]:v for k, v in iteritems(globals()) if k.startswith('read_')}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user