Skip to content

Commit

Permalink
Merge pull request #4331 from oliver-sanders/jupyter_server
Browse files Browse the repository at this point in the history
Jupyter server
  • Loading branch information
oliver-sanders authored Aug 31, 2021
2 parents 08fb721 + 789dbf5 commit d41994d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 13 deletions.
14 changes: 9 additions & 5 deletions cylc/flow/network/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1444,11 +1444,15 @@ class TimePoint(String):
class WorkflowStopMode(Enum):
"""The mode used to stop a running workflow."""

# NOTE: using a different enum because:
# * Graphene requires special enums.
# * We only want to offer a subset of stop modes.

# Note: contains only the REQUEST_* values from StopMode
Clean = StopMode.REQUEST_CLEAN
Kill = StopMode.REQUEST_KILL
Now = StopMode.REQUEST_NOW
NowNow = StopMode.REQUEST_NOW_NOW
Clean = StopMode.REQUEST_CLEAN.value
Kill = StopMode.REQUEST_KILL.value
Now = StopMode.REQUEST_NOW.value
NowNow = StopMode.REQUEST_NOW_NOW.value

@property
def description(self):
Expand Down Expand Up @@ -1722,7 +1726,7 @@ class Meta:
class Arguments:
workflows = List(WorkflowID, required=True)
mode = WorkflowStopMode(
default_value=StopMode.REQUEST_CLEAN
default_value=WorkflowStopMode.Clean.value # type: ignore
)
cycle_point = CyclePoint(
description='Stop after the workflow reaches this cycle.'
Expand Down
5 changes: 5 additions & 0 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,11 @@ def command_stop(
pass
else:
# immediate shutdown
try:
mode = StopMode(mode)
except ValueError:
LOG.error(f'Invalid stop mode {mode}')
return
self._set_stop(mode)
if mode is StopMode.REQUEST_KILL:
self.time_next_kill = time()
Expand Down
17 changes: 9 additions & 8 deletions cylc/flow/scripts/cylc.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ def get_version(long=False):
' use cylc graph <flow1> --diff <flow2>',
'gscan':
'cylc gscan has been removed, use the web UI',
'gui':
'cylc gui has been removed, use the web UI',
'insert':
'inserting tasks is now done automatically',
'jobscript':
Expand Down Expand Up @@ -329,7 +327,7 @@ def cli_version(long_fmt=False):
"""Wrapper for get_version."""
print(get_version(long_fmt))
if long_fmt:
list_plugins()
print(list_plugins())
sys.exit(0)


Expand Down Expand Up @@ -357,23 +355,26 @@ def list_plugins():
for entry_point in entry_points
}

lines = []
if dists:
print('\nPlugins:')
lines.append('\nPlugins:')
maxlen1 = max(len(dist.project_name) for dist in dists) + 2
maxlen2 = max(len(dist.version) for dist in dists) + 2
for dist in dists:
print(
lines.append(
f' {dist.project_name.ljust(maxlen1)}'
f' {dist.version.ljust(maxlen2)}'
f' {dist.module_path}'
)

print('\nEntry Points:')
lines.append('\nEntry Points:')
for entry_point_name, entry_points in entry_point_groups.items():
if entry_points:
print(f' {entry_point_name}:')
lines.append(f' {entry_point_name}:')
for entry_point in entry_points:
print(f' {entry_point}')
lines.append(f' {entry_point}')

return '\n'.join(lines)


@contextmanager
Expand Down

0 comments on commit d41994d

Please sign in to comment.