aboutsummaryrefslogtreecommitdiff
path: root/geldschieberbot.py
diff options
context:
space:
mode:
Diffstat (limited to 'geldschieberbot.py')
-rw-r--r--geldschieberbot.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/geldschieberbot.py b/geldschieberbot.py
index 39352d2..2853379 100644
--- a/geldschieberbot.py
+++ b/geldschieberbot.py
@@ -153,14 +153,18 @@ class Geldschieberbot:
except (KeyError, TypeError):
# convert from old plain changes format
if isinstance(list(self.state['changes'].values())[0], list):
- self.state['changes'] = {
- name: [
- Change(ch[0],
- [Modification(r, d, a)
- for r, d, a in ch[1:]], None) for ch in changes
- ]
- for name, changes in self.state['changes'].items()
- }
+ for name, changes in self.state['changes'].items():
+ user_changes = []
+ for ch in changes:
+ try:
+ user_changes.append(
+ Change(ch[0], [
+ Modification(r, d, a) for r, d, a in ch[1:]
+ ], None))
+ except (ValueError, TypeError):
+ continue
+
+ self.state['changes'][name] = user_changes
for key in self.STATE_KEYS:
# add missing keys to an existsing state