file_manager: provide method to look up paths by root
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
@@ -372,6 +372,12 @@ class FileManager:
|
||||
return ""
|
||||
return os.path.relpath(full_path, start=root_dir)
|
||||
|
||||
def get_full_path(self, root: str, relative_path: str) -> pathlib.Path:
|
||||
root_dir = self.file_paths.get(root, None)
|
||||
if root_dir is None:
|
||||
raise self.server.error(f"Unknown root {root}")
|
||||
return pathlib.Path(root_dir).joinpath(relative_path)
|
||||
|
||||
def get_metadata_storage(self) -> MetadataStorage:
|
||||
return self.gcode_metadata
|
||||
|
||||
|
Reference in New Issue
Block a user