def uBitPoller():
global uBitFound
global uBitUploading
last = {}
while True:
for self in OPENWINDOWS:
if self not in last:
last[self] = (False, False)
uBitFound = os.path.exists(SETTINGS['mbitLocation'])
if not (uBitUploading and uBitFound):
if uBitFound and not last[self][0]:
gobject.idle_add(self.indicator.set_from_file, os.path.join(WORKINGDIR, "data", "uBitFound.png"))
elif last[self][0] and not uBitFound:
gobject.idle_add(self.indicator.set_from_file, os.path.join(WORKINGDIR, "data", "uBitNotFound.png"))
uBitUploading = False
else:
gobject.idle_add(self.indicator.set_from_file, os.path.join(WORKINGDIR, "data", "uBitUploading.png"))
last[self] = (uBitFound, uBitUploading)
time.sleep(0.2)
评论列表
文章目录