def __init__(self):
self.load()
- def update(self, *args, **kwargs):
- a = dict.update(self, *args, **kwargs)
+ def __setitem__(self, *args, **kwargs):
+ s = dict.__setitem__(self, *args, **kwargs)
self.save()
- return a
+ return s
def save(self):
with open(defaults.cache_lines, 'w') as fp:
lines = Lines()
-
class Stations(dict):
stations = None
# FIXME maybe cause problems in the future, race conditions
Stations.stations[line] = self
- def update(self, *args, **kwargs):
- u = dict.update(self, *args, **kwargs)
- if args[0]:
- Stations.save()
+ def __setitem__(self, *args, **kwargs):
+ u = dict.__setitem__(self, *args, **kwargs)
+ Stations.save()
return u
@classmethod