don't use proxies for receiver/device objects

they should be unnecessary now that their status is properly tracked
This commit is contained in:
Daniel Pavel 2013-06-23 18:37:50 +02:00
parent dc59c79bd3
commit 70c341e268
4 changed files with 14 additions and 14 deletions

View File

@ -4,6 +4,10 @@
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
_log = getLogger('LUR.hidpp20')
del getLogger
from struct import pack as _pack, unpack as _unpack from struct import pack as _pack, unpack as _unpack
try: try:
unicode unicode
@ -15,11 +19,7 @@ try:
except: except:
pass pass
from weakref import proxy as _proxy # from weakref import proxy as _proxy
from logging import getLogger, DEBUG as _DEBUG
_log = getLogger('LUR.hidpp20')
del getLogger
from .common import (FirmwareInfo as _FirmwareInfo, from .common import (FirmwareInfo as _FirmwareInfo,
ReprogrammableKeyInfo as _ReprogrammableKeyInfo, ReprogrammableKeyInfo as _ReprogrammableKeyInfo,
@ -133,7 +133,7 @@ class FeaturesArray(object):
def __init__(self, device): def __init__(self, device):
assert device is not None assert device is not None
self.device = _proxy(device) self.device = device # _proxy(device)
self.supported = True self.supported = True
self.features = None self.features = None
@ -265,7 +265,7 @@ class KeysArray(object):
def __init__(self, device, count): def __init__(self, device, count):
assert device is not None assert device is not None
self.device = _proxy(device) self.device = device # _proxy(device)
self.keys = [None] * count self.keys = [None] * count
def __getitem__(self, index): def __getitem__(self, index):

View File

@ -5,7 +5,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals from __future__ import absolute_import, division, print_function, unicode_literals
import errno as _errno import errno as _errno
from weakref import proxy as _proxy # from weakref import proxy as _proxy
from logging import getLogger from logging import getLogger
_log = getLogger('LUR.receiver') _log = getLogger('LUR.receiver')
@ -28,7 +28,7 @@ MAX_PAIRED_DEVICES = 6
class PairedDevice(object): class PairedDevice(object):
def __init__(self, receiver, number, link_notification=None): def __init__(self, receiver, number, link_notification=None):
assert receiver assert receiver
self.receiver = _proxy(receiver) self.receiver = receiver # _proxy(receiver)
assert number > 0 and number <= receiver.max_devices assert number > 0 and number <= receiver.max_devices
self.number = number self.number = number
self.online = None self.online = None

View File

@ -4,7 +4,7 @@
from __future__ import absolute_import, division, print_function, unicode_literals 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 copy import copy as _copy
from .common import NamedInt as _NamedInt, NamedInts as _NamedInts from .common import NamedInt as _NamedInt, NamedInts as _NamedInts
@ -35,7 +35,7 @@ class _Setting(object):
def __call__(self, device): def __call__(self, device):
o = _copy(self) o = _copy(self)
o._value = None o._value = None
o._device = _proxy(device) o._device = device # _proxy(device)
return o return o
@property @property

View File

@ -5,7 +5,7 @@
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 time import time as _timestamp
from weakref import proxy as _proxy # from weakref import proxy as _proxy
from struct import unpack as _unpack from struct import unpack as _unpack
try: try:
@ -58,7 +58,7 @@ class ReceiverStatus(dict):
""" """
def __init__(self, receiver, changed_callback): def __init__(self, receiver, changed_callback):
assert receiver assert receiver
self._receiver = _proxy(receiver) self._receiver = receiver # _proxy(receiver)
assert changed_callback assert changed_callback
self._changed_callback = changed_callback self._changed_callback = changed_callback
@ -125,7 +125,7 @@ class DeviceStatus(dict):
""" """
def __init__(self, device, changed_callback): def __init__(self, device, changed_callback):
assert device assert device
self._device = _proxy(device) self._device = device #_proxy(device)
assert changed_callback assert changed_callback
self._changed_callback = changed_callback self._changed_callback = changed_callback