[merge] Minor
This commit is contained in:
parent
2642934116
commit
c68c0ff12f
@ -19,9 +19,10 @@ import operator
|
|||||||
def _add_method(*clazzes, **kwargs):
|
def _add_method(*clazzes, **kwargs):
|
||||||
"""Returns a decorator function that adds a new method to one or
|
"""Returns a decorator function that adds a new method to one or
|
||||||
more classes."""
|
more classes."""
|
||||||
|
allowDefault = kwargs.get('allowDefaultTable', False)
|
||||||
def wrapper(method):
|
def wrapper(method):
|
||||||
for clazz in clazzes:
|
for clazz in clazzes:
|
||||||
if not kwargs.get('allowDefaultTable', False):
|
if not allowDefault:
|
||||||
assert clazz != DefaultTable, 'Oops, table class not found.'
|
assert clazz != DefaultTable, 'Oops, table class not found.'
|
||||||
assert method.__name__ not in clazz.__dict__, \
|
assert method.__name__ not in clazz.__dict__, \
|
||||||
"Oops, class '%s' has method '%s'." % (clazz.__name__,
|
"Oops, class '%s' has method '%s'." % (clazz.__name__,
|
||||||
@ -211,7 +212,7 @@ ttLib.getTableClass('post').mergeMap = {
|
|||||||
'minMemType1': max,
|
'minMemType1': max,
|
||||||
'maxMemType1': lambda lst: 0,
|
'maxMemType1': lambda lst: 0,
|
||||||
'mapping': implemented(sumDicts),
|
'mapping': implemented(sumDicts),
|
||||||
'extraNames': lambda lst: [][:],
|
'extraNames': lambda lst: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
ttLib.getTableClass('vmtx').mergeMap = ttLib.getTableClass('hmtx').mergeMap = {
|
ttLib.getTableClass('vmtx').mergeMap = ttLib.getTableClass('hmtx').mergeMap = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user