don't use proxies for receiver/device objects
they should be unnecessary now that their status is properly tracked
This commit is contained in:
parent
dc59c79bd3
commit
70c341e268
|
@ -4,6 +4,10 @@
|
|||
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
from logging import getLogger, DEBUG as _DEBUG
|
||||
_log = getLogger('LUR.hidpp20')
|
||||
del getLogger
|
||||
|
||||
from struct import pack as _pack, unpack as _unpack
|
||||
try:
|
||||
unicode
|
||||
|
@ -15,11 +19,7 @@ try:
|
|||
except:
|
||||
pass
|
||||
|
||||
from weakref import proxy as _proxy
|
||||
|
||||
from logging import getLogger, DEBUG as _DEBUG
|
||||
_log = getLogger('LUR.hidpp20')
|
||||
del getLogger
|
||||
# from weakref import proxy as _proxy
|
||||
|
||||
from .common import (FirmwareInfo as _FirmwareInfo,
|
||||
ReprogrammableKeyInfo as _ReprogrammableKeyInfo,
|
||||
|
@ -133,7 +133,7 @@ class FeaturesArray(object):
|
|||
|
||||
def __init__(self, device):
|
||||
assert device is not None
|
||||
self.device = _proxy(device)
|
||||
self.device = device # _proxy(device)
|
||||
self.supported = True
|
||||
self.features = None
|
||||
|
||||
|
@ -265,7 +265,7 @@ class KeysArray(object):
|
|||
|
||||
def __init__(self, device, count):
|
||||
assert device is not None
|
||||
self.device = _proxy(device)
|
||||
self.device = device # _proxy(device)
|
||||
self.keys = [None] * count
|
||||
|
||||
def __getitem__(self, index):
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
import errno as _errno
|
||||
from weakref import proxy as _proxy
|
||||
# from weakref import proxy as _proxy
|
||||
|
||||
from logging import getLogger
|
||||
_log = getLogger('LUR.receiver')
|
||||
|
@ -28,7 +28,7 @@ MAX_PAIRED_DEVICES = 6
|
|||
class PairedDevice(object):
|
||||
def __init__(self, receiver, number, link_notification=None):
|
||||
assert receiver
|
||||
self.receiver = _proxy(receiver)
|
||||
self.receiver = receiver # _proxy(receiver)
|
||||
assert number > 0 and number <= receiver.max_devices
|
||||
self.number = number
|
||||
self.online = None
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
from weakref import proxy as _proxy
|
||||
# from weakref import proxy as _proxy
|
||||
from copy import copy as _copy
|
||||
|
||||
from .common import NamedInt as _NamedInt, NamedInts as _NamedInts
|
||||
|
@ -35,7 +35,7 @@ class _Setting(object):
|
|||
def __call__(self, device):
|
||||
o = _copy(self)
|
||||
o._value = None
|
||||
o._device = _proxy(device)
|
||||
o._device = device # _proxy(device)
|
||||
return o
|
||||
|
||||
@property
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
from time import time as _timestamp
|
||||
from weakref import proxy as _proxy
|
||||
# from weakref import proxy as _proxy
|
||||
|
||||
from struct import unpack as _unpack
|
||||
try:
|
||||
|
@ -58,7 +58,7 @@ class ReceiverStatus(dict):
|
|||
"""
|
||||
def __init__(self, receiver, changed_callback):
|
||||
assert receiver
|
||||
self._receiver = _proxy(receiver)
|
||||
self._receiver = receiver # _proxy(receiver)
|
||||
|
||||
assert changed_callback
|
||||
self._changed_callback = changed_callback
|
||||
|
@ -125,7 +125,7 @@ class DeviceStatus(dict):
|
|||
"""
|
||||
def __init__(self, device, changed_callback):
|
||||
assert device
|
||||
self._device = _proxy(device)
|
||||
self._device = device #_proxy(device)
|
||||
|
||||
assert changed_callback
|
||||
self._changed_callback = changed_callback
|
||||
|
|
Loading…
Reference in New Issue