-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
When loading files from a folder with many files (>1000) windows explorer is a bottleneck slowing the process down.
My suggestion is to add the following to read files from a given directory, with a common string.
Add the following line to ReelUserSettings:
UseCommonFiles = False
Add the following to Refinement_evaluator_ver1.0.py
def commonFiles(self,src):
src = QtWidgets.QFileDialog.getExistingDirectory(self, 'Select path', src)
string, _ = QtWidgets.QInputDialog.getText(self,"Common string","Common string file ends with")
print(string)
files = os.listdir(src)
files.sort()
print(files[0])
files = [ os.path.join(src,x) for x in files if x.endswith(f"{string}")]
print(len(files))
_ , ext = os.path.splitext(string)
print(files[0])
print("*"+ext)
return files,"*"+ext
Change
filters = ext+';;'+';;'.join([x for x in filters.replace(ext,'').split(';;') if x])
files, ext = QtWidgets.QFileDialog.getOpenFileNames(self, 'Select files', path , filters)
if len(files)<1:
to
filters = ext+';;'+';;'.join([x for x in filters.replace(ext,'').split(';;') if x])
if us.UseCommonFiles:
files, ext = self.commonFiles(path)
else:
files, ext = QtWidgets.QFileDialog.getOpenFileNames(self, 'Select files', path , filters)
if len(files)<1:
Metadata
Metadata
Assignees
Labels
No labels