Files
ResInsight/GrpcInterface/Python/rips/taskmaestro_helper/__main__.py
T
Kristian Bendiksen 3a7b8f6be8 Workflows: Add UI for taskmaestro workflows
Discover taskmaestro workflows under ~/.taskmaestro/workflows/ and surface
them as a "Workflows" collection in the project tree alongside Scripts.
Each workflow's task input schema is auto-generated by introspecting the
Pydantic models via a Python helper (rips.taskmaestro_helper) and rendered
as PDM field bindings - scalars for str/int/float/bool, and PdmPtrField
pickers for fields typed as rips.Case / rips.WellPath / rips.View.

The Run button on a RimWorkflow writes input.yaml from current bindings
(rips object references serialized as __resinsight_ref__ maps), spawns
the helper's run subcommand, and streams output to a modeless log dialog.
The helper resolves __resinsight_ref__ markers back to live rips objects
via the running ResInsight's gRPC server before driving taskmaestro.
2026-10-05 19:56:36 +02:00

35 lines
708 B
Python

"""Command-line entry point: `python -m rips.taskmaestro_helper <subcommand>`."""
from __future__ import annotations
import sys
def main() -> int:
if len(sys.argv) < 2:
print(
"usage: python -m rips.taskmaestro_helper <introspect|run> ...",
file=sys.stderr,
)
return 2
subcommand = sys.argv[1]
rest = sys.argv[2:]
if subcommand == "introspect":
from . import introspect
return introspect.main(rest)
if subcommand == "run":
from . import run
return run.main(rest)
print(f"unknown subcommand: {subcommand}", file=sys.stderr)
return 2
if __name__ == "__main__":
raise SystemExit(main())