PowerTimer.py 文件源码

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

项目:enigma2 作者: OpenLD 项目源码 文件源码
def getPriorityCheck(self,prioPT,prioPTae):
        shiftPT = breakPT = False
        nextPTlist = NavigationInstance.instance.PowerTimer.getNextPowerManagerTime(getNextTimerTyp = True)
        for entry in nextPTlist:
            #check timers within next 15 mins will started or ended
            if abs(entry[0] - time()) > 900:
                continue
            #faketime
            if entry[1] is None and entry[2] is None and entry[3] is None:
                if debug: print "shift#2 - entry is faketime", ctime(entry[0]), entry
                shiftPT = True
                continue
            #is timer in list itself?
            if entry[0] == self.begin and entry[1] == self.timerType and entry[2] is None and entry[3] == self.state \
                or entry[0] == self.end and entry[1] is None and entry[2] == self.afterEvent and entry[3] == self.state:
                if debug: print "entry is itself", ctime(entry[0]), entry
                nextPTitself = True
            else:
                nextPTitself = False
            if (entry[1] in prioPT or entry[2] in prioPTae) and not nextPTitself:
                if debug: print "break#2 <= 900", ctime(entry[0]), entry
                breakPT = True
                break
        return shiftPT, breakPT
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号