Skip to content

Commit

Permalink
Merge pull request #337 from populse/view_pipeline
Browse files Browse the repository at this point in the history
Added subcommand "view" to "python -m capsul" to lauch pipeline developer view
  • Loading branch information
denisri authored Nov 23, 2023
2 parents e7fd316 + a499a3c commit 1ae0bb1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions capsul/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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"):
Expand Down

0 comments on commit 1ae0bb1

Please sign in to comment.