From c6e003468448c11362677c04c42918f9b51b98ed Mon Sep 17 00:00:00 2001 From: sanqui Date: Mon, 27 Mar 2017 17:50:04 +0000 Subject: [PATCH 1/2] Nicely align columns in the garden table --- menu_screen.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/menu_screen.py b/menu_screen.py index e96491d..d0b65ef 100644 --- a/menu_screen.py +++ b/menu_screen.py @@ -250,10 +250,13 @@ class CursedMenu(object): if this_garden[plant_id]: if not this_garden[plant_id]["dead"]: this_plant = this_garden[plant_id] - plant_table += this_plant["owner"] + " - " - plant_table += this_plant["age"] + " - " - plant_table += str(this_plant["score"]) + "p - " - plant_table += this_plant["description"] + "\n" + entry = "{:14} - {:>16} - {: 7}p - {}\n".format( + this_plant["owner"], + this_plant["age"], + this_plant["score"], + this_plant["description"] + ) + plant_table += entry # build list of n entries per page entries_per_page = self.maxy - 16 garden_list = plant_table.splitlines() From a77d61abc7fcbf180a8091718f4a213009ff595d Mon Sep 17 00:00:00 2001 From: Jake Funke Date: Mon, 27 Mar 2017 11:50:50 -0700 Subject: [PATCH 2/2] Column formatting for garden view --- menu_screen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu_screen.py b/menu_screen.py index d0b65ef..ad3247e 100644 --- a/menu_screen.py +++ b/menu_screen.py @@ -250,7 +250,7 @@ class CursedMenu(object): if this_garden[plant_id]: if not this_garden[plant_id]["dead"]: this_plant = this_garden[plant_id] - entry = "{:14} - {:>16} - {: 7}p - {}\n".format( + entry = "{:14} - {:>16} - {:>7}p - {}\n".format( this_plant["owner"], this_plant["age"], this_plant["score"],