From 18169f279e05431edbbb71b269bfa2675023e01f Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Thu, 3 Mar 2022 19:46:18 -0500 Subject: [PATCH] file_manager: add get_directory method This replaces the previous "get_sd_directory()" method, allowing consumers to get any registered root path. Signed-off-by: Eric Callahan --- moonraker/components/file_manager/file_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moonraker/components/file_manager/file_manager.py b/moonraker/components/file_manager/file_manager.py index af20eef..82f72ed 100644 --- a/moonraker/components/file_manager/file_manager.py +++ b/moonraker/components/file_manager/file_manager.py @@ -252,8 +252,8 @@ class FileManager: check_passed = False return check_passed - def get_sd_directory(self) -> str: - return self.file_paths.get('gcodes', "") + def get_directory(self, root: str = "gcodes") -> str: + return self.file_paths.get(root, "") def get_registered_dirs(self) -> List[str]: return list(self.file_paths.keys())