@@ -299,7 +299,8 @@ def find_all_preset_files(path, fexts, recursion=1):
299
299
300
300
@classmethod
301
301
def get_filelist (cls , dpath , fext , include_dirs = False , exclude_empty_dirs = True ):
302
- res = []
302
+ files = []
303
+ dirs = []
303
304
if isinstance (dpath , str ):
304
305
dpath = [('_' , dpath )]
305
306
if isinstance (fext , str ):
@@ -321,16 +322,16 @@ def get_filelist(cls, dpath, fext, include_dirs=False, exclude_empty_dirs=True):
321
322
if dn != '_' :
322
323
title = dn + '/' + title
323
324
# print("filelist => " + title)
324
- res .append ([os .path .join (dp , f ), i , title , dn , f , ext ])
325
+ files .append ([os .path .join (dp , f ), i , title , dn , f , ext ])
325
326
i += 1
326
327
elif include_dirs and os .path .isdir (path ) and (not exclude_empty_dirs or cls .find_some_preset_file (path , fext )):
327
- res .append ([path , i , "> " + f , dn , f ])
328
+ dirs .append ([path , i , "> " + f , dn , f ])
328
329
i += 1
329
330
except Exception as e :
330
331
#logging.warning(f"Can't access directory '{dp}' => {e}")
331
332
pass
332
333
333
- return res
334
+ return dirs + files
334
335
335
336
@staticmethod
336
337
def get_dirlist (dpath , exclude_empty = True ):
0 commit comments