Revert "UFOReader: have readInfo return a dict"

This reverts commit 440c71345a88f32ccad06d662fb30272f9253f07.
This commit is contained in:
Cosimo Lupo 2018-10-25 16:55:59 +01:00
parent 440c71345a
commit 78f572294f
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482

View File

@ -466,7 +466,7 @@ class UFOReader(_UFOBaseIO):
raise UFOLibError("fontinfo.plist is not properly formatted.") raise UFOLibError("fontinfo.plist is not properly formatted.")
return data return data
def readInfo(self, info=None, validate=None): def readInfo(self, info, validate=None):
""" """
Read fontinfo.plist. It requires an object that allows Read fontinfo.plist. It requires an object that allows
setting attributes with names that follow the fontinfo.plist setting attributes with names that follow the fontinfo.plist
@ -509,17 +509,12 @@ class UFOReader(_UFOBaseIO):
# validate data # validate data
if validate: if validate:
infoDataToSet = validateInfoVersion3Data(infoDataToSet) infoDataToSet = validateInfoVersion3Data(infoDataToSet)
if info is not None:
# populate the object # populate the object
for attr, value in infoDataToSet.items(): for attr, value in list(infoDataToSet.items()):
try: try:
setattr(info, attr, value) setattr(info, attr, value)
except AttributeError: except AttributeError:
raise UFOLibError( raise UFOLibError("The supplied info object does not support setting a necessary attribute (%s)." % attr)
"The supplied info object does not support setting a "
"necessary attribute (%s)." % attr
)
return infoDataToSet
# kerning.plist # kerning.plist