# TODO: remove pNavgation, eNavigation and rewrite this stuff in python.
class Navigation:
- def __init__(self):
+ def __init__(self, nextRecordTimerAfterEventActionAuto=False):
if NavigationInstance.instance is not None:
raise NavigationInstance.instance
clearFPWasTimerWakeup()
if getFPWasTimerWakeup(): # sanity check to detect if the FP driver is working correct!
print "buggy fp driver detected!!! please update drivers.... ignore timer wakeup!"
- elif len(self.getRecordings()) or abs(self.RecordTimer.getNextRecordingTime() - time()) <= 360:
+ elif nextRecordTimerAfterEventActionAuto and (len(self.getRecordings()) or abs(self.RecordTimer.getNextRecordingTime() - time()) <= 360):
if not Screens.Standby.inTryQuitMainloop: # not a shutdown messagebox is open
RecordTimer.RecordTimerEntry.TryQuitMainloop(False) # start shutdown handling
self.SleepTimer = SleepTimer.SleepTimer()
NONE = 0
STANDBY = 1
DEEPSTANDBY = 2
+ AUTO = 3
# please do not translate log messages
class RecordTimerEntry(timer.TimerEntry, object):
Notifications.AddNotification(Screens.Standby.TryQuitMainloop, 1, onSessionOpenCallback=RecordTimerEntry.stopTryQuitMainloop, default_yes = default_yes)
#################################################################
- def __init__(self, serviceref, begin, end, name, description, eit, disabled = False, justplay = False, afterEvent = AFTEREVENT.NONE, checkOldTimers = False, dirname = None, tags = None):
+ def __init__(self, serviceref, begin, end, name, description, eit, disabled = False, justplay = False, afterEvent = AFTEREVENT.AUTO, checkOldTimers = False, dirname = None, tags = None):
timer.TimerEntry.__init__(self, int(begin), int(end))
if checkOldTimers == True:
disabled = long(xml.getAttribute("disabled") or "0")
justplay = long(xml.getAttribute("justplay") or "0")
afterevent = str(xml.getAttribute("afterevent") or "nothing")
- afterevent = { "nothing": AFTEREVENT.NONE, "standby": AFTEREVENT.STANDBY, "deepstandby": AFTEREVENT.DEEPSTANDBY }[afterevent]
+ afterevent = {
+ "nothing": AFTEREVENT.NONE,
+ "standby": AFTEREVENT.STANDBY,
+ "deepstandby": AFTEREVENT.DEEPSTANDBY,
+ "auto": AFTEREVENT.AUTO
+ }[afterevent]
if xml.hasAttribute("eit") and xml.getAttribute("eit") != "None":
eit = long(xml.getAttribute("eit"))
else:
list.append(' repeated="' + str(int(timer.repeated)) + '"')
list.append(' name="' + str(stringToXML(timer.name)) + '"')
list.append(' description="' + str(stringToXML(timer.description)) + '"')
- list.append(' afterevent="' + str(stringToXML({ AFTEREVENT.NONE: "nothing", AFTEREVENT.STANDBY: "standby", AFTEREVENT.DEEPSTANDBY: "deepstandby" }[timer.afterEvent])) + '"')
+ list.append(' afterevent="' + str(stringToXML({
+ AFTEREVENT.NONE: "nothing",
+ AFTEREVENT.STANDBY: "standby",
+ AFTEREVENT.DEEPSTANDBY: "deepstandby",
+ AFTEREVENT.AUTO: "auto"
+ }[timer.afterEvent])) + '"')
if timer.eit is not None:
list.append(' eit="' + str(timer.eit) + '"')
if timer.dirname is not None:
return timer.begin
return -1
+ def isNextRecordAfterEventActionAuto(self):
+ now = time.time()
+ t = None
+ for timer in self.timer_list:
+ if timer.justplay or timer.begin < now:
+ continue
+ if t is None or t.begin == timer.begin:
+ t = timer
+ if t.afterEvent == AFTEREVENT.AUTO:
+ return True
+ return False
+
def record(self, entry, ignoreTSC=False, dosave=True): #wird von loadTimer mit dosave=False aufgerufen
timersanitycheck = TimerSanityCheck(self.timer_list,entry)
if not timersanitycheck.check():
def createConfig(self):
justplay = self.timer.justplay
- afterevent = { AFTEREVENT.NONE: "nothing", AFTEREVENT.DEEPSTANDBY: "deepstandby", AFTEREVENT.STANDBY: "standby"}[self.timer.afterEvent]
+ afterevent = {
+ AFTEREVENT.NONE: "nothing",
+ AFTEREVENT.DEEPSTANDBY: "deepstandby",
+ AFTEREVENT.STANDBY: "standby",
+ AFTEREVENT.AUTO: "auto"
+ }[self.timer.afterEvent]
weekday_table = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]
day[weekday] = 1
self.timerentry_justplay = ConfigSelection(choices = [("zap", _("zap")), ("record", _("record"))], default = {0: "record", 1: "zap"}[justplay])
- self.timerentry_afterevent = ConfigSelection(choices = [("nothing", _("do nothing")), ("standby", _("go to standby")), ("deepstandby", _("go to deep standby"))], default = afterevent)
+ self.timerentry_afterevent = ConfigSelection(choices = [("nothing", _("do nothing")), ("standby", _("go to standby")), ("deepstandby", _("go to deep standby")), ("auto", _("auto"))], default = afterevent)
self.timerentry_type = ConfigSelection(choices = [("once",_("once")), ("repeated", _("repeated"))], default = type)
self.timerentry_name = ConfigText(default = self.timer.name, visible_width = 50, fixed_size = False)
self.timerentry_description = ConfigText(default = self.timer.description, visible_width = 50, fixed_size = False)
self.timer.description = self.timerentry_description.value
self.timer.justplay = self.timerentry_justplay.value == "zap"
self.timer.resetRepeated()
- self.timer.afterEvent = {"nothing": AFTEREVENT.NONE, "deepstandby": AFTEREVENT.DEEPSTANDBY, "standby": AFTEREVENT.STANDBY}[self.timerentry_afterevent.value]
+ self.timer.afterEvent = {
+ "nothing": AFTEREVENT.NONE,
+ "deepstandby": AFTEREVENT.DEEPSTANDBY,
+ "standby": AFTEREVENT.STANDBY,
+ "auto": AFTEREVENT.AUTO
+ }[self.timerentry_afterevent.value]
self.timer.service_ref = self.timerentry_service_ref
self.timer.tags = self.timerentry_tags