From a499a3cee66531640e463ede9437a9bf60fcd009 Mon Sep 17 00:00:00 2001 From: sapetnioc Date: Thu, 23 Nov 2023 14:44:14 +0100 Subject: [PATCH] Added subcommand "view" to "python -m capsul" to lauch pipeline developer view --- capsul/__main__.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/capsul/__main__.py b/capsul/__main__.py index 93d325465..40fd51cf6 100644 --- a/capsul/__main__.py +++ b/capsul/__main__.py @@ -45,6 +45,11 @@ def executable_parser(executable): ) run_parser.add_argument("executable") +run_parser = subparsers.add_parser( + "view", help="Display an executable in pipeline developer view" +) +run_parser.add_argument("executable") + help_parser = subparsers.add_parser( "help", help="Get help about a command or a process" ) @@ -139,7 +144,19 @@ def executable_parser(executable): print(stdout, end="") if stderr: print(stderr, end="") +elif options.subcommand == "view": + # Other commands must be able to work without PyQt installed + from soma.qt_gui.qt_backend import Qt + from capsul.qt_gui.widgets import PipelineDeveloperView + executable = Capsul.executable(options.executable) + app = Qt.QApplication(sys.argv) + view = PipelineDeveloperView( + executable, allow_open_controller=True, show_sub_pipelines=True + ) + view.show() + app.exec_() + del view elif options.subcommand == "help": if options.command_or_executable in ("configure", "run", "help"):