Skip to content

Commit 40f8294

Browse files
authored
Improve the prints from launch experiment script (#128)
* Improve the prints from launch experiment script * fix coding norms Co-authored-by: danholdaway <[email protected]>
1 parent 7a8e2b0 commit 40f8294

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/swell/deployment/bin/swell_launch_experiment.py

+16-10
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def cylc_run_experiment(self): # NB: Could be a factory based on workflow_manag
4949
os.environ['CYLC_CONF_PATH'] = self.suite_path
5050

5151
# Install the suite
52-
5352
if self.log_path:
5453
# Add optional path for workflow engine logging.
5554
option = '--symlink-dirs=run=' + self.log_path
@@ -70,22 +69,28 @@ def cylc_run_experiment(self): # NB: Could be a factory based on workflow_manag
7069
subprocess.run(['cylc', 'play', self.experiment_name], check=True)
7170

7271
# Pre TUI messages
73-
self.logger.info(' ')
72+
self.logger.info(' ', False)
7473
self.logger.info('Workflow is now running... ')
75-
self.logger.info(' ')
76-
self.logger.info('Use \'cylc scan\' to see running workflows.')
77-
self.logger.info(' ')
74+
self.logger.info(' ', False)
75+
self.logger.info('Use \'\u001b[32mcylc scan\033[0m\' to see running workflows.')
76+
self.logger.info(' ', False)
7877
self.logger.info('If the workflow needs to be stopped, close the TUI (if open)')
7978
self.logger.info('by pressing \'q\' and issue either:')
80-
self.logger.info(' cylc stop ' + self.experiment_name)
79+
self.logger.info(' ', False)
80+
self.logger.info(' \u001b[32mcylc stop ' + self.experiment_name + '\033[0m')
81+
self.logger.info(' ', False)
8182
self.logger.info('or to kill running tasks and stop:')
82-
self.logger.info(' cylc stop --kill ' + self.experiment_name)
83-
self.logger.info(' ')
83+
self.logger.info(' ', False)
84+
self.logger.info(' \u001b[32mcylc stop --kill ' + self.experiment_name + '\033[0m')
85+
self.logger.info(' ', False)
8486

8587
# Launch the job monitor
8688
self.logger.input('Launching the TUI, press \'q\' at any time to exit the TUI')
89+
self.logger.info(' ', False)
8790
self.logger.info('TUI can be relaunched with:')
88-
self.logger.info(' cylc tui ' + self.experiment_name)
91+
self.logger.info(' ', False)
92+
self.logger.info(' \u001b[32mcylc tui ' + self.experiment_name + '\033[0m')
93+
self.logger.info(' ', False)
8994
subprocess.run(['cylc', 'tui', self.experiment_name], check=True)
9095

9196
# --------------------------------------------------------------------------------------------------
@@ -123,7 +128,8 @@ def main(suite_path, workflow_manager, no_detach, log_path):
123128

124129
# Write some info for the user
125130
# ----------------------------
126-
deploy_workflow.logger.info('Launching workflow defined by files in ' + suite_path + '``.')
131+
deploy_workflow.logger.info('Launching workflow defined by files in \'' + suite_path + '\'.',
132+
False)
127133
deploy_workflow.logger.info('Experiment name: ' + experiment_name)
128134
deploy_workflow.logger.info('Workflow manager: ' + workflow_manager)
129135

src/swell/utilities/logger.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,6 @@ def assert_abort(self, condition, message, wrap=True):
114114

115115
def input(self, message):
116116

117-
input('INPUT '+self.task_name+': '+message + ". Press any key to continue...")
117+
input(' '+self.task_name+': '+message + ". Press any key to continue...")
118118

119119
# ----------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)