ufoLib.glifLib: undo some 2to3

This commit is contained in:
Denis Jacquerye 2015-11-03 13:58:20 +00:00
parent 7deef57dd0
commit e1dd985741

View File

@ -1101,8 +1101,8 @@ def _buildAnchorFormat1(point):
anchor = dict(x=x, y=y, name=name) anchor = dict(x=x, y=y, name=name)
return anchor return anchor
def _buildOutlineContourFormat1(pen, xxx_todo_changeme): def _buildOutlineContourFormat1(pen, attrs_children):
(attrs, children) = xxx_todo_changeme (attrs, children) = attrs_children
if set(attrs.keys()): if set(attrs.keys()):
raise GlifLibError("Unknown attributes in contour element.") raise GlifLibError("Unknown attributes in contour element.")
pen.beginPath() pen.beginPath()
@ -1120,8 +1120,8 @@ def _buildOutlinePointsFormat1(pen, children):
name = attrs["name"] name = attrs["name"]
pen.addPoint((x, y), segmentType=segmentType, smooth=smooth, name=name) pen.addPoint((x, y), segmentType=segmentType, smooth=smooth, name=name)
def _buildOutlineComponentFormat1(pen, xxx_todo_changeme1): def _buildOutlineComponentFormat1(pen, attrs_children):
(attrs, children) = xxx_todo_changeme1 (attrs, children) = attrs_children
if len(children): if len(children):
raise GlifLibError("Unknown child elements of component element." % subElement) raise GlifLibError("Unknown child elements of component element." % subElement)
if set(attrs.keys()) - componentAttributesFormat1: if set(attrs.keys()) - componentAttributesFormat1:
@ -1154,8 +1154,8 @@ def buildOutlineFormat2(glyphObject, pen, xmlNodes, identifiers):
else: else:
raise GlifLibError("Unknown element in outline element: %s" % element) raise GlifLibError("Unknown element in outline element: %s" % element)
def _buildOutlineContourFormat2(pen, xxx_todo_changeme2, identifiers): def _buildOutlineContourFormat2(pen, attrs_children, identifiers):
(attrs, children) = xxx_todo_changeme2 (attrs, children) = attrs_children
if set(attrs.keys()) - contourAttributesFormat2: if set(attrs.keys()) - contourAttributesFormat2:
raise GlifLibError("Unknown attributes in contour element.") raise GlifLibError("Unknown attributes in contour element.")
identifier = attrs.get("identifier") identifier = attrs.get("identifier")
@ -1195,8 +1195,8 @@ def _buildOutlinePointsFormat2(pen, children, identifiers):
pen.addPoint((x, y), segmentType=segmentType, smooth=smooth, name=name) pen.addPoint((x, y), segmentType=segmentType, smooth=smooth, name=name)
raise warn("The addPoint method needs an identifier kwarg. The point's identifier value has been discarded.", DeprecationWarning) raise warn("The addPoint method needs an identifier kwarg. The point's identifier value has been discarded.", DeprecationWarning)
def _buildOutlineComponentFormat2(pen, xxx_todo_changeme3, identifiers): def _buildOutlineComponentFormat2(pen, attrs_children, identifiers):
(attrs, children) = xxx_todo_changeme3 (attrs, children) = attrs_children
if len(children): if len(children):
raise GlifLibError("Unknown child elements of component element." % subElement) raise GlifLibError("Unknown child elements of component element." % subElement)
if set(attrs.keys()) - componentAttributesFormat2: if set(attrs.keys()) - componentAttributesFormat2: