only save the configuration once when Solaar ends

This commit is contained in:
Daniel Pavel 2013-06-17 08:00:00 +02:00
parent 04ea8293a8
commit a29609df21
1 changed files with 2 additions and 11 deletions

View File

@ -77,8 +77,6 @@ class ReceiverListener(_listener.EventsListener):
_log.exception("closing receiver %s" % r.path)
self.status_changed_callback(r) #, _status.ALERT.NOTIFICATION)
configuration.save()
def tick(self, timestamp):
if not self.tick_period:
raise Exception("tick() should not be called without a tick_period: %s", self)
@ -134,20 +132,11 @@ class ReceiverListener(_listener.EventsListener):
assert device.receiver == self.receiver
if device.status is None:
# device was just un-paired
# it may be paired later, possibly to another receiver?
# so maybe we shouldn't forget about it
# configuration.forget(device)
# device was unpaired, and since the object is weakref'ed
# it won't be valid for much longer
_log.info("device %s was unpaired, ghosting", device)
device = _ghost(device)
# elif device.status:
# configuration.apply_to(device)
# configuration.acquire_from(device)
self.status_changed_callback(device, alert, reason)
if device.status is None:
@ -228,6 +217,8 @@ def stop_all():
for l in listeners:
l.join()
configuration.save()
_status_callback = None
_error_callback = None