micropi.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Micro-Pi 作者: Bottersnike 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号