From 390ea78993596426ce5e7586d04ebbc22b6592be Mon Sep 17 00:00:00 2001 From: Aaron Riedel Date: Mon, 22 Aug 2022 16:33:22 +0200 Subject: [PATCH] more beautiful --- shcloud.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/shcloud.py b/shcloud.py index 9dde50b..b6917c1 100755 --- a/shcloud.py +++ b/shcloud.py @@ -73,12 +73,15 @@ def select_servertype(): table.add_column("Cores", justify="left", style="red", no_wrap=True) table.add_column("Memory", justify="left", style="red", no_wrap=True) table.add_column("Disk", justify="left", style="blue", no_wrap=True) - table.add_column("Storage Type", justify="center", style="blue", no_wrap=True) - table.add_column("CPU Type", justify="center", style="cyan2", no_wrap=True) - table.add_column("Deprecated", justify="center", style="grey46", no_wrap=True) + #table.add_column("Storage Type", justify="center", style="blue", no_wrap=True) + #table.add_column("CPU Type", justify="center", style="cyan2", no_wrap=True) + #table.add_column("Deprecated", justify="center", style="grey46", no_wrap=True) + table.add_column("Hourly", justify="left", style="cyan2", no_wrap=True) + table.add_column("Monthly", justify="left", style="cyan2", no_wrap=True) for m in models: - table.add_row(str(m.id), str(m.name), str(m.description), str(m.cores), str(int(m.memory)) + " GB", str(m.disk) + " GB", str(m.storage_type), str(m.cpu_type), str(m.deprecated)) + if str(m.cpu_type) == "shared": + table.add_row(str(m.id), str(m.name), str(m.description), str(m.cores), str(int(m.memory)) + " GB", str(m.disk) + " GB", format(float(m.prices[0]["price_hourly"]["gross"]), '.2f') + " €", format(float(m.prices[0]["price_monthly"]["gross"]), '.2f') + " €") console.print(table) return(Prompt.ask("Selection: ", default="cpx31")) @@ -111,10 +114,10 @@ if sys.argv[1] == "delete": s = client.servers.get_by_name(server_name) progress.update(task_search, completed=1, total=1) if s == None: - console.print("[red]Server not found") + console.print("[red]:heavy_multiplication_x: Server not found") exit(0) else: - console.print("[green]Server found") + console.print("[green]:heavy_check_mark: Server found") delete_server(s) exit(0)