本文整理匯總了Python中Device.Device.count方法的典型用法代碼示例。如果您正苦於以下問題:Python Device.count方法的具體用法?Python Device.count怎麽用?Python Device.count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Device.Device
的用法示例。
在下文中一共展示了Device.count方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: updateMacList
# 需要導入模塊: from Device import Device [as 別名]
# 或者: from Device.Device import count [as 別名]
def updateMacList(self, record):
try:
device = next(d for d in self.devices if d.mac == record.mac)
except Exception:
# no record found, so create one as well as a widget
device = Device()
device.mac = record.mac
self.devices.append(device)
w = MacListWidget(device)
w.activeStateChanged.connect(self.deviceActiveStateChanged)
wi = QtGui.QListWidgetItem(self.listWidget)
wi.setSizeHint(w.sizeHint())
self.listWidget.addItem(wi)
self.listWidget.setItemWidget(wi, w)
device.rssi = record.rssi_dec
device.batt = record.batt
device.count = device.count + 1
device.update()