This commit is contained in:
Daniel Pavel 2012-10-13 18:29:10 +03:00
parent e6d1244ed5
commit e3ce7179f5
2 changed files with 7 additions and 4 deletions

View File

@ -7,6 +7,9 @@ __version__ = '0.4'
# #
import logging import logging
# from gi import pygtkcompat
# pygtkcompat.enable_gtk()
from gi.repository import (Gtk, GObject) from gi.repository import (Gtk, GObject)
from logitech.devices import constants as C from logitech.devices import constants as C
@ -61,9 +64,9 @@ if __name__ == '__main__':
arg_parser.add_argument('-v', '--verbose', action='count', default=0, arg_parser.add_argument('-v', '--verbose', action='count', default=0,
help='increase the logger verbosity (may be repeated)') help='increase the logger verbosity (may be repeated)')
arg_parser.add_argument('-S', '--no-systray', action='store_false', dest='systray', arg_parser.add_argument('-S', '--no-systray', action='store_false', dest='systray',
help='embed the application into the systray') help='don\'t embed the application window into the systray')
arg_parser.add_argument('-N', '--no-notifications', action='store_false', dest='notifications', arg_parser.add_argument('-N', '--no-notifications', action='store_false', dest='notifications',
help='disable desktop notifications (if systray is enabled)') help='disable desktop notifications (shown only when in systray)')
arg_parser.add_argument('-V', '--version', action='version', version='%(prog)s ' + __version__) arg_parser.add_argument('-V', '--version', action='version', version='%(prog)s ' + __version__)
args = arg_parser.parse_args() args = arg_parser.parse_args()

View File

@ -74,7 +74,7 @@ class Watcher(Thread):
self.listener.request(base.request, 0xFF, b'\x80\x02', b'\x02') self.listener.request(base.request, 0xFF, b'\x80\x02', b'\x02')
# give it some time to get the devices # give it some time to get the devices
time.sleep(5) time.sleep(3)
elif not self.listener: elif not self.listener:
self.listener = None self.listener = None
self.devices.clear() self.devices.clear()
@ -88,7 +88,7 @@ class Watcher(Thread):
self.no_receiver.wait() self.no_receiver.wait()
self.no_receiver.clear() self.no_receiver.clear()
else: else:
self._device_status_changed(self.rstatus, C.STATUS.OFFLINE, _NO_RECEIVER) self._device_status_changed(self.rstatus, C.STATUS.UNAVAILABLE, _NO_RECEIVER)
time.sleep(5) time.sleep(5)
if self.listener: if self.listener: