Skip to content

Commit

Permalink
Remove recently-added show functionality from reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Sep 5, 2023
1 parent 08f83fc commit 19fa4b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 33 deletions.
4 changes: 2 additions & 2 deletions cylc/flow/flow_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
def add_flow_opts(parser):
parser.add_option(
"--flow", action="append", dest="flow", metavar="FLOW",
help=f'Assign the triggered task to all active flows ("{FLOW_ALL}");'
help=f'Assign new tasks to all active flows ("{FLOW_ALL}");'
f' no flow ("{FLOW_NONE}"); a new flow ("{FLOW_NEW}");'
f' or a specific flow (e.g. "2"). The default is "{FLOW_ALL}".'
' Reuse the option to assign multiple specific flows.'
Expand All @@ -51,7 +51,7 @@ def add_flow_opts(parser):
parser.add_option(
"--meta", metavar="DESCRIPTION", action="store",
dest="flow_descr", default=None,
help=f"description of triggered flow (with --flow={FLOW_NEW})."
help=f"description of new flow (with --flow={FLOW_NEW})."
)

parser.add_option(
Expand Down
41 changes: 10 additions & 31 deletions cylc/flow/scripts/reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@
Setting (completing) outputs contributes to a task's completion, and sets the
corresponding prerequisites of child tasks.
Default: if no outputs or prerequisites are specified, set all required outputs
(note: this won't set the `succeeded` output if success is optional).
Default (no outputs or prerequisites given): set all required outputs.
(Note: this won't set the `succeeded` output if success is optional!).
Setting an output also sets any implied outputs:
- started implies submitted
- succeeded and failed imply started
- custom outputs and expired do not imply any other outputs
Specify prerequisites in the form "point/task:message".
Specify prerequisites in the form: "point/task:message".
Specify outputs by the label in the graph, not the corresponding task message.
"""

from functools import partial
from optparse import Values
from json import dumps
from typing import Dict

from cylc.flow.exceptions import InputError
from cylc.flow.network.client_factory import get_client
Expand All @@ -55,7 +55,6 @@
validate_flow_opts
)
from cylc.flow.task_pool import REC_CLI_PREREQ
from cylc.flow.scripts.show import prereqs_and_outputs_query


MUTATION = '''
Expand Down Expand Up @@ -95,10 +94,9 @@ def get_option_parser() -> COP:
parser.add_option(
"-o", "--out", "--output", metavar="OUTPUT(s)",
help=(
"Set task outputs completed, along with any implied outputs."
' May be "all", to set all required outputs complete.'
"Set task outputs complete, along with any implied outputs."
" OUTPUT is the label (as used in the graph) not the associated"
" message. Multiple use allowed, may be comma separated."
" message. Multiple use allowed, items may be comma separated."
),
action="append", default=None, dest="outputs"
)
Expand All @@ -107,9 +105,9 @@ def get_option_parser() -> COP:
"-p", "--pre", "--prerequisite", metavar="PREREQUISITE(s)",
help=(
"Set task prerequisites satisfied."
' May be "all", which is equivalent to "cylc trigger".'
" Prerequisite format: 'point/task:message'."
" Multiple use allowed, may be comma separated."
" PREREQUISITE format: 'point/task:message'."
" Multiple use allowed, items may be comma separated. See also"
" `cylc trigger` (equivalent to setting all prerequisites)."
),
action="append", default=None, dest="prerequisites"
)
Expand Down Expand Up @@ -164,25 +162,6 @@ async def run(options: 'Values', workflow_id: str, *tokens_list) -> None:

await pclient.async_request('graphql', mutation_kwargs)

# Print `cylc show` info as feedback to user.
# TODO: do this FIRST; the mutation may not (won't?) be done in time.
opts = Values()
json_filter: Dict = {}
opts.json = False
opts.list_prereqs = False

result = await prereqs_and_outputs_query(
workflow_id,
tokens_list,
pclient,
opts,
json_filter,
)
if opts.json:
print(dumps(json_filter, indent=4))
else:
print(result)


@cli_function(get_option_parser)
def main(parser: COP, options: 'Values', *ids) -> None:
Expand Down

0 comments on commit 19fa4b2

Please sign in to comment.