diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-09-08 13:07:26 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-09-08 13:11:05 +0200 |
| commit | cc2fd03b4ca02b0030eb293cc4fe01944311b0cf (patch) | |
| tree | 081095b25878882d58e8248aaa208d15631450f2 | |
| parent | 9105e2f70aa1ef3605f8ed9806243384b8b2db9c (diff) | |
| download | geldschieberbot-cc2fd03b4ca02b0030eb293cc4fe01944311b0cf.tar.gz geldschieberbot-cc2fd03b4ca02b0030eb293cc4fe01944311b0cf.zip | |
don't append \n in one but not all summaries
| -rw-r--r-- | geldschieberbot.py | 6 |
1 files 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: |
