File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 11import os
22import sys
3+ import re
34import configparser
45from threading import Event
56from threading import Lock
@@ -196,8 +197,8 @@ def validate_input_files(self, input_path):
196197 self .convertToSRGB = self .converter .get_image_gamme_encoded (os .path .join (input_path , self .imagePathList [0 ]))
197198 self .set_SRGB_enabled (self .convertToSRGB )
198199
199- self .modelPathList . sort ( )
200- self .imagePathList . sort ( )
200+ self .human_sort ( self . modelPathList )
201+ self .human_sort ( self . imagePathList )
201202
202203 return True
203204
@@ -259,6 +260,18 @@ def save_config(self):
259260 with open (self .configPath , "w" ) as configfile :
260261 self .config .write (configfile )
261262
263+ def tryint (self , s ):
264+ try :
265+ return int (s )
266+ except ValueError :
267+ return s
268+
269+ def alphanum_key (self , s ):
270+ return [ self .tryint (c ) for c in re .split ('([0-9]+)' , s ) ]
271+
272+ def human_sort (self , l ):
273+ l .sort (key = self .alphanum_key )
274+
262275
263276 # --- Main UI ---
264277
You can’t perform that action at this time.
0 commit comments