Only strictly test known public.* names.

git-svn-id: http://svn.robofab.com/branches/ufo3k@363 b5fa9d6c-a76f-4ffd-b3cb-f825fc41095c
This commit is contained in:
Tal Leming 2011-10-03 15:46:19 +00:00
parent a829b0dc72
commit 6c9707f49d

View File

@ -747,7 +747,7 @@ def validateGroups(value):
>>> groups = {"public.awesome" : ["A"]}
>>> validateGroups(groups)
(False, 'The group data contains a group with an illegal public.* group name.')
(True, None)
>>> groups = {"public.kern1." : ["A"]}
>>> validateGroups(groups)
@ -778,7 +778,8 @@ def validateGroups(value):
return False, "A group has an empty name."
if groupName.startswith("public."):
if not groupName.startswith("public.kern1.") and not groupName.startswith("public.kern2."):
return False, "The group data contains a group with an illegal public.* group name."
# uknown pubic.* name, silently skip.
continue
else:
if len("public.kernN.") == len(groupName):
return False, "The group data contains a kerning group with an incomplete name."
@ -793,14 +794,12 @@ def validateGroups(value):
return False, "The glyph \"%s\" occurs in too many kerning groups." % glyphName
d[glyphName] = groupName
return True, None
# -------------
# lib.plist/lib
# -------------
if __name__ == "__main__":
import doctest
doctest.testmod()