Skip to content

Commit

Permalink
logitech_receiver: remove imports from __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Feb 12, 2024
1 parent 0822bfb commit 2b34973
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
7 changes: 0 additions & 7 deletions lib/logitech_receiver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@

import logging

from . import listener, status # noqa: F401
from .base import DeviceUnreachable, NoReceiver, NoSuchDevice # noqa: F401
from .common import strhex # noqa: F401
from .device import Device # noqa: F401
from .hidpp20 import FeatureCallError, FeatureNotSupported # noqa: F401
from .receiver import Receiver # noqa: F401

logger = logging.getLogger(__name__)
logger.setLevel(logging.root.level)
# if logging.root.level > logging.DEBUG:
Expand Down
8 changes: 5 additions & 3 deletions lib/solaar/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
from importlib import import_module
from traceback import extract_tb, format_exc

from logitech_receiver import Device, Receiver
import logitech_receiver.device as _device
import logitech_receiver.receiver as _receiver

from logitech_receiver.base import receivers, receivers_and_devices
from solaar import NAME

Expand Down Expand Up @@ -113,7 +115,7 @@ def _receivers(dev_path=None):
if dev_path is not None and dev_path != dev_info.path:
continue
try:
r = Receiver.open(dev_info)
r = _receiver.Receiver.open(dev_info)
if logger.isEnabledFor(logging.DEBUG):
logger.debug('[%s] => %s', dev_info.path, r)
if r:
Expand All @@ -128,7 +130,7 @@ def _receivers_and_devices(dev_path=None):
if dev_path is not None and dev_path != dev_info.path:
continue
try:
d = Device.open(dev_info) if dev_info.isDevice else Receiver.open(dev_info)
d = _device.Device.open(dev_info) if dev_info.isDevice else _receiver.Receiver.open(dev_info)
if logger.isEnabledFor(logging.DEBUG):
logger.debug('[%s] => %s', dev_info.path, d)
if d is not None:
Expand Down
7 changes: 4 additions & 3 deletions lib/solaar/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
from collections import namedtuple

import gi
import logitech_receiver.device as _device
import logitech_receiver.receiver as _receiver

from logitech_receiver import Device, Receiver
from logitech_receiver import base as _base
from logitech_receiver import hidpp10 as _hidpp10
from logitech_receiver import listener as _listener
Expand Down Expand Up @@ -302,9 +303,9 @@ def _start(device_info):
assert _status_callback
isDevice = device_info.isDevice
if not isDevice:
receiver = Receiver.open(device_info)
receiver = _receiver.Receiver.open(device_info)
else:
receiver = Device.open(device_info)
receiver = _device.Device.open(device_info)
configuration.attach_to(receiver)

if receiver:
Expand Down

0 comments on commit 2b34973

Please sign in to comment.