VIS-48 #10
@ -23,9 +23,17 @@ def files(path):
|
||||
yield os.path.join(subdir, file)
|
||||
|
||||
def save_input(oldpath):
|
||||
# make timestampt the filename, so it wouln't overwrite
|
||||
# add timestamp to the filename, so it wouln't overwrite but the user still knows which file's which
|
||||
timestamp = str(int(time.time()))
|
||||
filename = timestamp + '.' + oldpath.split('.')[-1]
|
||||
basename = os.path.basename(oldpath)
|
||||
try:
|
||||
basename.index('.')
|
||||
basename_no_extension = basename[:basename.index('.')]
|
||||
extension = basename[index_of_dot:]
|
||||
except ValueError:
|
||||
basename_no_extension = basename
|
||||
extension = ''
|
||||
filename = basename_no_extension + '_' + timestamp + extension
|
||||
newpath = inputFilePath + '\\' + filename
|
||||
shutil.copy(oldpath, newpath)
|
||||
return newpath
|
||||
|
Loading…
Reference in New Issue
Block a user