mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 18:43:39 +02:00
Micro-optimization
This commit is contained in:
parent
13df7004df
commit
53ec8c5b8e
1 changed files with 4 additions and 1 deletions
|
|
@ -375,7 +375,7 @@ def __init__(self, namespace, pPr=None):
|
|||
setattr(self, p, binary_property(pPr, p, namespace.XPath, namespace.get))
|
||||
|
||||
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)
|
||||
|
||||
for s in namespace.XPath('./w:pStyle[@w:val]')(pPr):
|
||||
|
|
@ -473,3 +473,6 @@ def has_visible_border(self):
|
|||
if bw is not inherit and bw and bs is not inherit and bs != 'none':
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
read_funcs = {k[5:]:v for k, v in iteritems(globals()) if k.startswith('read_')}
|
||||
|
|
|
|||
Loading…
Reference in a new issue