minor refactoring
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@340 4cde692c-a291-49d1-8350-778aa11640f8
This commit is contained in:
parent
1e7014865e
commit
52966bb144
@ -392,9 +392,8 @@ class BaseTable:
|
||||
raise # XXX on KeyError, raise nice error
|
||||
value = conv.xmlRead(attrs, content, font)
|
||||
if conv.repeat:
|
||||
try:
|
||||
seq = getattr(self, conv.name)
|
||||
except AttributeError:
|
||||
seq = getattr(self, conv.name, None)
|
||||
if seq is None:
|
||||
seq = []
|
||||
setattr(self, conv.name, seq)
|
||||
seq.append(value)
|
||||
|
@ -142,10 +142,11 @@ class Struct(BaseConverter):
|
||||
if Format is not None:
|
||||
table.Format = int(Format)
|
||||
for element in content:
|
||||
if type(element) <> TupleType:
|
||||
continue
|
||||
if type(element) == TupleType:
|
||||
name, attrs, content = element
|
||||
table.fromXML((name, attrs, content), font)
|
||||
else:
|
||||
pass
|
||||
return table
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user