more pointpen method signature consistency fixes

This commit is contained in:
justvanrossum 2018-10-29 16:41:24 +01:00
parent 186e4615ab
commit 7d5530ec91

View File

@ -140,7 +140,8 @@ class BasePointToSegmentPen(AbstractPointPen):
self._flushContour(segments) self._flushContour(segments)
def addPoint(self, pt, segmentType=None, smooth=False, name=None, **kwargs): def addPoint(self, pt, segmentType=None, smooth=False, name=None,
identifier=None, **kwargs):
self.currentPath.append((pt, segmentType, smooth, name, kwargs)) self.currentPath.append((pt, segmentType, smooth, name, kwargs))
@ -325,11 +326,16 @@ class GuessSmoothPointPen(AbstractPointPen):
self._outPen.endPath() self._outPen.endPath()
self._points = None self._points = None
def addPoint(self, pt, segmentType=None, smooth=False, name=None, **kwargs): def addPoint(self, pt, segmentType=None, smooth=False, name=None,
identifier=None, **kwargs):
if identifier is not None:
kwargs["identifier"] = identifier
self._points.append((pt, segmentType, False, name, kwargs)) self._points.append((pt, segmentType, False, name, kwargs))
def addComponent(self, glyphName, transformation, **kwargs): def addComponent(self, glyphName, transformation, identifier=None, **kwargs):
assert self._points is None assert self._points is None
if identifier is not None:
kwargs["identifier"] = identifier
self._outPen.addComponent(glyphName, transformation, **kwargs) self._outPen.addComponent(glyphName, transformation, **kwargs)