From 6b082fe28aa838a3542a2fea4a260f43de5fb3f6 Mon Sep 17 00:00:00 2001 From: pjrm Date: Fri, 27 Feb 2009 02:37:22 +0000 Subject: [PATCH] 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.) --- share/extensions/inkex.py | 5 ++--- 1 file 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 -- 2.30.2