From 6ceffd90989168619fc63bd272c9a5a883e490f2 Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Tue, 20 Nov 2018 20:43:48 -0600 Subject: [PATCH 1/3] Limit length of longer usernames --- menu_screen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu_screen.py b/menu_screen.py index 90b3602..70c10e1 100644 --- a/menu_screen.py +++ b/menu_screen.py @@ -301,7 +301,7 @@ class CursedMenu(object): if this_garden[plant_id]: if not this_garden[plant_id]["dead"]: this_plant = this_garden[plant_id] - plant_table.append((this_plant["owner"], + plant_table.append((this_plant["owner"][:14], this_plant["age"], int(this_plant["score"]), this_plant["description"])) From 056df53b47a8c775397ee6ca85af6029ce0f8fc1 Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Sat, 24 Nov 2018 22:34:04 -0600 Subject: [PATCH 2/3] Revert previous changes. NEXT: draw_info_text stuff. --- menu_screen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu_screen.py b/menu_screen.py index 70c10e1..90b3602 100644 --- a/menu_screen.py +++ b/menu_screen.py @@ -301,7 +301,7 @@ class CursedMenu(object): if this_garden[plant_id]: if not this_garden[plant_id]["dead"]: this_plant = this_garden[plant_id] - plant_table.append((this_plant["owner"][:14], + plant_table.append((this_plant["owner"], this_plant["age"], int(this_plant["score"]), this_plant["description"])) From 7fcfedade0819e420db269da2b5199e58348bdfa Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Sat, 24 Nov 2018 22:47:28 -0600 Subject: [PATCH 3/3] Better strategy for truncating long usernames. --- menu_screen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu_screen.py b/menu_screen.py index 90b3602..3f3d6dd 100644 --- a/menu_screen.py +++ b/menu_screen.py @@ -308,7 +308,7 @@ class CursedMenu(object): return plant_table def format_garden_entry(self, entry): - return "{:14} - {:>16} - {:>8}p - {}".format(*entry) + return "{:14.14} - {:>16} - {:>8}p - {}".format(*entry) def sort_garden_table(self, table, column, ascending): """ Sort table in place by a specified column """