From 5ae8a36ca6370bf7d2506b84fd5f8d06afe6b5e1 Mon Sep 17 00:00:00 2001 From: Stavros Kolometsos Date: Wed, 27 Oct 2021 12:51:36 +0300 Subject: [PATCH] Replace print with click.echo() Click has already a function integrated, that works a little better than print. Justification: https://click.palletsprojects.com/en/5.x/quickstart/#echoing . Minor detail but maybe useful. --- evolved5g/cli_helper.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/evolved5g/cli_helper.py b/evolved5g/cli_helper.py index 752cffb..cf45c33 100644 --- a/evolved5g/cli_helper.py +++ b/evolved5g/cli_helper.py @@ -2,6 +2,7 @@ import requests import json import json.decoder +from click import echo @@ -60,7 +61,7 @@ def run_pipeline(self): mode = input("Type in which pipeline you want to run: build, deploy or destroy:\n ") result = self.curl(self.generate_token(), self.branch, mode) - print ("The ID of your pipeline is:\n", result,"\n") + echo("The ID of your pipeline is:\n", result,"\n") def check_pipeline(self): @@ -71,17 +72,17 @@ def check_pipeline(self): result = self.curl(self.generate_token(), pipelineid, "check") if result["status"] == "QUEUED": - print(result) + echo(result) else: console = (json.dumps(result["console_log"]).split('\\n')) for element in console: if "] { (" in element: - print (element) + echo(element) elif "[Pipeline]" not in element: - print (element) + echo(element) elif "] stage" in element: - print (element) + echo(element)