From dda60f4df7166fffe5a71e215c472f4079aa832d Mon Sep 17 00:00:00 2001 From: Dimitrios Theodorakis Date: Thu, 8 Aug 2024 13:57:30 +0100 Subject: [PATCH] Open splash as a separate rose command / process. --- metomi/rose/gtk/splash.py | 7 +++---- setup.cfg | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/metomi/rose/gtk/splash.py b/metomi/rose/gtk/splash.py index 76eb2d137..0566451f5 100755 --- a/metomi/rose/gtk/splash.py +++ b/metomi/rose/gtk/splash.py @@ -228,8 +228,7 @@ def _update_buffered(self, *args, **kwargs): __call__ = update def start(self): - file_name = __file__.rsplit(".", 1)[0] + ".py" - self.process = Popen([file_name] + list(self.args), stdin=PIPE) + self.process = Popen(" ".join(["rose launch-splash-screen"] + list(self.args)), shell=True, stdin=PIPE) def stop(self): if self.process is not None and not self.process.stdin.closed: @@ -291,10 +290,10 @@ def _update_splash_screen(self, update_input): return False -def main(): +def main(argv=sys.argv): """Start splash screen.""" sys.path.append(os.getenv('ROSE_HOME')) - splash_screen = SplashScreen(*sys.argv[1:]) + splash_screen = SplashScreen(argv[0], argv[1], argv[2]) stop_event = threading.Event() update_thread = SplashScreenUpdaterThread( splash_screen, stop_event, sys.stdin) diff --git a/setup.cfg b/setup.cfg index 04c368c33..5d6219844 100644 --- a/setup.cfg +++ b/setup.cfg @@ -115,6 +115,7 @@ rose.commands = env-cat = metomi.rose.env_cat:main host-select = metomi.rose.host_select:main host-select-client = metomi.rose.host_select_client:main + launch-splash-screen = metomi.rose.gtk.splash:main macro = metomi.rose.macro:main metadata-check = metomi.rose.metadata_check:main metadata-gen = metomi.rose.metadata_gen:main