From 4596acab81b582e8c63c907eeb8ad14ebb34bdd6 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 1 May 2023 11:37:44 +0300 Subject: [PATCH] Add os.call_path_module_func RPC --- platformio/home/rpc/handlers/os.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/platformio/home/rpc/handlers/os.py b/platformio/home/rpc/handlers/os.py index 2add5afb..51b50ee3 100644 --- a/platformio/home/rpc/handlers/os.py +++ b/platformio/home/rpc/handlers/os.py @@ -89,6 +89,14 @@ class OSRPC: def open_file(path): return click.launch(path) + @staticmethod + def call_path_module_func(name, args, **kwargs): + return getattr(os.path, name)(*args, **kwargs) + + @staticmethod + def get_path_separator(): + return os.sep + @staticmethod def is_file(path): return os.path.isfile(path) @@ -157,4 +165,3 @@ class OSRPC: @staticmethod def get_logical_devices(): return list_logical_devices() -