Skip to content

Commit

Permalink
add support for splitted controls where some keys are required by the…
Browse files Browse the repository at this point in the history
… spec (#28)

see #26
  • Loading branch information
typemytype authored Feb 18, 2019
1 parent 455ac6f commit 945e126
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Lib/defconAppKit/controls/fontInfoView.py
Original file line number Diff line number Diff line change
Expand Up @@ -2715,7 +2715,6 @@ def woffMetadataDirectionToUFO(value):
hasDefault=False
)


# WOFF Credits

def woffMetadataCreditsFromUFO(value):
Expand Down Expand Up @@ -3207,6 +3206,13 @@ def woffMetadataGenericTextItemFactory(title=""):
]


controlRequiredPrototypes = {
"woffMetadataDescription": {"text": [{'text': 'Text'}]},
"woffMetadataVendor": {"name": ""},
"woffMetadataLicensee": {"name": ""},
}


# Attribute Getting and Setting

def getAttributeValue(info, attr):
Expand Down Expand Up @@ -3236,7 +3242,7 @@ def setAttributeValue(info, attr, value):
keys = keys[1:]
d = getattr(info, attr)
if d is None:
d = {}
d = deepcopy(controlRequiredPrototypes.get(attr, {}))
for key in keys[:-1]:
if key not in d:
d[key] = {}
Expand Down

0 comments on commit 945e126

Please sign in to comment.