PowerTimer.py 文件源码

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

项目:enigma2 作者: OpenLD 项目源码 文件源码
def getNextPowerManagerTimeOld(self, getNextStbPowerOn = False):
        now = int(time())
        nextPTlist = [(-1,None,None,None)]
        for timer in self.timer_list:
            if timer.timerType != TIMERTYPE.AUTOSTANDBY and timer.timerType != TIMERTYPE.AUTODEEPSTANDBY:
                next_act = timer.getNextWakeup(getNextStbPowerOn)
                if next_act + 3 < now:
                    continue
                if getNextStbPowerOn and debug:
                    print "[powertimer] next stb power up", strftime("%a, %Y/%m/%d %H:%M", localtime(next_act))
                next_timertype = next_afterevent = None
                if nextPTlist[0][0] == -1:
                    if abs(next_act - timer.begin) <= 30:
                        next_timertype = timer.timerType
                    elif abs(next_act - timer.end) <= 30:
                        next_afterevent = timer.afterEvent
                    nextPTlist = [(next_act,next_timertype,next_afterevent,timer.state)]
                else:
                    if abs(next_act - timer.begin) <= 30:
                        next_timertype = timer.timerType
                    elif abs(next_act - timer.end) <= 30:
                        next_afterevent = timer.afterEvent
                    nextPTlist.append((next_act,next_timertype,next_afterevent,timer.state))
        nextPTlist.sort()
        return nextPTlist
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号