Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rwxr-xr-x[-rw-r--r--]utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 701e45f..128f974 100644..100755
--- a/utils.py
+++ b/utils.py
@@ -47,8 +47,10 @@ def load_colored_svg(filename, stroke, fill):
return rsvg.Handle(data=data).get_pixbuf()
def getUniqueFilepath( path, i ):
+ if not os.path.exists(path):
+ return path
pathOb = os.path.abspath( path )
- newPath = os.path.join( os.path.dirname(pathOb), str( str(i) + os.path.basename(pathOb) ) )
+ newPath = os.path.join( os.path.dirname(pathOb), str( os.path.basename(pathOb) + str(i) ) )
if (os.path.exists(newPath)):
i = i + 1
return getUniqueFilepath( pathOb, i )