diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2022-07-26 16:13:08 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2022-07-26 16:13:08 +0200 |
| commit | 5b1e9657518c87acb89dde410393b52be81c2b96 (patch) | |
| tree | f0e09dc15b5f5f38f25971c95fd793e9323bda02 | |
| parent | 2734771b4bb7f8c9f65561010b965c28aaf09cfa (diff) | |
| download | geldschieberbot-5b1e9657518c87acb89dde410393b52be81c2b96.tar.gz geldschieberbot-5b1e9657518c87acb89dde410393b52be81c2b96.zip | |
geldschieberbot: support choosing the entries in a summary
| -rw-r--r-- | geldschieberbot.py | 5 |
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 |
