Code

share/extensions/inkex.py (class Effect): Remove id_characters instance var, moving...
authorpjrm <pjrm@users.sourceforge.net>
Fri, 27 Feb 2009 02:37:22 +0000 (02:37 +0000)
committerpjrm <pjrm@users.sourceforge.net>
Fri, 27 Feb 2009 02:37:22 +0000 (02:37 +0000)
share/extensions/inkex.py

index adc0d0fed59e6f246ecb855314ec9a78b2a1d02e..c76717fb8f5c5ca05ac472c162d6cb8068f137d7 100755 (executable)
@@ -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