mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-30 04:40:53 +00:00
Bugfix
This commit is contained in:
parent
1cf184c09d
commit
8d8d340968
1 changed files with 23 additions and 1 deletions
|
@ -369,7 +369,29 @@ def needUpdateDirByTagLogFiltered(log, dir_source, ext_source, dir_dest, ext_des
|
|||
return 0
|
||||
|
||||
def needUpdateDirByTagLog(log, dir_source, ext_source, dir_dest, ext_dest):
|
||||
needUpdateDirByTagLogFiltered(log, dir_source, ext_source, dir_dest, ext_dest, [ ])
|
||||
updateCount = 0
|
||||
skipCount = 0
|
||||
lenSrcExt = len(ext_source)
|
||||
sourceFiles = findFilesNoSubdir(log, dir_source, ext_source)
|
||||
destFiles = findFilesNoSubdir(log, dir_dest, ext_dest)
|
||||
for file in sourceFiles:
|
||||
sourceFile = dir_source + "/" + file
|
||||
tagFile = dir_dest + "/" + file[0:-lenSrcExt] + ext_dest
|
||||
if os.path.isfile(tagFile):
|
||||
sourceTime = os.stat(sourceFile).st_mtime
|
||||
tagTime = os.stat(tagFile).st_mtime
|
||||
if (sourceTime > tagTime):
|
||||
updateCount = updateCount + 1
|
||||
else:
|
||||
skipCount = skipCount + 1
|
||||
else:
|
||||
updateCount = updateCount + 1
|
||||
if updateCount > 0:
|
||||
printLog(log, "UPDATE " + str(updateCount) + " / " + str(len(sourceFiles)) + "; SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles)))
|
||||
return 1
|
||||
else:
|
||||
printLog(log, "SKIP " + str(skipCount) + " / " + str(len(sourceFiles)) + "; DEST " + str(len(destFiles)))
|
||||
return 0
|
||||
|
||||
def needUpdateDirNoSubdirFile(log, dir_source, file_dest):
|
||||
if not os.path.isfile(file_dest):
|
||||
|
|
Loading…
Reference in a new issue