summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Moulder <peter.moulder@monash.edu>2009-02-27 02:37:22 +0000
committerpjrm <pjrm@users.sourceforge.net>2009-02-27 02:37:22 +0000
commitbc07e384afd17cd6ee5038e0094a9737a2b1d53f (patch)
treed038c199942d1a2f1c6349999705f0fe4d6f2034
parentshare/extensions/inkex.py: Fix a couple of issues reported by pychecker. (diff)
downloadinkscape-bc07e384afd17cd6ee5038e0094a9737a2b1d53f.tar.gz
inkscape-bc07e384afd17cd6ee5038e0094a9737a2b1d53f.zip
share/extensions/inkex.py (class Effect): Remove id_characters instance var, moving it to its sole user (uniqueId). Change k to x in `...uvwkyz...', as reported by halley. (I've mechanically checked that there are no other surprises in the string.)
(bzr r7386)
-rwxr-xr-xshare/extensions/inkex.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py
index adc0d0fed..c76717fb8 100755
--- a/share/extensions/inkex.py
+++ b/share/extensions/inkex.py
@@ -107,7 +107,6 @@ class Effect:
"""A class for creating Inkscape SVG Effects"""
def __init__(self, *args, **kwargs):
- self.id_characters = '0123456789abcdefghijklmnopqrstuvwkyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
self.document=None
self.ctx=None
self.selected={}
@@ -197,12 +196,12 @@ class Effect:
self.getdocids()
self.effect()
if output: self.output()
-
+
def uniqueId(self, old_id, make_new_id = True):
new_id = old_id
if make_new_id:
while new_id in self.doc_ids:
- new_id = "%s%s" % (new_id,random.choice(self.id_characters))
+ new_id += random.choice('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
self.doc_ids[new_id] = 1
return new_id