def isRecording(self): isRunning = False for timer in self.timer_list: if timer.isRunning() and not timer.justplay: isRunning = True break return isRunning
def isProcessing(self, exceptTimer = None, endedTimer = None): isRunning = False for timer in self.timer_list: if timer.timerType != TIMERTYPE.AUTOSTANDBY and timer.timerType != TIMERTYPE.AUTODEEPSTANDBY and timer.timerType != exceptTimer and timer.timerType != endedTimer: if timer.isRunning(): isRunning = True break return isRunning
def isInRepeatTimer(self, timer, event): time_match = 0 is_editable = False begin = event.getBeginTime() duration = event.getDuration() end = begin + duration timer_end = timer.end if timer.disabled and timer.isRunning(): if begin < timer.begin <= end or timer.begin <= begin <= timer_end: return True else: return False if timer.justplay and (timer_end - timer.begin) <= 1: timer_end += 60 bt = localtime(begin) bday = bt.tm_wday begin2 = 1440 + bt.tm_hour * 60 + bt.tm_min end2 = begin2 + duration / 60 xbt = localtime(timer.begin) xet = localtime(timer_end) offset_day = False checking_time = timer.begin < begin or begin <= timer.begin <= end if xbt.tm_yday != xet.tm_yday: oday = bday - 1 if oday == -1: oday = 6 offset_day = timer.repeated & (1 << oday) xbegin = 1440 + xbt.tm_hour * 60 + xbt.tm_min xend = xbegin + ((timer_end - timer.begin) / 60) if xend < xbegin: xend += 1440 if timer.repeated & (1 << bday) and checking_time: if begin2 < xbegin <= end2: if xend < end2: # recording within event time_match = (xend - xbegin) * 60 is_editable = True else: # recording last part of event time_match = (end2 - xbegin) * 60 summary_end = (xend - end2) * 60 is_editable = not summary_end and True or time_match >= summary_end elif xbegin <= begin2 <= xend: if xend < end2: # recording first part of event time_match = (xend - begin2) * 60 summary_end = (begin2 - xbegin) * 60 is_editable = not summary_end and True or time_match >= summary_end else: # recording whole event time_match = (end2 - begin2) * 60 is_editable = True elif offset_day: xbegin -= 1440 xend -= 1440 if begin2 < xbegin <= end2: if xend < end2: # recording within event time_match = (xend - xbegin) * 60 is_editable = True else: # recording last part of event time_match = (end2 - xbegin) * 60 summary_end = (xend - end2) * 60 is_editable = not summary_end and True or time_match >= summary_end elif xbegin <= begin2 <= xend: if xend < end2: # recording first part of event time_match = (xend - begin2) * 60 summary_end = (begin2 - xbegin) * 60 is_editable = not summary_end and True or time_match >= summary_end else: # recording whole event time_match = (end2 - begin2) * 60 is_editable = True elif offset_day and checking_time: xbegin -= 1440 xend -= 1440 if begin2 < xbegin <= end2: if xend < end2: # recording within event time_match = (xend - xbegin) * 60 is_editable = True else: # recording last part of event time_match = (end2 - xbegin) * 60 summary_end = (xend - end2) * 60 is_editable = not summary_end and True or time_match >= summary_end elif xbegin <= begin2 <= xend: if xend < end2: # recording first part of event time_match = (xend - begin2) * 60 summary_end = (begin2 - xbegin) * 60 is_editable = not summary_end and True or time_match >= summary_end else: # recording whole event time_match = (end2 - begin2) * 60 is_editable = True return time_match and is_editable
def isRecording(self): for timer in self.timer_list: if timer.isRunning() and not timer.justplay: return True return False
def isRecording(self): isRunning = False for timer in self.timer_list: if timer.isRunning() and not (timer.justplay or timer.justremind): isRunning = True return isRunning