minor clean-ups and formatting

This commit is contained in:
Daniel Pavel 2013-07-12 22:39:17 +02:00
parent a966bbff6f
commit b83a14e16f
13 changed files with 23 additions and 19 deletions

View File

@ -16,7 +16,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
import logging
_DEBUG = logging.DEBUG
_log = logging.getLogger('LUR')
_log = logging.getLogger(__name__)
_log.setLevel(logging.root.level)
# if logging.root.level > logging.DEBUG:
# _log.addHandler(logging.NullHandler())

View File

@ -9,7 +9,7 @@ from time import time as _timestamp
from random import getrandbits as _random_bits
from logging import getLogger, DEBUG as _DEBUG
_log = getLogger('LUR.base')
_log = getLogger(__name__)
del getLogger

View File

@ -5,6 +5,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals
# each tuple contains (vendor_id, product_id, usb interface number, hid driver)
# standard Unifying receivers (marked with the orange Unifying logo)

View File

@ -4,6 +4,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from . import hidpp10 as _hidpp10
from .common import NamedInts as _NamedInts
from .settings_templates import RegisterSettings as _RS, FeatureSettings as _FS

View File

@ -5,9 +5,10 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger # , DEBUG as _DEBUG
_log = getLogger('LUR.hidpp10')
_log = getLogger(__name__)
del getLogger
from .common import (strhex as _strhex,
bytes2int as _bytes2int,
int2bytes as _int2bytes,

View File

@ -5,12 +5,10 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG
_log = getLogger('LUR.hidpp20')
_log = getLogger(__name__)
del getLogger
# from weakref import proxy as _proxy
from .common import (FirmwareInfo as _FirmwareInfo,
ReprogrammableKeyInfo as _ReprogrammableKeyInfo,
KwException as _KwException,
@ -125,7 +123,7 @@ class FeaturesArray(object):
def __init__(self, device):
assert device is not None
self.device = device # _proxy(device)
self.device = device
self.supported = True
self.features = None
@ -259,7 +257,7 @@ class KeysArray(object):
def __init__(self, device, count):
assert device is not None
self.device = device # _proxy(device)
self.device = device
self.keys = [None] * count
def __getitem__(self, index):

View File

@ -14,9 +14,10 @@ except ImportError:
from queue import Queue as _Queue
from logging import getLogger, DEBUG as _DEBUG, INFO as _INFO
_log = getLogger('LUR.listener')
_log = getLogger(__name__)
del getLogger
from . import base as _base
#

View File

@ -6,9 +6,10 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger, DEBUG as _DEBUG, INFO as _INFO
_log = getLogger('LUR.notifications')
_log = getLogger(__name__)
del getLogger
from .common import strhex as _strhex, unpack as _unpack
from . import hidpp10 as _hidpp10
from . import hidpp20 as _hidpp20

View File

@ -5,12 +5,12 @@
from __future__ import absolute_import, division, print_function, unicode_literals
import errno as _errno
# from weakref import proxy as _proxy
from logging import getLogger, INFO as _INFO
_log = getLogger('LUR.receiver')
_log = getLogger(__name__)
del getLogger
from . import base as _base
from . import hidpp10 as _hidpp10
from . import hidpp20 as _hidpp20
@ -27,7 +27,7 @@ _R = _hidpp10.REGISTERS
class PairedDevice(object):
def __init__(self, receiver, number, link_notification=None):
assert receiver
self.receiver = receiver # _proxy(receiver)
self.receiver = receiver
assert number > 0 and number <= receiver.max_devices
# Device number, 1..6 for unifying devices, 1 otherwise.

View File

@ -4,9 +4,9 @@
from __future__ import absolute_import, division, print_function, unicode_literals
# from weakref import proxy as _proxy
from copy import copy as _copy
from .common import NamedInt as _NamedInt, NamedInts as _NamedInts
#
@ -48,7 +48,7 @@ class Setting(object):
o = _copy(self)
o._value = None
o._device = device # _proxy(device)
o._device = device
return o
@property

View File

@ -4,6 +4,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from . import hidpp10 as _hidpp10
from . import hidpp20 as _hidpp20
from .settings import (

View File

@ -4,6 +4,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from .common import NamedInts as _NamedInts
# <controls.xml awk -F\" '/<Control /{sub(/^LD_FINFO_(CTRLID_)?/, "", $2);printf("\t%s=0x%04X,\n", $2, $4)}' | sort -t= -k2

View File

@ -5,10 +5,9 @@
from __future__ import absolute_import, division, print_function, unicode_literals
from time import time as _timestamp
# from weakref import proxy as _proxy
from logging import getLogger, DEBUG as _DEBUG
_log = getLogger('LUR.status')
_log = getLogger(__name__)
del getLogger
@ -66,7 +65,7 @@ class ReceiverStatus(dict):
"""
def __init__(self, receiver, changed_callback):
assert receiver
self._receiver = receiver # _proxy(receiver)
self._receiver = receiver
assert changed_callback
self._changed_callback = changed_callback
@ -113,7 +112,7 @@ class DeviceStatus(dict):
"""
def __init__(self, device, changed_callback):
assert device
self._device = device #_proxy(device)
self._device = device
assert changed_callback
self._changed_callback = changed_callback