From 2770b31be3e28317758791728a93c716f3830d5b Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Fri, 25 Jan 2019 18:27:39 +0100 Subject: [PATCH] Colour: Once you pop, you can't stop --- nf_core/launch.py | 2 +- nf_core/lint.py | 12 ++++++------ scripts/nf-core | 14 ++++++-------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/nf_core/launch.py b/nf_core/launch.py index f527b75a0d..4fc151c0be 100644 --- a/nf_core/launch.py +++ b/nf_core/launch.py @@ -164,7 +164,7 @@ def __prompt_defaults_from_param_objects(cls, params_grouped): for group_label, params in params_grouped.items(): click.echo("\n\n{}{}".format( click.style('Parameter group: ', bold=True, underline=True), - click.style(group_label, bold=True, underline=True, fg='red'), + click.style(group_label, bold=True, underline=True, fg='red') )) use_defaults = click.confirm( "Do you want to change the group's defaults? "+click.style('[y/N]', fg='green'), diff --git a/nf_core/lint.py b/nf_core/lint.py index d4135439fc..2388e0f51d 100755 --- a/nf_core/lint.py +++ b/nf_core/lint.py @@ -818,13 +818,13 @@ def print_results(self): # Print results rl = "\n Using --release mode linting tests" if self.release_mode else '' logging.info("===========\n LINTING RESULTS\n=================\n" + - "{0:>4} tests passed".format(len(self.passed)) + - "{0:>4} tests had warnings".format(len(self.warned)) + - "{0:>4} tests failed".format(len(self.failed)) + rl + click.style("{0:>4} tests passed".format(len(self.passed)), fg='green') + + click.style("{0:>4} tests had warnings".format(len(self.warned)), fg='yellow') + + click.style("{0:>4} tests failed".format(len(self.failed)), fg='red') + rl ) if len(self.passed) > 0: - logging.debug("Test Passed:\n {}".format("\n ".join(["http://nf-co.re/errors#{}: {}".format(eid, msg) for eid, msg in self.passed]))) + logging.debug("{}\n {}".format(click.style("Test Passed:", fg='green'), "\n ".join(["http://nf-co.re/errors#{}: {}".format(eid, msg) for eid, msg in self.passed]))) if len(self.warned) > 0: - logging.warn("Test Warnings:\n {}".format("\n ".join(["http://nf-co.re/errors#{}: {}".format(eid, msg) for eid, msg in self.warned]))) + logging.warn("{}\n {}".format(click.style("Test Warnings:", fg='yellow'), "\n ".join(["http://nf-co.re/errors#{}: {}".format(eid, msg) for eid, msg in self.warned]))) if len(self.failed) > 0: - logging.error("Test Failures:\n {}".format("\n ".join(["http://nf-co.re/errors#{}: {}".format(eid, msg) for eid, msg in self.failed]))) + logging.error("{}\n {}".format(click.style("Test Failures:", fg='red'), "\n ".join(["http://nf-co.re/errors#{}: {}".format(eid, msg) for eid, msg in self.failed]))) diff --git a/scripts/nf-core b/scripts/nf-core index b34ac7741c..fd692fa474 100755 --- a/scripts/nf-core +++ b/scripts/nf-core @@ -132,7 +132,7 @@ def download(pipeline, release, singularity, outdir): @click.option( '--direct', is_flag = True, - default = False, + default = False, help = "Uses given values from the parameter file directly." ) def launch(pipeline, params, direct): @@ -231,11 +231,9 @@ def create(name, description, author, new_version, no_git, force, outdir): if __name__ == '__main__': - print(""" - ,--./,-. - ___ __ __ __ ___ /,-._.--~\\ - |\ | |__ __ / ` / \ |__) |__ } { - | \| | \__, \__/ | \ |___ \`-._,-`-, - `._,._,' - """, file=sys.stderr) + click.echo(click.style("\n ,--.", fg='green')+click.style("/",fg='black')+click.style(",-.", fg='green')) + click.echo(click.style(" ___ __ __ __ ___ ", fg='blue')+click.style("/,-._.--~\\", fg='green')) + click.echo(click.style(" |\ | |__ __ / ` / \ |__) |__ ", fg='blue')+click.style(" } {", fg='yellow')) + click.echo(click.style(" | \| | \__, \__/ | \ |___ ", fg='blue')+click.style("\`-._,-`-,", fg='green')) + click.secho(" `._,._,'\n", fg='green') nf_core_cli()