projects
/
iramuteq
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
52cb2c6
)
makenew
author
Pierre Ratinaud
<ratinaud@univ-tlse2.fr>
Tue, 12 Jul 2016 13:22:36 +0000
(15:22 +0200)
committer
Pierre Ratinaud
<ratinaud@univ-tlse2.fr>
Tue, 12 Jul 2016 13:22:36 +0000
(15:22 +0200)
chemins.py
patch
|
blob
|
history
diff --git
a/chemins.py
b/chemins.py
index
f43969c
..
4e50a48
100644
(file)
--- a/
chemins.py
+++ b/
chemins.py
@@
-45,6
+45,14
@@
class PathOut :
tdirout = dirout + `nb`
self.name = os.path.splitext(tdirout)[1]
return tdirout
+
+ def makenew(self, filename, ext):
+ nb = 1
+ newfile = '_'.join([os.path.join(self.dirout, filename), '%i' % nb]) + '.' + ext
+ while os.path.exists(newfile) :
+ nb += 1
+ newfile = '_'.join([os.path.join(self.dirout, filename), '%i' % nb]) + '.' + ext
+ return newfile
def createdir(self, tdirout) :
if not os.path.exists(tdirout) :