From 43ab629a26510b790928449e4efd1730f1251af6 Mon Sep 17 00:00:00 2001 From: Daniel Pavel Date: Fri, 12 Jul 2013 22:48:09 +0200 Subject: [PATCH] moved logitech.unifying_receiver package to logitech_receiver --- lib/logitech/__init__.py | 7 ------- .../__init__.py | 3 +++ .../base.py | 0 .../base_usb.py | 0 .../common.py | 0 .../descriptors.py | 0 .../hidpp10.py | 0 .../hidpp20.py | 0 .../listener.py | 0 .../notifications.py | 0 .../receiver.py | 0 .../settings.py | 0 .../settings_templates.py | 0 .../special_keys.py | 0 .../status.py | 0 lib/solaar/cli.py | 14 +++++++------- lib/solaar/listener.py | 12 +++++++----- lib/solaar/ui/__init__.py | 2 +- lib/solaar/ui/config_panel.py | 2 +- lib/solaar/ui/pair_window.py | 2 +- lib/solaar/ui/tray.py | 2 +- lib/solaar/ui/window.py | 6 +++--- lib/solaar/upower.py | 1 - setup.py | 2 +- 24 files changed, 25 insertions(+), 28 deletions(-) delete mode 100644 lib/logitech/__init__.py rename lib/{logitech/unifying_receiver => logitech_receiver}/__init__.py (97%) rename lib/{logitech/unifying_receiver => logitech_receiver}/base.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/base_usb.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/common.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/descriptors.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/hidpp10.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/hidpp20.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/listener.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/notifications.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/receiver.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/settings.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/settings_templates.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/special_keys.py (100%) rename lib/{logitech/unifying_receiver => logitech_receiver}/status.py (100%) diff --git a/lib/logitech/__init__.py b/lib/logitech/__init__.py deleted file mode 100644 index e414df44..00000000 --- a/lib/logitech/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -# -# - -from __future__ import absolute_import, division, print_function, unicode_literals - -__version__ = "0.8" diff --git a/lib/logitech/unifying_receiver/__init__.py b/lib/logitech_receiver/__init__.py similarity index 97% rename from lib/logitech/unifying_receiver/__init__.py rename to lib/logitech_receiver/__init__.py index 027a8098..961a7692 100644 --- a/lib/logitech/unifying_receiver/__init__.py +++ b/lib/logitech_receiver/__init__.py @@ -25,6 +25,9 @@ _log.setLevel(logging.root.level) del logging +__version__ = '0.9' + + from .common import strhex from .base import NoReceiver, NoSuchDevice, DeviceUnreachable from .receiver import Receiver, PairedDevice diff --git a/lib/logitech/unifying_receiver/base.py b/lib/logitech_receiver/base.py similarity index 100% rename from lib/logitech/unifying_receiver/base.py rename to lib/logitech_receiver/base.py diff --git a/lib/logitech/unifying_receiver/base_usb.py b/lib/logitech_receiver/base_usb.py similarity index 100% rename from lib/logitech/unifying_receiver/base_usb.py rename to lib/logitech_receiver/base_usb.py diff --git a/lib/logitech/unifying_receiver/common.py b/lib/logitech_receiver/common.py similarity index 100% rename from lib/logitech/unifying_receiver/common.py rename to lib/logitech_receiver/common.py diff --git a/lib/logitech/unifying_receiver/descriptors.py b/lib/logitech_receiver/descriptors.py similarity index 100% rename from lib/logitech/unifying_receiver/descriptors.py rename to lib/logitech_receiver/descriptors.py diff --git a/lib/logitech/unifying_receiver/hidpp10.py b/lib/logitech_receiver/hidpp10.py similarity index 100% rename from lib/logitech/unifying_receiver/hidpp10.py rename to lib/logitech_receiver/hidpp10.py diff --git a/lib/logitech/unifying_receiver/hidpp20.py b/lib/logitech_receiver/hidpp20.py similarity index 100% rename from lib/logitech/unifying_receiver/hidpp20.py rename to lib/logitech_receiver/hidpp20.py diff --git a/lib/logitech/unifying_receiver/listener.py b/lib/logitech_receiver/listener.py similarity index 100% rename from lib/logitech/unifying_receiver/listener.py rename to lib/logitech_receiver/listener.py diff --git a/lib/logitech/unifying_receiver/notifications.py b/lib/logitech_receiver/notifications.py similarity index 100% rename from lib/logitech/unifying_receiver/notifications.py rename to lib/logitech_receiver/notifications.py diff --git a/lib/logitech/unifying_receiver/receiver.py b/lib/logitech_receiver/receiver.py similarity index 100% rename from lib/logitech/unifying_receiver/receiver.py rename to lib/logitech_receiver/receiver.py diff --git a/lib/logitech/unifying_receiver/settings.py b/lib/logitech_receiver/settings.py similarity index 100% rename from lib/logitech/unifying_receiver/settings.py rename to lib/logitech_receiver/settings.py diff --git a/lib/logitech/unifying_receiver/settings_templates.py b/lib/logitech_receiver/settings_templates.py similarity index 100% rename from lib/logitech/unifying_receiver/settings_templates.py rename to lib/logitech_receiver/settings_templates.py diff --git a/lib/logitech/unifying_receiver/special_keys.py b/lib/logitech_receiver/special_keys.py similarity index 100% rename from lib/logitech/unifying_receiver/special_keys.py rename to lib/logitech_receiver/special_keys.py diff --git a/lib/logitech/unifying_receiver/status.py b/lib/logitech_receiver/status.py similarity index 100% rename from lib/logitech/unifying_receiver/status.py rename to lib/logitech_receiver/status.py diff --git a/lib/solaar/cli.py b/lib/solaar/cli.py index 1f9feaeb..7cd6d617 100644 --- a/lib/solaar/cli.py +++ b/lib/solaar/cli.py @@ -32,8 +32,8 @@ def _require(module, os_package): # def _receiver(dev_path=None): - from logitech.unifying_receiver import Receiver - from logitech.unifying_receiver.base import receivers + from logitech_receiver import Receiver + from logitech_receiver.base import receivers for dev_info in receivers(): if dev_path is not None and dev_path != dev_info.path: continue @@ -93,7 +93,7 @@ def _print_receiver(receiver, verbose=False): print (" Has", paired_count, "paired device(s) out of a maximum of", receiver.max_devices, ".") - from logitech.unifying_receiver import hidpp10 + from logitech_receiver import hidpp10 notification_flags = hidpp10.get_notification_flags(receiver) if notification_flags is not None: if notification_flags: @@ -133,7 +133,7 @@ def _print_device(dev, verbose=False): if dev.power_switch_location: print (" The power switch is located on the %s." % dev.power_switch_location) - from logitech.unifying_receiver import hidpp10, hidpp20, special_keys + from logitech_receiver import hidpp10, hidpp20, special_keys if dev.online: notification_flags = hidpp10.get_notification_flags(dev) @@ -166,7 +166,7 @@ def _print_device(dev, verbose=False): if battery is None: battery = hidpp10.get_battery(dev) if battery is not None: - from logitech.unifying_receiver.common import NamedInt as _NamedInt + from logitech_receiver.common import NamedInt as _NamedInt level, status = battery if isinstance(level, _NamedInt): text = str(level) @@ -201,7 +201,7 @@ def pair_device(receiver, args): # get all current devices known_devices = [dev.number for dev in receiver] - from logitech.unifying_receiver import base, hidpp10, status, notifications + from logitech_receiver import base, hidpp10, status, notifications receiver.status = status.ReceiverStatus(receiver, lambda *args, **kwargs: None) # check if it's necessary to set the notification flags @@ -300,7 +300,7 @@ def config_device(receiver, args): print ("%s = %s" % (setting.name, setting.read())) return - from logitech.unifying_receiver import settings as _settings + from logitech_receiver import settings as _settings if setting.kind == _settings.KIND.toggle: value = args.value diff --git a/lib/solaar/listener.py b/lib/solaar/listener.py index 862e00ac..ac82fdcf 100644 --- a/lib/solaar/listener.py +++ b/lib/solaar/listener.py @@ -9,10 +9,12 @@ _log = getLogger(__name__) del getLogger from . import configuration -from logitech.unifying_receiver import (Receiver, - listener as _listener, - status as _status, - notifications as _notifications) +from logitech_receiver import ( + Receiver, + listener as _listener, + status as _status, + notifications as _notifications + ) # # @@ -254,7 +256,7 @@ from . import upower upower.watch(start_all, stop_all) -from logitech.unifying_receiver import base as _base +from logitech_receiver import base as _base _status_callback = None _error_callback = None diff --git a/lib/solaar/ui/__init__.py b/lib/solaar/ui/__init__.py index f44e7b63..17fd1782 100644 --- a/lib/solaar/ui/__init__.py +++ b/lib/solaar/ui/__init__.py @@ -139,7 +139,7 @@ def run_loop(): # # -from logitech.unifying_receiver.status import ALERT +from logitech_receiver.status import ALERT def _status_changed(device, alert, reason): assert device is not None if _log.isEnabledFor(_DEBUG): diff --git a/lib/solaar/ui/config_panel.py b/lib/solaar/ui/config_panel.py index 62d2468c..4c047efd 100644 --- a/lib/solaar/ui/config_panel.py +++ b/lib/solaar/ui/config_panel.py @@ -8,7 +8,7 @@ from gi.repository import Gtk, GLib from solaar.ui import async as _ui_async -from logitech.unifying_receiver.settings import KIND as _SETTING_KIND +from logitech_receiver.settings import KIND as _SETTING_KIND # # diff --git a/lib/solaar/ui/pair_window.py b/lib/solaar/ui/pair_window.py index aa114132..92600677 100644 --- a/lib/solaar/ui/pair_window.py +++ b/lib/solaar/ui/pair_window.py @@ -11,7 +11,7 @@ _log = getLogger(__name__) del getLogger from . import icons as _icons -from logitech.unifying_receiver.status import KEYS as _K +from logitech_receiver.status import KEYS as _K # # diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py index 3d9fd7fb..7e28d412 100644 --- a/lib/solaar/ui/tray.py +++ b/lib/solaar/ui/tray.py @@ -14,7 +14,7 @@ from gi.repository import Gtk, GLib from gi.repository.Gdk import ScrollDirection from solaar import NAME -from logitech.unifying_receiver.status import KEYS as _K +from logitech_receiver.status import KEYS as _K from . import icons as _icons from .window import popup as _window_popup, toggle as _window_toggle diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py index f5f6420d..6b4c0899 100644 --- a/lib/solaar/ui/window.py +++ b/lib/solaar/ui/window.py @@ -14,9 +14,9 @@ from gi.repository.GObject import TYPE_PYOBJECT from solaar import NAME # from solaar import __version__ as VERSION from solaar.ui import async as _ui_async -from logitech.unifying_receiver import hidpp10 as _hidpp10 -from logitech.unifying_receiver.common import NamedInts as _NamedInts, NamedInt as _NamedInt -from logitech.unifying_receiver.status import KEYS as _K +from logitech_receiver import hidpp10 as _hidpp10 +from logitech_receiver.common import NamedInts as _NamedInts, NamedInt as _NamedInt +from logitech_receiver.status import KEYS as _K from . import config_panel as _config_panel from . import action as _action, icons as _icons from .about import show_window as _show_about_window diff --git a/lib/solaar/upower.py b/lib/solaar/upower.py index 26caa93f..c0a1f1bd 100644 --- a/lib/solaar/upower.py +++ b/lib/solaar/upower.py @@ -12,7 +12,6 @@ del getLogger # As suggested here: http://stackoverflow.com/a/13548984 # - _suspend_callback = None def _suspend(): if _suspend_callback: diff --git a/setup.py b/setup.py index 42dfdf5a..2af7ae49 100755 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ battery status. requires=['pyudev (>= 0.13)', 'gi.repository.GObject (>= 2.0)', 'gi.repository.Gtk (>= 3.0)'], package_dir={'': 'lib'}, - packages=['hidapi', 'logitech', 'logitech.unifying_receiver', 'solaar', 'solaar.ui'], + packages=['hidapi', 'logitech_receiver', 'solaar', 'solaar.ui'], data_files=[('share/solaar/icons', _glob('share/solaar/icons/solaar*.svg')), ('share/solaar/icons', _glob('share/solaar/icons/light_*.png')),