VIS-48 #10

Merged
s416067 merged 4 commits from VIS-48 into master 2021-01-25 16:26:56 +01:00

View File

@ -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