alexa.py 文件源码

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

项目:python-alexa-client 作者: nicholas-gh 项目源码 文件源码
def __init__(self, tokens_filename, audio, log):
        self._log = log
        self._audio = audio
        self._tokens_filename = tokens_filename
        self._eventQueue = queue.Queue()
        persist_path = "/tmp"
        for directory in ("alerts", "alerts/all", "alerts/active"):
            d = os.path.join(persist_path, directory)
            if not os.path.exists(d):
                os.mkdir(d)
        # would prefer to use sqlite, but that complains about
        # our threads accessing the same connection - and dbm seems to not
        # store any changes.
        self.allAlerts = Shove("file:///tmp/alerts/all")
        self.activeAlerts = Shove("file:///tmp/alerts/active")
        #print(list(self.allAlerts.values()))
        self._last_user_activity = datetime.datetime.now()
        t = threading.Thread(target=self.eventQueueThread, daemon=True)
        t.start()
        GObject.timeout_add(500, self.alertCheck)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号