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')
-rw-r--r--utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/utils.py b/utils.py
index 19ac57e..7244ab0 100644
--- a/utils.py
+++ b/utils.py
@@ -47,12 +47,12 @@ def loadSvg( data, stroke, fill ):
def getUniqueFilepath( path, i ):
pathOb = os.path.abspath( path )
- if (os.path.exists(pathOb)):
- i = i+1
- newPath = os.path.join( os.path.dirname(pathOb), str( str(i) + os.path.basename(pathOb) ) )
- return getUniqueFilepath( str(newPath), i )
+ newPath = os.path.join( os.path.dirname(pathOb), str( str(i) + os.path.basename(pathOb) ) )
+ if (os.path.exists(newPath)):
+ i = i + 1
+ return getUniqueFilepath( pathOb, i )
else:
- return os.path.abspath( path )
+ return os.path.abspath( newPath )
def md5File( filepath ):