(self, dev, backend)
r"""Initialize the Device object.

        Library users should normally get a Device instance through
        the find function. The dev parameter is the identification
        of a device to the backend and its meaning is opaque outside
        of it. The backend parameter is a instance of a backend
        object.
r"""Initialize the Device object.
r Initialize the Device object .
def __init__(self, dev, backend):
        r"""Initialize the Device object.

        Library users should normally get a Device instance through
        the find function. The dev parameter is the identification
        of a device to the backend and its meaning is opaque outside
        of it. The backend parameter is a instance of a backend
        object.
        """
        self._ctx = _ResourceManager(dev, backend)
        self.__default_timeout = _DEFAULT_TIMEOUT
        self._serial_number, self._product, self._manufacturer = None, None, None
        self._langids = None

        desc = backend.get_device_descriptor(dev)

        _set_attr(
                desc,
                self,
                (
                    'bLength',
                    'bDescriptorType',
                    'bcdUSB',
                    'bDeviceClass',
                    'bDeviceSubClass',
                    'bDeviceProtocol',
                    'bMaxPacketSize0',
                    'idVendor',
                    'idProduct',
                    'bcdDevice',
                    'iManufacturer',
                    'iProduct',
                    'iSerialNumber',
                    'bNumConfigurations',
                    'address',
                    'bus',
                    'port_number',
                    'port_numbers',
                    'speed',
                )
            )

        if desc.bus is not None:
            self.bus = int(desc.bus)
        else:
            self.bus = None

        if desc.address is not None:
            self.address = int(desc.address)
        else:
            self.address = None

        if desc.port_number is not None:
            self.port_number = int(desc.port_number)
        else:
            self.port_number = None

        if desc.speed is not None:
            self.speed = int(desc.speed)
        else:
            self.speed = None

        self._has_parent = None
        self._parent = None
def __init__ ( self , dev , backend ) : self . _ctx = _ResourceManager ( dev , backend ) self . __default_timeout = _DEFAULT_TIMEOUT self . _serial_number , self . _product , self . _manufacturer = None , None , None self . _langids = None desc = backend . get_device_descriptor ( dev ) _set_attr ( desc , self , ( 'bLength' , 'bDescriptorType' , 'bcdUSB' , 'bDeviceClass' , 'bDeviceSubClass' , 'bDeviceProtocol' , 'bMaxPacketSize0' , 'idVendor' , 'idProduct' , 'bcdDevice' , 'iManufacturer' , 'iProduct' , 'iSerialNumber' , 'bNumConfigurations' , 'address' , 'bus' , 'port_number' , 'port_numbers' , 'speed' , ) ) if desc . bus is not None : self . bus = int ( desc . bus ) else : self . bus = None if desc . address is not None : self . address = int ( desc . address ) else : self . address = None if desc . port_number is not None : self . port_number = int ( desc . port_number ) else : self . port_number = None if desc . speed is not None : self . speed = int ( desc . speed ) else : self . speed = None self . _has_parent = None self . _parent = None