From cef5c37a0dc5d059837a50e27c57966afd119f0c Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Mon, 8 Aug 2016 15:59:20 +0100 Subject: [PATCH] More message printing tweaks. --- gprMax/gprMax.py | 12 ++++++------ gprMax/utilities.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gprMax/gprMax.py b/gprMax/gprMax.py index c3676415..ec66123f 100644 --- a/gprMax/gprMax.py +++ b/gprMax/gprMax.py @@ -153,7 +153,7 @@ def run_std_sim(args, numbermodelruns, inputfile, usernamespace, optparams=None) modelusernamespace = usernamespace run_model(args, modelrun, numbermodelruns, inputfile, modelusernamespace) tsimend = perf_counter() - simcompletestr = '\n== Simulation completed in [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=int(tsimend - tsimstart))) + simcompletestr = '\n=== Simulation completed in [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=int(tsimend - tsimstart))) print('{} {}\n'.format(simcompletestr, '=' * (get_terminal_size()[0] - 1 - len(simcompletestr)))) @@ -186,7 +186,7 @@ def run_benchmark_sim(args, inputfile, usernamespace): threads = np.array(threads) np.savez(os.path.splitext(inputfile)[0], threads=threads, benchtimes=benchtimes, version=__version__) - simcompletestr = '\n== Simulation completed' + simcompletestr = '\n=== Simulation completed' print('{} {}\n'.format(simcompletestr, '=' * (get_terminal_size()[0] - 1 - len(simcompletestr)))) @@ -266,7 +266,7 @@ def run_mpi_sim(args, numbermodelruns, inputfile, usernamespace, optparams=None) comm.send(None, dest=0, tag=tags.EXIT.value) tsimend = perf_counter() - simcompletestr = '\n== Simulation completed in [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=int(tsimend - tsimstart))) + simcompletestr = '\n=== Simulation completed in [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=int(tsimend - tsimstart))) print('{} {}\n'.format(simcompletestr, '=' * (get_terminal_size()[0] - 1 - len(simcompletestr)))) @@ -292,12 +292,12 @@ def run_model(args, modelrun, numbermodelruns, inputfile, usernamespace): # Normal model reading/building process; bypassed if geometry information to be reused if 'G' not in globals(): - inputfilestr = '\nModel {} of {}, input file: {}'.format(modelrun, numbermodelruns, inputfile) - print(Fore.GREEN + '{} {}\n'.format(inputfilestr, '-' * (get_terminal_size()[0] - 1 - len(inputfilestr)))) + inputfilestr = '\n--- Model {} of {}, input file: {}'.format(modelrun, numbermodelruns, inputfile) + print(Fore.GREEN + '{} {}\n'.format(inputfilestr, '-' * (get_terminal_size()[0] - 1 - len(inputfilestr))) + Style.RESET_ALL) # Add the current model run to namespace that can be accessed by user in any Python code blocks in input file usernamespace['current_model_run'] = modelrun - print(Style.RESET_ALL + 'Constants/variables available for Python scripting: {}\n'.format(usernamespace)) + print('Constants/variables available for Python scripting: {}\n'.format(usernamespace)) # Read input file and process any Python or include commands processedlines = process_python_include_code(inputfile, usernamespace) diff --git a/gprMax/utilities.py b/gprMax/utilities.py index dbe0323c..db8799fc 100644 --- a/gprMax/utilities.py +++ b/gprMax/utilities.py @@ -34,7 +34,7 @@ def logo(version): version (str): Version number. """ - description = 'Electromagnetic modelling software based on the Finite-Difference Time-Domain (FDTD) method' + description = '\n=== Electromagnetic modelling software based on the Finite-Difference Time-Domain (FDTD) method' copyright = 'Copyright (C) 2015-2016: The University of Edinburgh' authors = 'Authors: Craig Warren and Antonis Giannopoulos' licenseinfo1 = 'gprMax is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n' @@ -49,7 +49,7 @@ def logo(version): |___/|_| v""" + version - print('\n== {} {}\n'.format(description, '=' * (get_terminal_size()[0] - (len(description)) - 4))) + print('{} {}\n'.format(description, '=' * (get_terminal_size()[0] - len(description) - 1))) print(Fore.CYAN + '{}\n'.format(logo)) print(Style.RESET_ALL + textwrap.fill(copyright, width=get_terminal_size()[0], initial_indent=' ')) print(textwrap.fill(authors, width=get_terminal_size()[0], initial_indent=' '))