From cc2fd03b4ca02b0030eb293cc4fe01944311b0cf Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 8 Sep 2019 13:07:26 +0200 Subject: don't append \n in one but not all summaries --- geldschieberbot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/geldschieberbot.py b/geldschieberbot.py index 8b1cbbf..7778af4 100644 --- a/geldschieberbot.py +++ b/geldschieberbot.py @@ -114,7 +114,7 @@ def create_summary(user): total -= amount summary += "\t{} {} {}\n".format("<-" if amount < 0 else "->", person, to_euro(abs(amount))) if summary == "": - summary = "\tAll fine :)\n" + summary = "\tAll fine :)" else: summary += "\tBalance: {}".format(to_euro(total)) summary = user + ":\n" + summary @@ -393,11 +393,11 @@ def cars(sender, args, msg): for car in cars_to_list: if car in available_cars: ret_msg += header_fmt.format(car, available_cars[car]) - ret_msg += create_summary(car) + ret_msg += create_summary(car) + "\n" else: return None, '"{}" is no available car\n'.format(car) - return ret_msg, None + return ret_msg[:-1], None # add car elif args[1] in ["add", "new"]: if len(args) < 4: -- cgit v1.2.3