use FixPath on keep_dirs key - a path, as the backslashes in windows cause python errors
This commit is contained in:
@@ -371,7 +371,7 @@ def JobImportDir(job):
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
dir=AddDir(job, os.path.basename(path[0:-1]), symlink, None )
|
dir=AddDir(job, os.path.basename(path[0:-1]), symlink, None )
|
||||||
keep_dirs[dir.path_prefix]=dir
|
keep_dirs[FixPath(dir.path_prefix)]=dir
|
||||||
import_dir=dir
|
import_dir=dir
|
||||||
fcnt[symlink]=0
|
fcnt[symlink]=0
|
||||||
files = sorted(glob.glob(path + '**', recursive=True))
|
files = sorted(glob.glob(path + '**', recursive=True))
|
||||||
@@ -386,15 +386,15 @@ def JobImportDir(job):
|
|||||||
fname=file.replace(path, "")
|
fname=file.replace(path, "")
|
||||||
stat = os.stat(file)
|
stat = os.stat(file)
|
||||||
dirname=SymlinkName(path, file)
|
dirname=SymlinkName(path, file)
|
||||||
if stat.st_ctime > keep_dirs[dirname].last_import_date:
|
if stat.st_ctime > keep_dirs[FixPath(dirname)].last_import_date:
|
||||||
if DEBUG==1:
|
if DEBUG==1:
|
||||||
AddLogForJob(job, "DEBUG: {} - {} is newer than {}".format( file, stat.st_ctime, keep_dirs[dirname].last_import_date ), file )
|
AddLogForJob(job, "DEBUG: {} - {} is newer than {}".format( file, stat.st_ctime, keep_dirs[FixPath(dirname)].last_import_date ), file )
|
||||||
print("DEBUG: {} - {} is newer than {}".format( file, stat.st_ctime, keep_dirs[dirname].last_import_date ) )
|
print("DEBUG: {} - {} is newer than {}".format( file, stat.st_ctime, keep_dirs[FixPath(dirname)].last_import_date ) )
|
||||||
if os.path.isdir(file):
|
if os.path.isdir(file):
|
||||||
path_prefix=os.path.join(symlink,fname)
|
path_prefix=os.path.join(symlink,fname)
|
||||||
dir=AddDir( job, fname, path_prefix, dir )
|
dir=AddDir( job, fname, path_prefix, dir )
|
||||||
fcnt[path_prefix]=0
|
fcnt[path_prefix]=0
|
||||||
keep_dirs[dir.path_prefix]=dir
|
keep_dirs[FixPath(dir.path_prefix)]=dir
|
||||||
else:
|
else:
|
||||||
overall_file_cnt=overall_file_cnt+1
|
overall_file_cnt=overall_file_cnt+1
|
||||||
dirname=SymlinkName(path, file)
|
dirname=SymlinkName(path, file)
|
||||||
@@ -409,8 +409,8 @@ def JobImportDir(job):
|
|||||||
e=AddFile( job, os.path.basename(fname), type_str, fsize, dir )
|
e=AddFile( job, os.path.basename(fname), type_str, fsize, dir )
|
||||||
else:
|
else:
|
||||||
if DEBUG==1:
|
if DEBUG==1:
|
||||||
AddLogForJob(job, "DEBUG: {} - {} is OLDER than {}".format( file, stat.st_ctime, keep_dirs[dirname].last_import_date ), file )
|
AddLogForJob(job, "DEBUG: {} - {} is OLDER than {}".format( file, stat.st_ctime, keep_dirs[FixPath(dirname)].last_import_date ), file )
|
||||||
print("DEBUG: {} - {} is OLDER than {}".format( file, stat.st_ctime, keep_dirs[dirname].last_import_date ), file )
|
print("DEBUG: {} - {} is OLDER than {}".format( file, stat.st_ctime, keep_dirs[FixPath(dirname)].last_import_date ), file )
|
||||||
FinishJob(job, "Finished Importing: {} - Found {} new files".format( path, overall_file_cnt ) )
|
FinishJob(job, "Finished Importing: {} - Found {} new files".format( path, overall_file_cnt ) )
|
||||||
for d in keep_dirs:
|
for d in keep_dirs:
|
||||||
keep_dirs[d].num_files = fcnt[d]
|
keep_dirs[d].num_files = fcnt[d]
|
||||||
|
|||||||
Reference in New Issue
Block a user