From 8d5ca66db73c09c0d2b76ca4c60d808c246ff019 Mon Sep 17 00:00:00 2001 From: Daniel Pavel Date: Mon, 6 May 2013 17:51:03 +0200 Subject: [PATCH] get rid of bad map() calls --- lib/logitech/unifying_receiver/listener.py | 3 ++- lib/solaar/gtk.py | 6 ++++-- lib/solaar/ui/main_window.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/logitech/unifying_receiver/listener.py b/lib/logitech/unifying_receiver/listener.py index ddf4515d..6ba0d15d 100644 --- a/lib/logitech/unifying_receiver/listener.py +++ b/lib/logitech/unifying_receiver/listener.py @@ -59,7 +59,8 @@ class _ThreadedHandle(object): handles, self._handles = self._handles, [] if _log.isEnabledFor(_DEBUG): _log.debug("%s closing %s", repr(self), handles) - map(_base.close, handles) + for h in handles: + _base.close(h) @property def notifications_hook(self): diff --git a/lib/solaar/gtk.py b/lib/solaar/gtk.py index f6d35186..80fcd31f 100644 --- a/lib/solaar/gtk.py +++ b/lib/solaar/gtk.py @@ -110,9 +110,11 @@ def _run(args): from gi.repository import Gtk Gtk.main() - map(ReceiverListener.stop, listeners.values()) + for l in listeners.values(): + l.stop() ui.notify.uninit() - map(ReceiverListener.join, listeners.values()) + for l in listeners.values(): + l.join() def main(): diff --git a/lib/solaar/ui/main_window.py b/lib/solaar/ui/main_window.py index b98dc145..5c0402e3 100644 --- a/lib/solaar/ui/main_window.py +++ b/lib/solaar/ui/main_window.py @@ -359,7 +359,7 @@ def toggle_all(status_icon): if not _windows: return - visible = [w.get_visible() for w in _windows.values()] + visible = (w.get_visible() for w in _windows.values()) if all(visible): for w in _windows.values(): _hide(w)