当前位置: 首页>>代码示例>>Python>>正文


Python util.get_string函数代码示例

本文整理汇总了Python中usb.util.get_string函数的典型用法代码示例。如果您正苦于以下问题:Python get_string函数的具体用法?Python get_string怎么用?Python get_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_string函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: listPrinters

 def listPrinters(self):
     printers = core.find(find_all=True)  # , bDeviceClass=7)
     for printer in printers:
         print printer.bDeviceClass
         try:
             print util.get_string(printer, 256, 3)
         except:
             print 'dispositivo oculto'
开发者ID:soloidx,项目名称:python_print_module,代码行数:8,代码来源:usb_ecspos_driver.py

示例2: _try_get_string

def _try_get_string(dev, index, langid = None, default_str_i0 = "",
        default_access_error = "Error Accessing String"):
    """ try to get a string, but return a string no matter what
    """
    if index == 0 :
        string = default_str_i0
    else:
        try:
            if langid is None:
                string = util.get_string(dev, index)
            else:
                string = util.get_string(dev, index, langid)
        except :
            string = default_access_error
    return string
开发者ID:mull3rcw,项目名称:python_mt_unitTest,代码行数:15,代码来源:core.py

示例3: manufacturer

    def manufacturer(self):
        """ Return the USB device's manufacturer string descriptor.

        This property will cause some USB traffic the first time it is accessed
        and cache the resulting value for future use.
        """
        if self._manufacturer is None:
            self._manufacturer = util.get_string(self, self.iManufacturer)
        return self._manufacturer
开发者ID:mull3rcw,项目名称:python_mt_unitTest,代码行数:9,代码来源:core.py

示例4: __getName

	def __getName(self,pen):
		"""
		Get pen's name for user displaying
		"""
		name = (util.get_string(dev=pen,length=20,index=1))+" "+(util.get_string(dev=pen,length=20,index=2))
		return name
开发者ID:mibofra,项目名称:olifant,代码行数:6,代码来源:olifantUSB.py

示例5: product

    def product(self):
        """ Return the USB device's product string descriptor.

        This property will cause some USB traffic the first time it is accessed
        and cache the resulting value for future use.
        """
        if self._product is None:
            self._product = util.get_string(self, self.iProduct)
        return self._product
开发者ID:mull3rcw,项目名称:python_mt_unitTest,代码行数:9,代码来源:core.py

示例6: serial_number

    def serial_number(self):
        """ Return the USB device's serial number string descriptor

        This property will cause some USB traffic the first time it is accessed
        and cache the resulting value for future use.
        """
        if self._serial_number is None:
            self._serial_number = util.get_string(self, self.iSerialNumber)
        return self._serial_number
开发者ID:asifiqbal,项目名称:pyusb,代码行数:9,代码来源:core.py

示例7: getString

    def getString(self, index, length, langid = None):
        r"""Retrieve the string descriptor specified by index
            and langid from a device.

        Arguments:
            index: index of descriptor in the device.
            length: number of bytes of the string
            langid: Language ID. If it is omittedi, will be
                    used the first language.
        """
        return util.get_string(self.dev, length, index, langid).encode('ascii')
开发者ID:RoboticMayhem,项目名称:pyusb,代码行数:11,代码来源:legacy.py

示例8: serial_number

 def serial_number(self):
     return util.get_string(self, 1000, self.iSerialNumber)
开发者ID:jaseg,项目名称:pyusb,代码行数:2,代码来源:core.py

示例9: product

 def product(self):
     return util.get_string(self, 1000, self.iProduct)
开发者ID:jaseg,项目名称:pyusb,代码行数:2,代码来源:core.py

示例10: manufacturer

 def manufacturer(self):
     return util.get_string(self, 1000, self.iManufacturer)
开发者ID:jaseg,项目名称:pyusb,代码行数:2,代码来源:core.py

示例11: get_string

 def get_string(self, num):
     return get_string(self.__dev, num)
开发者ID:jj1bdx,项目名称:gnuk,代码行数:2,代码来源:card_reader.py


注:本文中的usb.util.get_string函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。