aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2022-07-26 16:13:08 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2022-07-26 16:13:08 +0200
commit5b1e9657518c87acb89dde410393b52be81c2b96 (patch)
treef0e09dc15b5f5f38f25971c95fd793e9323bda02
parent2734771b4bb7f8c9f65561010b965c28aaf09cfa (diff)
downloadgeldschieberbot-5b1e9657518c87acb89dde410393b52be81c2b96.tar.gz
geldschieberbot-5b1e9657518c87acb89dde410393b52be81c2b96.zip
geldschieberbot: support choosing the entries in a summary
-rw-r--r--geldschieberbot.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/geldschieberbot.py b/geldschieberbot.py
index ccfe96f..1ae85ed 100644
--- a/geldschieberbot.py
+++ b/geldschieberbot.py
@@ -111,7 +111,7 @@ class Geldschieberbot:
cmd += f' --quote-timestamp={quote.timestamp} --quote-author={quote.author}'
subprocess.run(cmd.split(' '), input=msg.encode(), check=False)
- def create_summary(self, user) -> str:
+ def create_summary(self, user, include=None) -> str:
"""Create a summary for a user"""
msg = ''
cars_summary = ""
@@ -119,6 +119,9 @@ class Geldschieberbot:
cars_total = 0
p_balances = self.balance[user] # failes if user is not in balance
for person in p_balances:
+ if include and not person in include:
+ continue
+
amount = p_balances[person]
if amount == 0:
continue