Skip to content

forgot to create {sync_dir}/instructions' folder, got error in terminal #156

@Felipegalind0

Description

@Felipegalind0

if there is no '{sync_dir}/instructions' folder the following error occurs

PS C:\Users\felg\Documents\GitHub\root_painter> & c:/Users/felg/Documents/GitHub/root_painter/root_painter_venv/Scripts/python.exe c:/Users/felg/Documents/GitHub/root_painter/painter/src/main/python/main.py
Initialising RootPainter
log_exception 2025-02-01 14:38:16.109982|sys_exception|Error. type: <class 'FileNotFoundError'>, value: [Errno 2] No such file or directory: 'C:\\Users\\felg\\Documents\\rp_sync\\instructions\\segment_-4491332715209503629', traceback:   File "c:\Users\felg\Documents\GitHub\root_painter\painter\src\main\python\root_painter.py", line 455, in show_open_project_widget
    self.open_project(file_path)
  File "c:\Users\felg\Documents\GitHub\root_painter\painter\src\main\python\root_painter.py", line 234, in open_project
    self.init_active_project_ui()
  File "c:\Users\felg\Documents\GitHub\root_painter\painter\src\main\python\root_painter.py", line 740, in init_active_project_ui
    self.update_file(self.image_path)
  File "c:\Users\felg\Documents\GitHub\root_painter\painter\src\main\python\root_painter.py", line 296, in update_file
    self.segment_current_image()
  File "c:\Users\felg\Documents\GitHub\root_painter\painter\src\main\python\root_painter.py", line 442, in segment_current_image
    self.segment_image(to_segment_fnames)
  File "c:\Users\felg\Documents\GitHub\root_painter\painter\src\main\python\root_painter.py", line 432, in segment_image
    self.send_instruction('segment', content)
  File "c:\Users\felg\Documents\GitHub\root_painter\painter\src\main\python\instructions.py", line 72, in send_instruction
    with open(fpath, 'w') as json_file:

I believe that the best way to fix this is to make the software show a warning message with a button that allows the user to create a '{sync_dir}/instructions' folder with one click, or change the sync_dir in case that the user set it incorrectly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions