file_manager: add option to opt out of klipper check

Some installations do not have Klipper's configuration
in the data path's "config" folder.  Provide a way to
opt out of this check.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-12-16 15:25:38 -05:00
parent 6d8cb762ff
commit 3b53d9532d
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 20 additions and 18 deletions

View File

@ -104,6 +104,7 @@ class FileManager:
self.scheduled_notifications: Dict[str, asyncio.TimerHandle] = {}
self.fixed_path_args: Dict[str, Any] = {}
self.queue_gcodes: bool = config.getboolean('queue_gcode_uploads', False)
self.check_klipper_path = config.getboolean("check_klipper_config_path", True)
# Register file management endpoints
self.server.register_endpoint(
@ -195,6 +196,7 @@ class FileManager:
"klippy.log", log_path, force=True)
# Validate config file
if self.check_klipper_path:
cfg_file: Optional[str] = paths.get("config_file")
cfg_parent = self.file_paths.get("config")
if cfg_file is not None and cfg_parent is not None: