isort: intial import fix

Signed-off-by: Filipe Laíns <lains@archlinux.org>
This commit is contained in:
Filipe Laíns 2020-07-02 14:18:22 +01:00 committed by Filipe Laíns
parent be4e88dc1a
commit e6369e0c3c
35 changed files with 253 additions and 213 deletions

View File

@ -20,17 +20,6 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
__version__ = '0.9' from hidapi.udev import close, enumerate, get_manufacturer, get_product, get_serial, monitor_glib, open, open_path, read, write
from hidapi.udev import ( __version__ = '0.9'
enumerate,
open,
close,
open_path,
monitor_glib,
read,
write,
get_manufacturer,
get_product,
get_serial,
)

View File

@ -21,9 +21,12 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import os import os
import sys import sys
from select import select as _select
import time import time
from binascii import hexlify, unhexlify from binascii import hexlify, unhexlify
from select import select as _select
from threading import Lock
import hidapi as _hid import hidapi as _hid
# #
@ -59,7 +62,6 @@ except:
# #
# #
from threading import Lock
print_lock = Lock() print_lock = Lock()
del Lock del Lock

View File

@ -27,17 +27,21 @@ necessary.
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
import os as _os
import errno as _errno import errno as _errno
from time import sleep import os as _os
from select import select as _select
from pyudev import Context as _Context, Monitor as _Monitor, Device as _Device
from pyudev import DeviceNotFoundError
native_implementation = 'udev'
# the tuple object we'll expose when enumerating devices # the tuple object we'll expose when enumerating devices
from collections import namedtuple from collections import namedtuple
from select import select as _select
from time import sleep
from pyudev import Context as _Context
from pyudev import Device as _Device
from pyudev import DeviceNotFoundError
from pyudev import Monitor as _Monitor
native_implementation = 'udev'
DeviceInfo = namedtuple('DeviceInfo', [ DeviceInfo = namedtuple('DeviceInfo', [
'path', 'path',
'vendor_id', 'vendor_id',

View File

@ -33,6 +33,12 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import logging import logging
from . import listener, status
from .base import DeviceUnreachable, NoReceiver, NoSuchDevice
from .common import strhex
from .hidpp20 import FeatureCallError, FeatureNotSupported
from .receiver import PairedDevice, Receiver
_DEBUG = logging.DEBUG _DEBUG = logging.DEBUG
_log = logging.getLogger(__name__) _log = logging.getLogger(__name__)
_log.setLevel(logging.root.level) _log.setLevel(logging.root.level)
@ -43,11 +49,3 @@ _log.setLevel(logging.root.level)
del logging del logging
__version__ = '0.9' __version__ = '0.9'
from .common import strhex
from .base import NoReceiver, NoSuchDevice, DeviceUnreachable
from .receiver import Receiver, PairedDevice
from .hidpp20 import FeatureNotSupported, FeatureCallError
from . import listener
from . import status

View File

@ -22,17 +22,23 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from time import time as _timestamp from collections import namedtuple
from logging import DEBUG as _DEBUG
from logging import getLogger
from random import getrandbits as _random_bits from random import getrandbits as _random_bits
from time import time as _timestamp
from logging import getLogger, DEBUG as _DEBUG import hidapi as _hid
_log = getLogger(__name__)
del getLogger
from .common import strhex as _strhex, KwException as _KwException, pack as _pack
from . import hidpp10 as _hidpp10 from . import hidpp10 as _hidpp10
from . import hidpp20 as _hidpp20 from . import hidpp20 as _hidpp20
import hidapi as _hid from .base_usb import ALL as _RECEIVER_USB_IDS
from .common import KwException as _KwException
from .common import pack as _pack
from .common import strhex as _strhex
_log = getLogger(__name__)
del getLogger
# #
# #
@ -86,8 +92,6 @@ class DeviceUnreachable(_KwException):
# #
# #
from .base_usb import ALL as _RECEIVER_USB_IDS
def receivers(): def receivers():
"""List all the Linux devices exposed by the UR attached to the machine.""" """List all the Linux devices exposed by the UR attached to the machine."""
@ -305,7 +309,6 @@ def make_notification(devnumber, data):
return _HIDPP_Notification(devnumber, sub_id, address, data[2:]) return _HIDPP_Notification(devnumber, sub_id, address, data[2:])
from collections import namedtuple
_HIDPP_Notification = namedtuple('_HIDPP_Notification', _HIDPP_Notification = namedtuple('_HIDPP_Notification',
('devnumber', 'sub_id', 'address', 'data')) ('devnumber', 'sub_id', 'address', 'data'))
_HIDPP_Notification.__str__ = lambda self: 'Notification(%d,%02X,%02X,%s)' % ( _HIDPP_Notification.__str__ = lambda self: 'Notification(%d,%02X,%02X,%s)' % (

View File

@ -22,7 +22,9 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from binascii import hexlify as _hexlify from binascii import hexlify as _hexlify
from collections import namedtuple
from struct import pack, unpack from struct import pack, unpack
try: try:
unicode unicode
# if Python2, unicode_literals will mess our first (un)pack() argument # if Python2, unicode_literals will mess our first (un)pack() argument
@ -278,7 +280,6 @@ class KwException(Exception):
return self.args[0][k] return self.args[0][k]
from collections import namedtuple
"""Firmware information.""" """Firmware information."""
FirmwareInfo = namedtuple('FirmwareInfo', FirmwareInfo = namedtuple('FirmwareInfo',
['kind', 'name', 'version', 'extras']) ['kind', 'name', 'version', 'extras'])

View File

@ -19,15 +19,18 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from .common import NamedInts as _NamedInts
from .hidpp10 import REGISTERS as _R, DEVICE_KIND as _DK
from .settings_templates import RegisterSettings as _RS, FeatureSettings as _FS
#
#
#
from collections import namedtuple from collections import namedtuple
from .common import NamedInts as _NamedInts
from .hidpp10 import DEVICE_KIND as _DK
from .hidpp10 import REGISTERS as _R
from .settings_templates import FeatureSettings as _FS
from .settings_templates import RegisterSettings as _RS
#
#
#
_DeviceDescriptor = namedtuple('_DeviceDescriptor', _DeviceDescriptor = namedtuple('_DeviceDescriptor',
('name', 'kind', 'wpid', 'codename', 'protocol', ('name', 'kind', 'wpid', 'codename', 'protocol',
'registers', 'settings', 'persister')) 'registers', 'settings', 'persister'))

View File

@ -20,14 +20,17 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger # , DEBUG as _DEBUG from logging import getLogger # , DEBUG as _DEBUG
from .common import FirmwareInfo as _FirmwareInfo
from .common import NamedInts as _NamedInts
from .common import bytes2int as _bytes2int
from .common import int2bytes as _int2bytes
from .common import strhex as _strhex
from .hidpp20 import BATTERY_STATUS, FIRMWARE_KIND
_log = getLogger(__name__) _log = getLogger(__name__)
del getLogger del getLogger
from .common import (strhex as _strhex, bytes2int as _bytes2int, int2bytes as
_int2bytes, NamedInts as _NamedInts, FirmwareInfo as
_FirmwareInfo)
from .hidpp20 import FIRMWARE_KIND, BATTERY_STATUS
# #
# Constants - most of them as defined by the official Logitech HID++ 1.0 # Constants - most of them as defined by the official Logitech HID++ 1.0
# documentation, some of them guessed. # documentation, some of them guessed.

View File

@ -21,16 +21,21 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG from logging import DEBUG as _DEBUG
from logging import getLogger
from . import special_keys
from .common import FirmwareInfo as _FirmwareInfo
from .common import KwException as _KwException
from .common import NamedInts as _NamedInts
from .common import ReprogrammableKeyInfo as _ReprogrammableKeyInfo
from .common import ReprogrammableKeyInfoV4 as _ReprogrammableKeyInfoV4
from .common import pack as _pack
from .common import unpack as _unpack
_log = getLogger(__name__) _log = getLogger(__name__)
del getLogger del getLogger
from .common import (FirmwareInfo as _FirmwareInfo, ReprogrammableKeyInfo as
_ReprogrammableKeyInfo, ReprogrammableKeyInfoV4 as
_ReprogrammableKeyInfoV4, KwException as _KwException,
NamedInts as _NamedInts, pack as _pack, unpack as _unpack)
from . import special_keys
# #
# #
# #

View File

@ -20,6 +20,13 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
import threading as _threading import threading as _threading
from logging import DEBUG as _DEBUG
from logging import INFO as _INFO
from logging import getLogger
from . import base as _base
# from time import time as _timestamp # from time import time as _timestamp
# for both Python 2 and 3 # for both Python 2 and 3
@ -28,12 +35,9 @@ try:
except ImportError: except ImportError:
from queue import Queue as _Queue from queue import Queue as _Queue
from logging import getLogger, DEBUG as _DEBUG, INFO as _INFO
_log = getLogger(__name__) _log = getLogger(__name__)
del getLogger del getLogger
from . import base as _base
# #
# #
# #

View File

@ -22,16 +22,21 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG, INFO as _INFO from logging import DEBUG as _DEBUG
_log = getLogger(__name__) from logging import INFO as _INFO
del getLogger from logging import getLogger
from .i18n import _
from .common import strhex as _strhex, unpack as _unpack
from . import hidpp10 as _hidpp10 from . import hidpp10 as _hidpp10
from . import hidpp20 as _hidpp20 from . import hidpp20 as _hidpp20
from .status import KEYS as _K, ALERT as _ALERT
from .base import DJ_NOTIFICATION_LENGTH as _DJ_NOTIFICATION_LENGTH from .base import DJ_NOTIFICATION_LENGTH as _DJ_NOTIFICATION_LENGTH
from .common import strhex as _strhex
from .common import unpack as _unpack
from .i18n import _
from .status import ALERT as _ALERT
from .status import KEYS as _K
_log = getLogger(__name__)
del getLogger
_R = _hidpp10.REGISTERS _R = _hidpp10.REGISTERS
_F = _hidpp20.FEATURE _F = _hidpp20.FEATURE

View File

@ -21,18 +21,20 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import errno as _errno import errno as _errno
from logging import getLogger, INFO as _INFO from logging import INFO as _INFO
_log = getLogger(__name__) from logging import getLogger
del getLogger
from .i18n import _
from . import base as _base from . import base as _base
from . import hidpp10 as _hidpp10 from . import hidpp10 as _hidpp10
from . import hidpp20 as _hidpp20 from . import hidpp20 as _hidpp20
from .base_usb import product_information as _product_information
from .common import strhex as _strhex from .common import strhex as _strhex
from .descriptors import DEVICES as _DESCRIPTORS from .descriptors import DEVICES as _DESCRIPTORS
from .i18n import _
from .settings_templates import check_feature_settings as _check_feature_settings from .settings_templates import check_feature_settings as _check_feature_settings
from .base_usb import product_information as _product_information
_log = getLogger(__name__)
del getLogger
_R = _hidpp10.REGISTERS _R = _hidpp10.REGISTERS

View File

@ -19,19 +19,20 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG, INFO as _INFO
_log = getLogger(__name__)
del getLogger
from copy import copy as _copy
import math import math
from .common import ( from copy import copy as _copy
NamedInt as _NamedInt, from logging import DEBUG as _DEBUG
NamedInts as _NamedInts, from logging import INFO as _INFO
bytes2int as _bytes2int, from logging import getLogger
int2bytes as _int2bytes,
) from .common import NamedInt as _NamedInt
from .common import NamedInts as _NamedInts
from .common import bytes2int as _bytes2int
from .common import int2bytes as _int2bytes
_log = getLogger(__name__)
del getLogger
# #
# #

View File

@ -19,36 +19,35 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG from collections import namedtuple
_log = getLogger(__name__) from logging import DEBUG as _DEBUG
del getLogger from logging import getLogger
from .i18n import _
from . import hidpp10 as _hidpp10 from . import hidpp10 as _hidpp10
from . import hidpp20 as _hidpp20 from . import hidpp20 as _hidpp20
from . import special_keys as _special_keys from . import special_keys as _special_keys
from .common import ( from .common import NamedInt as _NamedInt
bytes2int as _bytes2int, from .common import NamedInts as _NamedInts
int2bytes as _int2bytes, from .common import ReprogrammableKeyInfoV4 as _ReprogrammableKeyInfoV4
NamedInt as _NamedInt, from .common import bytes2int as _bytes2int
NamedInts as _NamedInts, from .common import int2bytes as _int2bytes
unpack as _unpack, from .common import unpack as _unpack
ReprogrammableKeyInfoV4 as _ReprogrammableKeyInfoV4, from .i18n import _
) from .settings import KIND as _KIND
from .settings import ( from .settings import BitFieldSetting as _BitFieldSetting
KIND as _KIND, from .settings import BitFieldValidator as _BitFieldV
Setting as _Setting, from .settings import BooleanValidator as _BooleanV
BitFieldSetting as _BitFieldSetting, from .settings import ChoicesMapValidator as _ChoicesMapV
Settings as _Settings, from .settings import ChoicesValidator as _ChoicesV
RegisterRW as _RegisterRW, from .settings import FeatureRW as _FeatureRW
FeatureRW as _FeatureRW, from .settings import FeatureRWMap as _FeatureRWMap
FeatureRWMap as _FeatureRWMap, from .settings import RangeValidator as _RangeV
BooleanValidator as _BooleanV, from .settings import RegisterRW as _RegisterRW
BitFieldValidator as _BitFieldV, from .settings import Setting as _Setting
ChoicesValidator as _ChoicesV, from .settings import Settings as _Settings
ChoicesMapValidator as _ChoicesMapV,
RangeValidator as _RangeV, _log = getLogger(__name__)
) del getLogger
_DK = _hidpp10.DEVICE_KIND _DK = _hidpp10.DEVICE_KIND
_R = _hidpp10.REGISTERS _R = _hidpp10.REGISTERS
@ -670,8 +669,6 @@ def _feature_disable_keyboard_keys():
# #
# #
from collections import namedtuple
def _S(name, featureID=None, featureFn=None, registerFn=None, identifier=None): def _S(name, featureID=None, featureFn=None, registerFn=None, identifier=None):
return (name, featureID, featureFn, registerFn, return (name, featureID, featureFn, registerFn,

View File

@ -19,16 +19,18 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import DEBUG as _DEBUG
from logging import getLogger
from time import time as _timestamp from time import time as _timestamp
from logging import getLogger, DEBUG as _DEBUG
_log = getLogger(__name__)
del getLogger
from .i18n import _, ngettext
from .common import NamedInts as _NamedInts, NamedInt as _NamedInt
from . import hidpp10 as _hidpp10 from . import hidpp10 as _hidpp10
from . import hidpp20 as _hidpp20 from . import hidpp20 as _hidpp20
from .common import NamedInt as _NamedInt
from .common import NamedInts as _NamedInts
from .i18n import _, ngettext
_log = getLogger(__name__)
del getLogger
_R = _hidpp10.REGISTERS _R = _hidpp10.REGISTERS

View File

@ -22,12 +22,14 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import argparse as _argparse import argparse as _argparse
import sys as _sys import sys as _sys
from logging import getLogger, DEBUG as _DEBUG from logging import DEBUG as _DEBUG
_log = getLogger(__name__) from logging import getLogger
del getLogger
from solaar import NAME from solaar import NAME
_log = getLogger(__name__)
del getLogger
# #
# #
# #

View File

@ -19,8 +19,8 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from solaar import configuration as _configuration
from logitech_receiver import settings as _settings from logitech_receiver import settings as _settings
from solaar import configuration as _configuration
def _print_setting(s, verbose=True): def _print_setting(s, verbose=True):

View File

@ -21,12 +21,10 @@ from __future__ import absolute_import, division, print_function, unicode_litera
from time import time as _timestamp from time import time as _timestamp
from logitech_receiver import ( from logitech_receiver import base as _base
base as _base, from logitech_receiver import hidpp10 as _hidpp10
hidpp10 as _hidpp10, from logitech_receiver import notifications as _notifications
status as _status, from logitech_receiver import status as _status
notifications as _notifications,
)
def run(receivers, args, find_receiver, _ignore): def run(receivers, args, find_receiver, _ignore):

View File

@ -21,19 +21,15 @@ from __future__ import absolute_import, division, print_function, unicode_litera
from time import time as _timestamp from time import time as _timestamp
from logitech_receiver import base as _base
from logitech_receiver import hidpp10 as _hidpp10
from logitech_receiver import notifications as _notifications
from logitech_receiver import status as _status
from logitech_receiver.common import strhex as _strhex from logitech_receiver.common import strhex as _strhex
from solaar.cli.show import _print_receiver
from logitech_receiver import (
base as _base,
hidpp10 as _hidpp10,
status as _status,
notifications as _notifications,
)
_R = _hidpp10.REGISTERS _R = _hidpp10.REGISTERS
from solaar.cli.show import _print_receiver
def run(receivers, args, find_receiver, _ignore): def run(receivers, args, find_receiver, _ignore):
assert receivers assert receivers

View File

@ -19,9 +19,10 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logitech_receiver import (hidpp10 as _hidpp10, hidpp20 as _hidpp20, from logitech_receiver import hidpp10 as _hidpp10
special_keys as _special_keys, from logitech_receiver import hidpp20 as _hidpp20
settings_templates as _settings_templates) from logitech_receiver import settings_templates as _settings_templates
from logitech_receiver import special_keys as _special_keys
from logitech_receiver.common import NamedInt as _NamedInt from logitech_receiver.common import NamedInt as _NamedInt

View File

@ -19,9 +19,15 @@
import os as _os import os as _os
import os.path as _path import os.path as _path
from json import load as _json_load, dump as _json_save
from logging import getLogger, DEBUG as _DEBUG, INFO as _INFO from json import dump as _json_save
from json import load as _json_load
from logging import DEBUG as _DEBUG
from logging import INFO as _INFO
from logging import getLogger
from solaar import __version__
_log = getLogger(__name__) _log = getLogger(__name__)
del getLogger del getLogger
@ -29,7 +35,6 @@ _XDG_CONFIG_HOME = _os.environ.get('XDG_CONFIG_HOME') or _path.expanduser(
_path.join('~', '.config')) _path.join('~', '.config'))
_file_path = _path.join(_XDG_CONFIG_HOME, 'solaar', 'config.json') _file_path = _path.join(_XDG_CONFIG_HOME, 'solaar', 'config.json')
from solaar import __version__
_KEY_VERSION = '_version' _KEY_VERSION = '_version'
_KEY_NAME = '_name' _KEY_NAME = '_name'
_configuration = {} _configuration = {}

View File

@ -22,9 +22,10 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import importlib import importlib
from solaar import __version__, NAME
import solaar.i18n as _i18n
import solaar.cli as _cli import solaar.cli as _cli
import solaar.i18n as _i18n
from solaar import NAME, __version__
# #
# #

View File

@ -19,6 +19,9 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
import gettext as _gettext
import locale
from solaar import NAME as _NAME from solaar import NAME as _NAME
# #
@ -48,7 +51,6 @@ def _find_locale_path(lc_domain):
# del _path # del _path
import locale
locale.setlocale(locale.LC_ALL, '') locale.setlocale(locale.LC_ALL, '')
language, encoding = locale.getlocale() language, encoding = locale.getlocale()
del locale del locale
@ -56,8 +58,6 @@ del locale
_LOCALE_DOMAIN = _NAME.lower() _LOCALE_DOMAIN = _NAME.lower()
path = _find_locale_path(_LOCALE_DOMAIN) path = _find_locale_path(_LOCALE_DOMAIN)
import gettext as _gettext
_gettext.bindtextdomain(_LOCALE_DOMAIN, path) _gettext.bindtextdomain(_LOCALE_DOMAIN, path)
_gettext.textdomain(_LOCALE_DOMAIN) _gettext.textdomain(_LOCALE_DOMAIN)
_gettext.install(_LOCALE_DOMAIN) _gettext.install(_LOCALE_DOMAIN)

View File

@ -18,22 +18,30 @@
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
import time import time
from logging import getLogger, INFO as _INFO, WARNING as _WARNING from collections import namedtuple
from logging import INFO as _INFO
from logging import WARNING as _WARNING
from logging import getLogger
from logitech_receiver import Receiver
from logitech_receiver import base as _base
from logitech_receiver import listener as _listener
from logitech_receiver import notifications as _notifications
from logitech_receiver import status as _status
from solaar.i18n import _
from . import configuration
_log = getLogger(__name__) _log = getLogger(__name__)
del getLogger del getLogger
from solaar.i18n import _
from . import configuration
from logitech_receiver import (Receiver, listener as _listener, status as
_status, notifications as _notifications)
# #
# #
# #
from collections import namedtuple
_GHOST_DEVICE = namedtuple( _GHOST_DEVICE = namedtuple(
'_GHOST_DEVICE', '_GHOST_DEVICE',
('receiver', 'number', 'name', 'kind', 'status', 'online')) ('receiver', 'number', 'name', 'kind', 'status', 'online'))
@ -323,7 +331,6 @@ def ping_all(resuming=False):
break break
from logitech_receiver import base as _base
_status_callback = None _status_callback = None
_error_callback = None _error_callback = None

View File

@ -20,12 +20,13 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG from logging import DEBUG as _DEBUG
from logging import getLogger
from threading import Thread as _Thread
_log = getLogger(__name__) _log = getLogger(__name__)
del getLogger del getLogger
from threading import Thread as _Thread
try: try:
from Queue import Queue as _Queue from Queue import Queue as _Queue
except ImportError: except ImportError:

View File

@ -19,14 +19,16 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG from logging import DEBUG as _DEBUG
_log = getLogger(__name__) from logging import getLogger
del getLogger
from gi.repository import GLib, Gtk from gi.repository import GLib, Gtk
from logitech_receiver.status import ALERT
from solaar.i18n import _ from solaar.i18n import _
_log = getLogger(__name__)
del getLogger
# #
# #
# #
@ -88,7 +90,7 @@ def ui_async(function, *args, **kwargs):
# #
# #
from . import notify, tray, window from . import notify, tray, window # isort:skip # noqa: E402
def _startup(app, startup_hook, use_tray, show_window): def _startup(app, startup_hook, use_tray, show_window):
@ -161,8 +163,6 @@ def run_loop(startup_hook, shutdown_hook, use_tray, show_window, args=None):
# #
# #
from logitech_receiver.status import ALERT
def _status_changed(device, alert, reason): def _status_changed(device, alert, reason):
assert device is not None assert device is not None

View File

@ -20,8 +20,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from gi.repository import Gtk from gi.repository import Gtk
from solaar import NAME, __version__
from solaar import __version__, NAME
from solaar.i18n import _ from solaar.i18n import _
# #

View File

@ -19,14 +19,18 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from gi.repository import Gtk, Gdk from gi.repository import Gdk, Gtk
from solaar import NAME
from solaar.i18n import _
from ..ui import error_dialog
from . import pair_window
from .about import show_window as _show_about_window
# from logging import getLogger # from logging import getLogger
# _log = getLogger(__name__) # _log = getLogger(__name__)
# del getLogger # del getLogger
from solaar.i18n import _
# #
# #
# #
@ -63,8 +67,6 @@ def make_toggle(name, label, function, stock_id=None, *args):
# action.set_sensitive(notify.available) # action.set_sensitive(notify.available)
# toggle_notifications = make_toggle('notifications', 'Notifications', _toggle_notifications) # toggle_notifications = make_toggle('notifications', 'Notifications', _toggle_notifications)
from .about import show_window as _show_about_window
from solaar import NAME
about = make('help-about', about = make('help-about',
_("About") + ' ' + NAME, _("About") + ' ' + NAME,
_show_about_window, _show_about_window,
@ -74,8 +76,6 @@ about = make('help-about',
# #
# #
from . import pair_window
def pair(window, receiver): def pair(window, receiver):
assert receiver assert receiver
@ -90,9 +90,6 @@ def pair(window, receiver):
pair_dialog.present() pair_dialog.present()
from ..ui import error_dialog
def unpair(window, device): def unpair(window, device):
assert device assert device
assert device.kind is not None assert device.kind is not None

View File

@ -19,12 +19,12 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from gi.repository import Gtk, GLib
from threading import Timer as _Timer from threading import Timer as _Timer
from gi.repository import GLib, Gtk
from logitech_receiver.settings import KIND as _SETTING_KIND
from solaar.i18n import _ from solaar.i18n import _
from solaar.ui import ui_async as _ui_async from solaar.ui import ui_async as _ui_async
from logitech_receiver.settings import KIND as _SETTING_KIND
# #
# #

View File

@ -19,12 +19,15 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG from logging import DEBUG as _DEBUG
_log = getLogger(__name__) from logging import getLogger
del getLogger
import solaar.gtk as gtk
from gi.repository import Gtk from gi.repository import Gtk
import solaar.gtk as gtk
_log = getLogger(__name__)
del getLogger
# #
# #

View File

@ -19,16 +19,18 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from gi.repository import Gtk, GLib from logging import DEBUG as _DEBUG
from logging import getLogger
from gi.repository import GLib, Gtk
from logitech_receiver.status import KEYS as _K
from solaar.i18n import _
from . import icons as _icons
from logging import getLogger, DEBUG as _DEBUG
_log = getLogger(__name__) _log = getLogger(__name__)
del getLogger del getLogger
from solaar.i18n import _
from . import icons as _icons
from logitech_receiver.status import KEYS as _K
# #
# #
# #

View File

@ -18,22 +18,25 @@
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
import os import os
from logging import getLogger, DEBUG as _DEBUG from logging import DEBUG as _DEBUG
_log = getLogger(__name__) from logging import getLogger
del getLogger
from time import time as _timestamp from time import time as _timestamp
from gi.repository import Gtk, GLib from gi.repository import GLib, Gtk
from gi.repository.Gdk import ScrollDirection from gi.repository.Gdk import ScrollDirection
from logitech_receiver.status import KEYS as _K
from solaar import NAME from solaar import NAME
from solaar.i18n import _ from solaar.i18n import _
from logitech_receiver.status import KEYS as _K
from . import icons as _icons from . import icons as _icons
from .window import popup as _window_popup, toggle as _window_toggle from .window import popup as _window_popup
from .window import toggle as _window_toggle
_log = getLogger(__name__)
del getLogger
# #
# constants # constants

View File

@ -19,24 +19,28 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG from logging import DEBUG as _DEBUG
_log = getLogger(__name__) from logging import getLogger
del getLogger
from gi.repository import Gtk, Gdk, GLib from gi.repository import Gdk, GLib, Gtk
from gi.repository.GObject import TYPE_PYOBJECT from gi.repository.GObject import TYPE_PYOBJECT
from logitech_receiver import hidpp10 as _hidpp10
from logitech_receiver.common import NamedInt as _NamedInt
from logitech_receiver.common import NamedInts as _NamedInts
from logitech_receiver.status import KEYS as _K
from solaar import NAME from solaar import NAME
from solaar.i18n import _, ngettext from solaar.i18n import _, ngettext
# from solaar import __version__ as VERSION # from solaar import __version__ as VERSION
from solaar.ui import ui_async as _ui_async from solaar.ui import ui_async as _ui_async
from logitech_receiver import hidpp10 as _hidpp10
from logitech_receiver.common import NamedInts as _NamedInts, NamedInt as _NamedInt from . import action as _action
from logitech_receiver.status import KEYS as _K
from . import config_panel as _config_panel from . import config_panel as _config_panel
from . import action as _action, icons as _icons from . import icons as _icons
from .about import show_window as _show_about_window from .about import show_window as _show_about_window
_log = getLogger(__name__)
del getLogger
# #
# constants # constants
# #

View File

@ -19,7 +19,9 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, INFO as _INFO from logging import INFO as _INFO
from logging import getLogger
_log = getLogger(__name__) _log = getLogger(__name__)
del getLogger del getLogger

View File

@ -4,12 +4,12 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
import sys import sys
sys.path += (sys.path[0] + '/../lib', )
import hidapi import hidapi
from logitech.unifying_receiver.base import DEVICE_UNIFYING_RECEIVER
from logitech.unifying_receiver.base import DEVICE_UNIFYING_RECEIVER_2 from logitech.unifying_receiver.base import DEVICE_NANO_RECEIVER, DEVICE_UNIFYING_RECEIVER, DEVICE_UNIFYING_RECEIVER_2
from logitech.unifying_receiver.base import DEVICE_NANO_RECEIVER
sys.path += (sys.path[0] + '/../lib', )
def print_event(action, device): def print_event(action, device):