From 7dbeab11a50cb7f0c23b3d216c2d876cf64ad875 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 29 Oct 2019 17:36:36 +0200 Subject: [PATCH] Add new OS.RPC "open_file" method for PIO Home --- platformio/commands/home/rpc/handlers/os.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platformio/commands/home/rpc/handlers/os.py b/platformio/commands/home/rpc/handlers/os.py index 1be28fc8..c019fbc7 100644 --- a/platformio/commands/home/rpc/handlers/os.py +++ b/platformio/commands/home/rpc/handlers/os.py @@ -82,6 +82,10 @@ class OSRPC(object): path.encode(get_filesystem_encoding()) if PY2 else path, locate=True ) + @staticmethod + def open_file(path): + return click.launch(path.encode(get_filesystem_encoding()) if PY2 else path) + @staticmethod def is_file(path): return isfile(path)