svgLib: rename PathBuilder's 'pathes' attribute to 'paths'
This commit is contained in:
parent
a4ed057dd1
commit
dda4c1a41e
@ -55,6 +55,6 @@ class SVGPath(object):
|
||||
# xpath | doesn't seem to reliable work so just walk it
|
||||
for el in self.root.iter():
|
||||
pb.add_path_from_element(el)
|
||||
for path in pb.pathes:
|
||||
for path in pb.paths:
|
||||
parse_path(path, pen)
|
||||
|
||||
|
@ -12,21 +12,21 @@ def _ntos(n):
|
||||
|
||||
class PathBuilder(object):
|
||||
def __init__(self):
|
||||
self.pathes = []
|
||||
self.paths = []
|
||||
|
||||
def _start_path(self, initial_path=''):
|
||||
self.pathes.append(initial_path)
|
||||
self.paths.append(initial_path)
|
||||
|
||||
def _end_path(self):
|
||||
self._add('z')
|
||||
|
||||
def _add(self, path_snippet):
|
||||
path = self.pathes[-1]
|
||||
path = self.paths[-1]
|
||||
if path:
|
||||
path += ' ' + path_snippet
|
||||
else:
|
||||
path = path_snippet
|
||||
self.pathes[-1] = path
|
||||
self.paths[-1] = path
|
||||
|
||||
def _move(self, c, x, y):
|
||||
self._add('%s%s,%s' % (c, _ntos(x), _ntos(y)))
|
||||
|
@ -65,4 +65,4 @@ def test_el_to_path(svg_xml, expected_path):
|
||||
expected = [expected_path]
|
||||
else:
|
||||
expected = []
|
||||
assert pb.pathes == expected
|
||||
assert pb.paths == expected
|
||||
|
Loading…
x
Reference in New Issue
Block a user