From 4033aede52133f254f320838d2339ca3bfcb77e9 Mon Sep 17 00:00:00 2001
From: wu_xinjun <bent20140204@outlook.com>
Date: 星期二, 15 三月 2022 14:53:11 +0800
Subject: [PATCH] Squashed commit of the following:

---
 src/utils/tools.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/utils/tools.py b/src/utils/tools.py
index ee2f8de..3db661f 100644
--- a/src/utils/tools.py
+++ b/src/utils/tools.py
@@ -2,7 +2,7 @@
 import numpy as np
 import time
 
-def file_fliter(folder:str, file_ext:str, sort_format):
+def file_fliter(folder:str, file_ext:str, sort_format = None):
 
     files_List = os.listdir(folder)
     target_files = []
@@ -11,8 +11,10 @@
     for file in files_List:
         if file.split('.')[-1] == file_ext:
             target_files.append(file)
-    # sort the list by the sort_format
-    target_files.sort(key=sort_format)
+
+    if sort_format is not None:
+        # sort the list by the sort_format
+        target_files.sort(key=sort_format)
 
     return target_files
 

--
Gitblit v1.9.1