collect.py 文件源码

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

项目:captiv8 作者: wraith-wireless 项目源码 文件源码
def _teardown(self):
        """ restore radio and wait on tuning thread"""
        clean = True
        self._err = ""

        # restore the radio - this will have the side effect of
        # causing the threads to error out and quit
        try:
            if self._card:
                phy = self._card.phy
                pyw.devdel(self._card)
                card = pyw.phyadd(phy,self._dev,self._dinfo['mode'])
                pyw.up(card)
        except pyric.error as e:
            clean = False
            self._err = "ERRNO {0} {1}".format(e.errno, e.strerror)

        # join threads, waiting a short time before continuing
        try:
            self._tuner.join(5.0)
        except (AttributeError,RuntimeError):
            # either tuner is None, or it never started
            pass

        try:
            self._sniffer.join(5.0)
        except (AttributeError, RuntimeError):
            # either sniffer is None, or it never started
            pass

        if threading.active_count() > 0:
            clean = False
            self._err += "One or more workers failed to stop"

        return clean
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号