File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1717# --- Helper Functions ---
1818def resource_path (relative_path ):
1919 """Get absolute path to resource, works for dev and for PyInstaller."""
20- try :
20+ # PyInstaller runtime
21+ if hasattr (sys , "_MEIPASS" ):
2122 base_path = sys ._MEIPASS
22- except Exception :
23- base_path = os .path .abspath ("." )
23+ else :
24+ # Source run: base is Tool/ (where utils.py lives)
25+ base_path = os .path .dirname (os .path .abspath (__file__ ))
26+
2427 return os .path .join (base_path , relative_path )
2528
29+
2630def get_square_remove_btn_style ():
2731 """Returns CSS string for the small 'x' button."""
2832 return """
@@ -65,4 +69,4 @@ def natural_sort_key(s):
6569 # Safety check for None or non-string
6670 if not isinstance (s , str ):
6771 return []
68- return [int (text ) if text .isdigit () else text .lower () for text in re .split ('([0-9]+)' , s )]
72+ return [int (text ) if text .isdigit () else text .lower () for text in re .split ('([0-9]+)' , s )]
You can’t perform that action at this time.
0 commit comments