twVolc / PyCamPermanent

Permanent PiCam (SO2) installation project software
GNU General Public License v3.0
1 stars 2 forks source link

truncate_path error #138

Closed twVolc closed 1 month ago

twVolc commented 1 month ago

truncate_path has introduced an error when loading the Settings window, since cal_series_path is None by default. Perhaps truncate path needs to accept None and just return that if so?

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\thom_\anaconda3\envs\pycam\lib\tkinter\__init__.py", line 1892, in __call__
    return self.func(*args)
  File "C:\Users\thom_\Documents\Work\PyCamPermanent\pycam\gui\figures_analysis.py", line 2980, in generate_frame
    self.cal_series_label = ttk.Label(path_frame, text=self.cal_series_path_short, width=self.path_widg_length,
  File "C:\Users\thom_\Documents\Work\PyCamPermanent\pycam\gui\figures_analysis.py", line 3127, in cal_series_path_short
    return truncate_path(self.cal_series_path, self.path_str_length)
  File "C:\Users\thom_\Documents\Work\PyCamPermanent\pycam\utils.py", line 293, in truncate_path
    raise ValueError("path length should be greater than 0")
ValueError: path length should be greater than 0
twVolc commented 1 month ago

Fixed and should be closed when dev24.2 is merged with master