def keyGo(self): if self.step == 1: self.step = self.yes_no.value and 5 or 2 elif self.step == 2: self.step = self.yes_no.value and 5 or os.path.exists("/proc/stb/fb/dst_left") and 3 or 4 elif self.step == 3: self.save_new_position = True self.step = 5 elif self.step == 4: self.step = self.yes_no.value and 6 or 5 elif self.step == 5: if self.yes_no.value: if self.save_new_position: config.plugins.OSDPositionSetup.dst_left.value = self.dst_left.value config.plugins.OSDPositionSetup.dst_width.value = self.dst_right.value - self.dst_left.value config.plugins.OSDPositionSetup.dst_top.value = self.dst_top.value config.plugins.OSDPositionSetup.dst_height.value = self.dst_bottom.value - self.dst_top.value else: config.plugins.OSDPositionSetup.dst_left.value = 0 config.plugins.OSDPositionSetup.dst_width.value = 720 config.plugins.OSDPositionSetup.dst_top.value = 0 config.plugins.OSDPositionSetup.dst_height.value = 576 config.misc.do_overscanwizard.value = False config.save() setConfiguredPosition() self.close() else: self.step = 1 self.setScreen()
def saveSelection(self): self.selectedFiles = self["checkList"].getSelectedList() config.plugins.configurationbackup.backupdirs.value = self.selectedFiles config.plugins.configurationbackup.backupdirs.save() config.plugins.configurationbackup.save() config.save() self.close(None)
def backuprestorepath_choosen(self, option): if option is not None: config.plugins.vtipanel.backupsuite.backuprestorepath.value = str(option[1]) config.plugins.vtipanel.backupsuite.backuprestorepath.save() config.plugins.vtipanel.backupsuite.save() config.save() self.checkFolders()
def saveSelection(self): self.selectedFiles = self["checkList"].getSelectedList() config.backupmanager.backupdirs.value = self.selectedFiles config.backupmanager.backupdirs.save() config.backupmanager.save() config.save() self.close(None)
def SelectSkin(): global longButtonText longButtonText = False global buttonText_na buttonText_na = "-----" global skinName skinName = default_skinName global skin skin = default_skin if "FHD" in config.plugins.serienRec.SkinType.value and DESKTOP_WIDTH < 1920: config.plugins.serienRec.SkinType.value = "" config.save() if config.plugins.serienRec.SkinType.value == "Skinpart": try: from skin import lookupScreen x, path = lookupScreen("SerienRecorder", 0) if x: skinName = "SerienRecorder" except: pass elif config.plugins.serienRec.SkinType.value in ("", "Skin2", "AtileHD", "StyleFHD", "Black Box"): skin = "%sskins/%s/SR_Skin.xml" % (serienRecMainPath, config.plugins.serienRec.SkinType.value) skin = skin.replace("//", "/") if config.plugins.serienRec.SkinType.value in ("Skin2", "StyleFHD", "Black Box"): config.plugins.serienRec.showAllButtons.value = True if config.plugins.serienRec.SkinType.value in ("Skin2", "AtileHD", "Black Box"): buttonText_na = "" else: if fileExists("%sskins/%s/SR_Skin.xml" % (serienRecMainPath, config.plugins.serienRec.SkinType.value)): skin = "%sskins/%s/SR_Skin.xml" % (serienRecMainPath, config.plugins.serienRec.SkinType.value) buttonText_na = ""
def saveSelection(self): filelist = str(self.filelist.getFileList()) if filelist.find('.ipk') != -1: config.backupmanager.xtraplugindir.setValue(self.filelist.getCurrentDirectory()) config.backupmanager.xtraplugindir.save() config.backupmanager.save() config.save() self.close(None) else: self.session.open(MessageBox, _("Please enter a folder that contains some packages."), MessageBox.TYPE_INFO, timeout=10)
def add(self): if len(self.cacheList) == 0: return index = self["menu"].getIndex() config = MenuConfig() config.load() config.add(self.current, self.cacheList[index][1], self.cacheList[index][0]) config.save() self.close()
def saveSelection(self): if self.readOnly: self.close(None) else: self.selectedFiles = self["checkList"].getSelectedList() self.configBackupDirs.setValue(self.selectedFiles) self.configBackupDirs.save() config.plugins.configurationbackup.save() config.save() self.close(None)
def Save(self): config.plugins.netdrivesetup.type.save() config.plugins.netdrivesetup.server.save() config.plugins.netdrivesetup.userid.save() config.plugins.netdrivesetup.passwd.save() config.plugins.netdrivesetup.mountpoint.save() config.plugins.netdrivesetup.startup.save() config.plugins.netdrivesetup.save() config.plugins.save() config.save()
def ok(self): if len(self.listAll) == 0: return index = self["list"].getIndex() if self.listAll[index][0] in self.bouquets: self.bouquets.remove(self.listAll[index][0]) else: self.bouquets.append(self.listAll[index][0]) config.sifteam.settings.keepbouquets.value = "|".join(self.bouquets) config.save() self.refresh() self["list"].setIndex(index)
def render_POST(self, request): print '[AirPlayer] PremiumHandler POST' TEMPLATE = '<html> <head> <meta name="title" content="AirPlayer E2"> </head> <body> <h2>Premium-Key</h2> <form method="post"><input type="text" name="key" size="40" value="%s"><input type="submit" value="Save and check"></form> <h2>Status</h2> %s </body> </html>' if 'key' in request.args: try: config.plugins.airplayer.premiuimKey.value = request.args['key'][0] config.save() self._media_backend.updater.checkPremiumValidation() except Exception as e: print '[AirPlayMoviePlayer] loading lib failed' print e statusText = self.getStatusText() request.write(TEMPLATE % (config.plugins.airplayer.premiuimKey.value, statusText)) request.finish() return 1
def handleAnswer(answer): answer = answer and answer[1] print "[CrashlogAutoSubmit] - handleAnswer --> ", answer if answer == "send": send_mail() elif answer == "send_always": config.plugins.crashlogautosubmit.sendmail.value = "send_always" config.plugins.crashlogautosubmit.sendmail.save() config.plugins.crashlogautosubmit.save() config.plugins.save() config.save() send_mail() elif answer in (None, "send_never"): config.plugins.crashlogautosubmit.sendmail.value = "send_never" config.plugins.crashlogautosubmit.sendmail.save() config.plugins.crashlogautosubmit.save() config.plugins.save() config.save() elif answer == "send_not": print "[CrashlogAutoSubmit] - not sending crashlogs for this time."
def __init__(self, wakeupData = None): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [] self.record_event = [] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = None self.isRecordTimerImageStandard = False for p in plugins.getPlugins(PluginDescriptor.WHERE_RECORDTIMER): self.RecordTimer = p() if self.RecordTimer: break if not self.RecordTimer: self.RecordTimer = RecordTimer.RecordTimer() self.isRecordTimerImageStandard = True self.PowerTimer = None self.PowerTimer = PowerTimer.PowerTimer() self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False try: self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = [ int(n) for n in wakeupData.split(',') ] except: print '=' * 100 print "[NAVIGATION] ERROR: can't read wakeup data" self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = (-1, -1, 0, 0, -1, 0) now = time() timediff_wakeup = self.wakeuptime - now timediff_timer = self.timertime - now self.syncCount = 0 wasTimerWakeup = getFPWasTimerWakeup() print '=' * 100 thisBox = getBoxType() if not config.workaround.deeprecord.value and (thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'dags', 'fulan', 'entwopia')): print '[NAVIGATION] FORCED DEEPSTANDBY-WORKAROUND FOR THIS BOXTYPE (%s)' % thisBox config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() if config.workaround.deeprecord.value: wasTimerWakeup = False print '[NAVIGATION] starting deepstandby-workaround' if now <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print '[NAVIGATION] wait for time sync' print '~' * 100 elif abs(timediff_wakeup) <= 600 or abs(timediff_timer) <= 600: wasTimerWakeup = True f = open('/tmp/was_timer_wakeup_workaround.txt', 'w') file = f.write(str(wasTimerWakeup)) f.close() print '[NAVIGATION] was timer wakeup = %s' % wasTimerWakeup print '[NAVIGATION] current time is %s' % ctime(now) if wasTimerWakeup: self.__wasTimerWakeup = True print '-' * 100 if self.wakeuptime > 0: print '[NAVIGATION] wakeup time was %s' % ctime(self.wakeuptime) else: print '[NAVIGATION] wakeup time was not set' if now <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print '[NAVIGATION] wait for time sync' print '~' * 100 else: self.wakeupCheck() elif now > 31536000: if self.timertime > 0: print "[NAVIGATION] next '%s' starts at %s" % ({0: 'record-timer', 1: 'zap-timer', 2: 'power-timer', 3: 'plugin-timer'}[self.wakeuptyp], ctime(self.timertime)) else: print '[NAVIGATION] no next timers' print '=' * 100 return
def Save(self): config.plugins.wolconfig.activate.save() config.plugins.wolconfig.location.save() config.plugins.wolconfig.save() config.plugins.save() config.save()
def __init__(self, nextRecordTimerAfterEventActionAuto = False, nextPowerManagerAfterEventActionAuto = False): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [] self.record_event = [] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = RecordTimer.RecordTimer() self.PowerTimer = PowerTimer.PowerTimer() self.nextRecordTimerAfterEventActionAuto = nextRecordTimerAfterEventActionAuto self.nextPowerManagerAfterEventActionAuto = nextPowerManagerAfterEventActionAuto self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False self.syncCount = 0 wasTimerWakeup = getFPWasTimerWakeup() if getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'dags', 'fulan'): config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() print '[NAVIGATION] USE DEEPSTAND-WORKAROUND FOR THIS BOXTYPE (%s) !!' % getBoxType() if not wasTimerWakeup and config.workaround.deeprecord.value: print '==================================================================================' print '[NAVIGATION] getNextRecordingTime= %s' % self.RecordTimer.getNextRecordingTime() print '[NAVIGATION] nextRecordTimerAfterEventActionAuto= %s' % nextRecordTimerAfterEventActionAuto print '[NAVIGATION] current Time=%s' % time() print '[NAVIGATION] timediff=%s' % abs(self.RecordTimer.getNextRecordingTime() - time()) print '==================================================================================' print '[NAVIGATION] getNextPowerManagerTime= %s' % self.PowerTimer.getNextPowerManagerTime() print '[NAVIGATION] nextPowerManagerAfterEventActionAuto= %s' % nextPowerManagerAfterEventActionAuto print '[NAVIGATION] current Time=%s' % time() print '[NAVIGATION] timediff=%s' % abs(self.PowerTimer.getNextPowerManagerTime() - time()) print '==================================================================================' if time() <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print '[NAVIGATION] [work-around] wait for time sync' elif abs(self.RecordTimer.getNextRecordingTime() - time()) <= 360: wasTimerWakeup = True f = open('/tmp/was_timer_wakeup_workaround.txt', 'w') file = f.write(str(wasTimerWakeup)) f.close() elif abs(self.PowerTimer.getNextPowerManagerTime() - time()) <= 360: wasTimerWakeup = True f = open('/tmp/was_timer_wakeup_workaround.txt', 'w') file = f.write(str(wasTimerWakeup)) f.close() print '[NAVIGATION] wasTimerWakeup = %s' % wasTimerWakeup if wasTimerWakeup: self.__wasTimerWakeup = True if time() <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print '[NAVIGATION] wait for time sync' elif nextRecordTimerAfterEventActionAuto and abs(self.RecordTimer.getNextRecordingTime() - time()) <= 360: self.__wasRecTimerWakeup = True print 'RECTIMER: wakeup to standby detected.' f = open('/tmp/was_rectimer_wakeup', 'w') f.write('1') f.close() self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(15000, True) elif nextPowerManagerAfterEventActionAuto: self.__wasPowerTimerWakeup = True print 'POWERTIMER: wakeup to standby detected.' f = open('/tmp/was_powertimer_wakeup', 'w') f.write('1') f.close() self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(15000, True) return
def save(self): config = MenuConfig() config.items = self.cacheList config.save()
def __init__(self, wakeupData=None): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [] self.record_event = [] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = None self.isRecordTimerImageStandard = False for p in plugins.getPlugins(PluginDescriptor.WHERE_RECORDTIMER): self.RecordTimer = p() if self.RecordTimer: break if not self.RecordTimer: self.RecordTimer = RecordTimer.RecordTimer() self.isRecordTimerImageStandard = True self.PowerTimer = None self.PowerTimer = PowerTimer.PowerTimer() self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False try: self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = [ int(n) for n in wakeupData.split(',') ] except: print '=' * 100 print "[NAVIGATION] ERROR: can't read wakeup data" self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = ( -1, -1, 0, 0, -1, 0) now = time() self.wakeupwindow_plus = self.timertime + 300 self.wakeupwindow_minus = self.wakeuptime - config.workaround.wakeupwindow.value * 60 self.syncCount = 0 wasTimerWakeup, wasTimerWakeup_failure = getFPWasTimerWakeup(True) print '=' * 100 if self.wakeuptime > 0: print '[NAVIGATION] wakeup time from deep-standby expected: *** %s ***' % ctime( self.wakeuptime) print '[NAVIGATION] timer wakeup detection window: %s - %s' % ( ctime(self.wakeupwindow_minus), ctime(self.wakeupwindow_plus)) print '-' * 100 thisBox = getBoxType() if not config.workaround.deeprecord.value and ( wasTimerWakeup_failure or thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3', 'et8000') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'dags', 'fulan', 'entwopia')): print '[NAVIGATION] FORCED DEEPSTANDBY-WORKAROUND FOR THIS BOXTYPE (%s)' % thisBox config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() if config.workaround.deeprecord.value: wasTimerWakeup = False print '[NAVIGATION] starting deepstandby-workaround' if now <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print '[NAVIGATION] wait for time sync' print '~' * 100 elif now >= self.wakeupwindow_minus and now <= self.wakeupwindow_plus: wasTimerWakeup = True f = open('/tmp/was_timer_wakeup_workaround.txt', 'w') file = f.write(str(wasTimerWakeup)) f.close() print '[NAVIGATION] was timer wakeup = %s' % wasTimerWakeup print '[NAVIGATION] current time is %s' % ctime(now) if wasTimerWakeup: self.__wasTimerWakeup = True print '-' * 100 if self.wakeuptime > 0: print '[NAVIGATION] wakeup time was %s' % ctime( self.wakeuptime) else: print '[NAVIGATION] wakeup time was not set' if now <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print '[NAVIGATION] wait for time sync' print '~' * 100 else: self.wakeupCheck() elif now > 31536000: if self.timertime > 0: print "[NAVIGATION] next '%s' starts at %s" % ( { 0: 'record-timer', 1: 'zap-timer', 2: 'power-timer', 3: 'plugin-timer' }[self.wakeuptyp], ctime(self.timertime)) else: print '[NAVIGATION] no next timers' print '=' * 100 return
def saveConfig(self): printl("->", self) config.plugins.pvmc.showwizard.value = False config.save() printl("<- Saved !", self)
def __init__(self, nextRecordTimerAfterEventActionAuto=False, nextPowerManagerAfterEventActionAuto=False): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [ ] self.record_event = [ ] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = RecordTimer.RecordTimer() self.PowerTimer = PowerTimer.PowerTimer() self.nextRecordTimerAfterEventActionAuto = nextRecordTimerAfterEventActionAuto self.nextPowerManagerAfterEventActionAuto = nextPowerManagerAfterEventActionAuto self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False self.syncCount = 0 wasTimerWakeup = getFPWasTimerWakeup() thisBox = getBoxType() if thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'dags', 'fulan'): config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() print"[NAVIGATION] USE DEEPSTAND-WORKAROUND FOR THIS BOXTYPE (%s) !!" %thisBox if not wasTimerWakeup and config.workaround.deeprecord.value: #work-around for boxes where driver not sent was_timer_wakeup signal to e2 print"==================================================================================" print"[NAVIGATION] getNextRecordingTime= %s" % self.RecordTimer.getNextRecordingTime() print"[NAVIGATION] nextRecordTimerAfterEventActionAuto= %s" % nextRecordTimerAfterEventActionAuto print"[NAVIGATION] current Time=%s" % time() print"[NAVIGATION] timediff=%s" % abs(self.RecordTimer.getNextRecordingTime() - time()) print"==================================================================================" print"[NAVIGATION] getNextPowerManagerTime= %s" % self.PowerTimer.getNextPowerManagerTime() print"[NAVIGATION] nextPowerManagerAfterEventActionAuto= %s" % nextPowerManagerAfterEventActionAuto print"[NAVIGATION] current Time=%s" % time() print"[NAVIGATION] timediff=%s" % abs(self.PowerTimer.getNextPowerManagerTime() - time()) print"==================================================================================" if time() <= 31536000: # check for NTP-time sync, if no sync, wait for transponder time self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print"[NAVIGATION] [work-around] wait for time sync" elif abs(self.RecordTimer.getNextRecordingTime() - time()) <= 360: # if there is a recording sheduled in the next 5 mins, set the wasTimerWakeup flag wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() elif abs(self.PowerTimer.getNextPowerManagerTime() - time()) <= 360: # if there is a power timer in the next 5 mins, set the wasTimerWakeup flag wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() print"[NAVIGATION] wasTimerWakeup = %s" % wasTimerWakeup if wasTimerWakeup: self.__wasTimerWakeup = True if time() <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print"[NAVIGATION] wait for time sync" elif nextRecordTimerAfterEventActionAuto and abs(self.RecordTimer.getNextRecordingTime() - time()) <= 360: self.__wasRecTimerWakeup = True print 'RECTIMER: wakeup to standby detected.' f = open("/tmp/was_rectimer_wakeup", "w") f.write('1') f.close() # as we woke the box to record, place the box in standby. self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(15000, True) elif nextPowerManagerAfterEventActionAuto: self.__wasPowerTimerWakeup = True print 'POWERTIMER: wakeup to standby detected.' f = open("/tmp/was_powertimer_wakeup", "w") f.write('1') f.close() # as a PowerTimer WakeToStandby was actiond to it. self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(15000, True)
def backupfiles_choosen(self, ret): self.backupdirs = ' '.join(config.plugins.configurationbackup.backupdirs.value) config.plugins.configurationbackup.backupdirs.save() config.plugins.configurationbackup.save() config.save()
def backupfiles_choosen(self, ret): config.plugins.configurationbackup.backupdirs.save() config.plugins.configurationbackup.save() config.save()
def __init__(self, nextRecordTimerAfterEventActionAuto=False, nextPowerManagerAfterEventActionAuto=False): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [ ] self.record_event = [ ] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = None for p in plugins.getPlugins(PluginDescriptor.WHERE_RECORDTIMER): self.RecordTimer = p() if self.RecordTimer: break if not self.RecordTimer: self.RecordTimer = RecordTimer.RecordTimer() self.PowerTimer = None self.PowerTimer = PowerTimer.PowerTimer() self.nextRecordTimerAfterEventActionAuto = nextRecordTimerAfterEventActionAuto self.nextPowerManagerAfterEventActionAuto = nextPowerManagerAfterEventActionAuto self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False self.syncCount = 0 now = time() nextZT = self.RecordTimer.getNextZapTime() nextRT = self.RecordTimer.getNextRecordingTime() nextPT = self.PowerTimer.getNextPowerManagerTime(getNextTimerTyp = True) timediffZT = nextZT - now timediffRT = nextRT - now timediffPT = nextPT[0][0] - now wasTimerWakeup = getFPWasTimerWakeup() #TODO: verify wakeup-state for boxes where only after shutdown removed the wakeup-state (for boxes where "/proc/stb/fp/was_timer_wakeup" is not writable (clearFPWasTimerWakeup() in StbHardware.py has no effect -> after x hours and restart/reboot is wasTimerWakeup = True) thisBox = getBoxType() if thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'dags', 'fulan', 'entwopia'): config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() print"[NAVIGATION] USE DEEPSTAND-WORKAROUND FOR THIS BOXTYPE (%s) !!" %thisBox if not wasTimerWakeup and config.workaround.deeprecord.value: #work-around for boxes where driver not sent was_timer_wakeup signal to e2 print"==================================================================================" print"[NAVIGATION] getNextZapTime= %s" % nextZT print"[NAVIGATION] nextRecordTimerAfterEventActionAuto= %s" % nextRecordTimerAfterEventActionAuto print"[NAVIGATION] current Time=%s" % now print"[NAVIGATION] timediff=%s" % abs(timediffZT) print"==================================================================================" print"[NAVIGATION] getNextRecordingTime= %s" % nextRT print"[NAVIGATION] nextRecordTimerAfterEventActionAuto= %s" % nextRecordTimerAfterEventActionAuto print"[NAVIGATION] current Time=%s" % now print"[NAVIGATION] timediff=%s" % abs(timediffRT) print"==================================================================================" print"[NAVIGATION] getNextPowerManagerTime= %s" % nextPT[0][0] print"[NAVIGATION] nextPowerManagerAfterEventActionAuto= %s" % nextPowerManagerAfterEventActionAuto print"[NAVIGATION] current Time=%s" % now print"[NAVIGATION] timediff=%s" % abs(timediffPT) print"==================================================================================" if now <= 31536000: # check for NTP-time sync, if no sync, wait for transponder time self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print"[NAVIGATION] [work-around] wait for time sync" elif abs(timediffRT) <= 600 or abs(timediffZT) <= 600: # if there is a recording sheduled in the next 10 mins, set the wasTimerWakeup flag (wakeup time is 5 min before timer starts, some boxes starts but earlier than is set) wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() elif abs(timediffPT) <= 600 and (nextPT[0][1] == PowerTimer.TIMERTYPE.WAKEUP or nextPT[0][1] == PowerTimer.TIMERTYPE.WAKEUPTOSTANDBY or nextPT[0][2] == PowerTimer.AFTEREVENT.WAKEUP or nextPT[0][2] == PowerTimer.AFTEREVENT.WAKEUPTOSTANDBY): # if there is a power timer in the next 5 mins, set the wasTimerWakeup flag wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() print"[NAVIGATION] wasTimerWakeup = %s, current time is %s" % (wasTimerWakeup, ctime(now)) stbytimer = 5 # original is 15 if wasTimerWakeup: self.__wasTimerWakeup = True if now <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print"[NAVIGATION] wait for time sync" elif self.nextRecordTimerAfterEventActionAuto and abs(timediffRT) <= 600: self.__wasRecTimerWakeup = True print '[NAVIGATION] RECTIMER: wakeup to standby detected. Timer starts at %s' % ctime(nextRT) f = open("/tmp/was_rectimer_wakeup", "w") f.write('1') f.close() # as we woke the box to record, place the box in standby. self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(stbytimer * 1000, True) elif self.nextRecordTimerAfterEventActionAuto and abs(timediffZT) <= 600: self.__wasRecTimerWakeup = True print '[NAVIGATION] ZAPTIMER: wakeup detected. Timer starts at %s' % ctime(nextZT) f = open("/tmp/was_rectimer_wakeup", "w") f.write('1') f.close() if abs(timediffZT) > 60 + stbytimer: #more than 1 minutes to wake up from zaptimer - go in standby self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(stbytimer * 1000, True) elif self.nextPowerManagerAfterEventActionAuto and abs(timediffPT) <= 600 and (nextPT[0][1] == PowerTimer.TIMERTYPE.WAKEUP or nextPT[0][2] == PowerTimer.AFTEREVENT.WAKEUP): self.__wasPowerTimerWakeup = True print '[NAVIGATION] POWERTIMER: wakeup detected. Timer starts at %s' % ctime(nextPT[0][0]) if abs(timediffPT) > 60 + stbytimer: #more than 1 minutes to wake up from powertimer - go in standby self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(stbytimer * 1000, True) elif self.nextPowerManagerAfterEventActionAuto and abs(timediffPT) <= 600 and (nextPT[0][1] == PowerTimer.TIMERTYPE.WAKEUPTOSTANDBY or nextPT[0][2] == PowerTimer.AFTEREVENT.WAKEUPTOSTANDBY): self.__wasPowerTimerWakeup = True print '[NAVIGATION] POWERTIMER: wakeup to standby detected. Timer starts at %s' % ctime(nextPT[0][0]) f = open("/tmp/was_powertimer_wakeup", "w") f.write('1') f.close() # as a PowerTimer WakeToStandby was actiond to it. self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(stbytimer * 1000, True)
def __init__(self, nextRecordTimerAfterEventActionAuto=False, nextPowerManagerAfterEventActionAuto=False): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [] self.record_event = [] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = RecordTimer.RecordTimer() self.PowerTimer = PowerTimer.PowerTimer() self.nextRecordTimerAfterEventActionAuto = nextRecordTimerAfterEventActionAuto self.nextPowerManagerAfterEventActionAuto = nextPowerManagerAfterEventActionAuto self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False self.syncCount = 0 wasTimerWakeup = getFPWasTimerWakeup() thisBox = getBoxType() if thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'dags', 'fulan'): config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() print "[NAVIGATION] USE DEEPSTAND-WORKAROUND FOR THIS BOXTYPE (%s) !!" % thisBox if not wasTimerWakeup and config.workaround.deeprecord.value: #work-around for boxes where driver not sent was_timer_wakeup signal to e2 print "==================================================================================" print "[NAVIGATION] getNextRecordingTime= %s" % self.RecordTimer.getNextRecordingTime( ) print "[NAVIGATION] nextRecordTimerAfterEventActionAuto= %s" % nextRecordTimerAfterEventActionAuto print "[NAVIGATION] current Time=%s" % time() print "[NAVIGATION] timediff=%s" % abs( self.RecordTimer.getNextRecordingTime() - time()) print "==================================================================================" print "[NAVIGATION] getNextPowerManagerTime= %s" % self.PowerTimer.getNextPowerManagerTime( ) print "[NAVIGATION] nextPowerManagerAfterEventActionAuto= %s" % nextPowerManagerAfterEventActionAuto print "[NAVIGATION] current Time=%s" % time() print "[NAVIGATION] timediff=%s" % abs( self.PowerTimer.getNextPowerManagerTime() - time()) print "==================================================================================" if time( ) <= 31536000: # check for NTP-time sync, if no sync, wait for transponder time self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print "[NAVIGATION] [work-around] wait for time sync" elif abs( self.RecordTimer.getNextRecordingTime() - time() ) <= 360: # if there is a recording sheduled in the next 5 mins, set the wasTimerWakeup flag wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() elif abs( self.PowerTimer.getNextPowerManagerTime() - time() ) <= 360: # if there is a power timer in the next 5 mins, set the wasTimerWakeup flag wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() print "[NAVIGATION] wasTimerWakeup = %s" % wasTimerWakeup if wasTimerWakeup: self.__wasTimerWakeup = True if time() <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print "[NAVIGATION] wait for time sync" elif nextRecordTimerAfterEventActionAuto and abs( self.RecordTimer.getNextRecordingTime() - time()) <= 360: self.__wasRecTimerWakeup = True print 'RECTIMER: wakeup to standby detected.' f = open("/tmp/was_rectimer_wakeup", "w") f.write('1') f.close() # as we woke the box to record, place the box in standby. self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(15000, True) elif nextPowerManagerAfterEventActionAuto: self.__wasPowerTimerWakeup = True print 'POWERTIMER: wakeup to standby detected.' f = open("/tmp/was_powertimer_wakeup", "w") f.write('1') f.close() # as a PowerTimer WakeToStandby was actiond to it. self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(15000, True)
def __init__(self, wakeupData=None): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [ ] self.record_event = [ ] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = None self.isRecordTimerImageStandard = False if not self.RecordTimer: self.RecordTimer = RecordTimer.RecordTimer() self.isRecordTimerImageStandard = True self.PowerTimer = None self.PowerTimer = PowerTimer.PowerTimer() self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False #wakeup data try: self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = [int(n) for n in wakeupData.split(',')] except: print "="*100 print "[NAVIGATION] ERROR: can't read wakeup data" self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = -1,-1,0,0,-1,0 #print ctime(self.wakeuptime), ctime(self.timertime), self.wakeuptyp, self.getstandby, ctime(self.recordtime), self.forcerecord now = time() timediff_wakeup = self.wakeuptime - now timediff_timer = self.timertime - now self.syncCount = 0 wasTimerWakeup = getFPWasTimerWakeup() #TODO: verify wakeup-state for boxes where only after shutdown removed the wakeup-state (for boxes where "/proc/stb/fp/was_timer_wakeup" is not writable (clearFPWasTimerWakeup() in StbHardware.py has no effect -> after x hours and restart/reboot is wasTimerWakeup = True) print "="*100 thisBox = getBoxType() if not config.workaround.deeprecord.value and (thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'dags', 'fulan', 'entwopia')): print"[NAVIGATION] FORCED DEEPSTANDBY-WORKAROUND FOR THIS BOXTYPE (%s)" %thisBox config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() if config.workaround.deeprecord.value: #work-around for boxes where driver not sent was_timer_wakeup signal to e2 wasTimerWakeup = False print "[NAVIGATION] starting deepstandby-workaround" if now <= 31536000: # check for NTP-time sync, if no sync, wait for transponder time self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print"[NAVIGATION] wait for time sync" print "~"*100 elif abs(timediff_wakeup) <= 600 or abs(timediff_timer) <= 600: # if there is a recording sheduled in the next 10 mins or starting before 10 mins, set the wasTimerWakeup flag (wakeup time is 5 min before timer starts, some boxes starts but earlier than is set) wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() print "[NAVIGATION] was timer wakeup = %s" % wasTimerWakeup print "[NAVIGATION] current time is %s" % ctime(now) if wasTimerWakeup: self.__wasTimerWakeup = True print "-"*100 if self.wakeuptime > 0: print "[NAVIGATION] wakeup time was %s" % ctime(self.wakeuptime) else: print "[NAVIGATION] wakeup time was not set" if now <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print"[NAVIGATION] wait for time sync" print "~"*100 else: self.wakeupCheck() else: if now > 31536000: if self.timertime > 0: print "[NAVIGATION] next '%s' starts at %s" % ({0:"record-timer",1:"zap-timer",2:"power-timer",3:"plugin-timer"}[self.wakeuptyp], ctime(self.timertime)) else: print "[NAVIGATION] no next timers" print "="*100
def cancel(self): config.plugins.m2b.passw.save() config.plugins.m2b.path.save() config.save() self.session.openWithCallback(self.close, get_chlist)
def callbackSetupUser(self, user): Log.w(user) config.plugins.twitchtv.user.value = user or "" config.plugins.twitchtv.save() config.save() self.createSetup()
def __init__(self, wakeupData=None): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [] self.record_event = [] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None Screens.Standby.TVstate() self.skipWakeup = False self.skipTVWakeup = False self.RecordTimer = None self.isRecordTimerImageStandard = False for p in plugins.getPlugins(PluginDescriptor.WHERE_RECORDTIMER): self.RecordTimer = p() if self.RecordTimer: break if not self.RecordTimer: self.RecordTimer = RecordTimer.RecordTimer() self.isRecordTimerImageStandard = True self.PowerTimer = None self.PowerTimer = PowerTimer.PowerTimer() self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False if not path.exists("/etc/enigma2/.deep" ): #flag file comes from "/usr/bin/enigma2.sh" print("=" * 100) print( "[NAVIGATION] Receiver does not start from Deep Standby - skip wake up detection" ) print("=" * 100) self.gotopower() return remove("/etc/enigma2/.deep") #wakeup data now = time() try: self.lastshutdowntime, self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = [ int(n) for n in wakeupData.split(',') ] except: print("=" * 100) print("[NAVIGATION] ERROR: can't read wakeup data") self.lastshutdowntime, self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = int( now), -1, -1, 0, 0, -1, 0 self.syncCount = 0 hasFakeTime = ( now <= 31536000 or now - self.lastshutdowntime <= 120 ) and self.getstandby < 2 #set hasFakeTime only if lower than values and was last shutdown to deep standby wasTimerWakeup, wasTimerWakeup_failure = getFPWasTimerWakeup(True) #TODO: verify wakeup-state for boxes where only after shutdown removed the wakeup-state (for boxes where "/proc/stb/fp/was_timer_wakeup" is not writable (clearFPWasTimerWakeup() in StbHardware.py has no effect -> after x hours and restart/reboot is wasTimerWakeup = True) if 0: #debug print("#" * 100) print("[NAVIGATION] timediff from last shutdown to now = %ds" % (now - self.lastshutdowntime)) print( "[NAVIGATION] shutdowntime: %s, wakeuptime: %s timertime: %s, recordtime: %s" % (ctime(self.lastshutdowntime), ctime(self.wakeuptime), ctime(self.timertime), ctime(self.recordtime))) print( "[NAVIGATION] wakeuptyp: %s, getstandby: %s, forcerecord: %s" % ({ 0: "record-timer", 1: "zap-timer", 2: "power-timer", 3: "plugin-timer" }[self.wakeuptyp], { 0: "no standby", 1: "standby", 2: "no standby (box was not in deepstandby)" }[self.getstandby], self.forcerecord)) print("#" * 100) print("=" * 100) print("[NAVIGATION] was timer wakeup = %s" % wasTimerWakeup) print( "[NAVIGATION] current time is %s -> it's fake-time suspected: %s" % (ctime(now), hasFakeTime)) print("-" * 100) thisBox = getBoxType() if not config.workaround.deeprecord.value and ( wasTimerWakeup_failure or thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3', 'et8000') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'fulan', 'entwopia') or getMachineBuild() in ('dags7335', 'dags7356', 'dags7362')): print( "[NAVIGATION] FORCED DEEPSTANDBY-WORKAROUND FOR THIS BOXTYPE (%s)" % thisBox) print("-" * 100) config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() if config.workaround.deeprecord.value: #work-around for boxes where driver not sent was_timer_wakeup signal to e2 print("[NAVIGATION] starting deepstandby-workaround") self.wakeupwindow_plus = self.timertime + 300 self.wakeupwindow_minus = self.wakeuptime - ( config.workaround.wakeupwindow.value * 60) wasTimerWakeup = False if not hasFakeTime and now >= self.wakeupwindow_minus and now <= self.wakeupwindow_plus: # if there is a recording sheduled, set the wasTimerWakeup flag wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() else: #secure wakeup window to prevent a wrong 'wasTimerWakeup' value as timer wakeup detection self.wakeupwindow_plus = self.timertime + 900 self.wakeupwindow_minus = self.wakeuptime - 3600 if self.wakeuptime > 0: print( "[NAVIGATION] wakeup time from deep-standby expected: *** %s ***" % (ctime(self.wakeuptime))) if config.workaround.deeprecord.value: print("[NAVIGATION] timer wakeup detection window: %s - %s" % (ctime(self.wakeupwindow_minus), ctime(self.wakeupwindow_plus))) else: print("[NAVIGATION] wakeup time was not set") print("-" * 100) if wasTimerWakeup: self.__wasTimerWakeup = True if not hasFakeTime: self.wakeupCheck() return if hasFakeTime and self.wakeuptime > 0: # check for NTP-time sync, if no sync, wait for transponder time if Screens.Standby.TVinStandby.getTVstandby( 'waitfortimesync') and not wasTimerWakeup: self.skipTVWakeup = True Screens.Standby.TVinStandby.setTVstate('power') self.savedOldTime = now self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print("[NAVIGATION] wait for time sync") print("~" * 100) else: self.wakeupCheck(False)
def __init__(self, wakeupData=None): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [ ] self.record_event = [ ] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None Screens.Standby.TVstate() self.skipWakeup = False self.skipTVWakeup = False self.RecordTimer = None self.isRecordTimerImageStandard = False if not self.RecordTimer: self.RecordTimer = RecordTimer.RecordTimer() self.isRecordTimerImageStandard = True self.PowerTimer = None self.PowerTimer = PowerTimer.PowerTimer() self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False #wakeup data now = time() try: self.lastshutdowntime, self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = [int(n) for n in wakeupData.split(',')] except: print "="*100 print "[NAVIGATION] ERROR: can't read wakeup data" self.lastshutdowntime, self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = int(now),-1,-1,0,0,-1,0 self.syncCount = 0 hasFakeTime = (now <= 31536000 or now - self.lastshutdowntime <= 120) and self.getstandby < 2 #set hasFakeTime only if lower than values and was last shutdown to deep standby wasTimerWakeup, wasTimerWakeup_failure = getFPWasTimerWakeup(True) #TODO: verify wakeup-state for boxes where only after shutdown removed the wakeup-state (for boxes where "/proc/stb/fp/was_timer_wakeup" is not writable (clearFPWasTimerWakeup() in StbHardware.py has no effect -> after x hours and restart/reboot is wasTimerWakeup = True) print "="*100 print "[NAVIGATION] was timer wakeup = %s" %wasTimerWakeup print "[NAVIGATION] current time is %s -> it's fake-time suspected: %s" %(ctime(now),hasFakeTime) print "-"*100 thisBox = getBoxType() if not config.workaround.deeprecord.value and (wasTimerWakeup_failure or thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3', 'et8000') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'fulan', 'entwopia') or getMachineBuild() in ('dags7335' , 'dags7356', 'dags7362')): print"[NAVIGATION] FORCED DEEPSTANDBY-WORKAROUND FOR THIS BOXTYPE (%s)" %thisBox print "-"*100 config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() if config.workaround.deeprecord.value: #work-around for boxes where driver not sent was_timer_wakeup signal to e2 print "[NAVIGATION] starting deepstandby-workaround" self.wakeupwindow_plus = self.timertime + 300 self.wakeupwindow_minus = self.wakeuptime - (config.workaround.wakeupwindow.value * 60) wasTimerWakeup = False if not hasFakeTime and now >= self.wakeupwindow_minus and now <= self.wakeupwindow_plus: # if there is a recording sheduled, set the wasTimerWakeup flag wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() else: #secure wakeup window to prevent a wrong 'wasTimerWakeup' value as timer wakeup detection self.wakeupwindow_plus = self.timertime + 900 self.wakeupwindow_minus = self.wakeuptime - 3600 if self.wakeuptime > 0: print "[NAVIGATION] wakeup time from deep-standby expected: *** %s ***" %(ctime(self.wakeuptime)) if config.workaround.deeprecord.value: print "[NAVIGATION] timer wakeup detection window: %s - %s" %(ctime(self.wakeupwindow_minus),ctime(self.wakeupwindow_plus)) else: print "[NAVIGATION] wakeup time was not set" print "-"*100 if wasTimerWakeup: self.__wasTimerWakeup = True if not hasFakeTime: self.wakeupCheck() return if hasFakeTime and self.wakeuptime > 0: # check for NTP-time sync, if no sync, wait for transponder time if Screens.Standby.TVinStandby.getTVstandby('waitfortimesync') and not wasTimerWakeup: self.skipTVWakeup = True Screens.Standby.TVinStandby.setTVstate('power') self.savedOldTime = now self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print"[NAVIGATION] wait for time sync" print "~"*100 else: self.wakeupCheck(False)
def backupfiles_choosen(self, ret): self.backupdirs = ' '.join(config.backupmanager.backupdirs.value) config.backupmanager.backupdirs.save() config.backupmanager.save() config.save()
def setScreen(self): self.list = [] if self.step == 1: self["introduction"].setText(_("The overscan wizard helps you to setup your TV in the correct way.\n\n" "For the majority of TV's, the factory default is to have overscan enabled. " "This means you are always watching a \"zoomed in\" picture instead of real HD, and parts of the user inferface (skin) may be invisible.\n\n" "The yellow area means a 5% border area of a full HD picture will be invisible.\n" "The green area means a 10% border area of a full HD picture will be invisible.\n\n" "In other words, if the yellow box meets all for sides of your screen, then you have at least 5% overscan on all sides.\n\n" "If you see the tips of all eight arrowheads, then your TV has overscan disabled.\n\n" "Test Pattern by TigerDave - www.tigerdave.com/ht_menu.htm")) self.yes_no = ConfigYesNo(default = True) self.list.append(getConfigListEntry(_("Did you see all eight arrow heads?"), self.yes_no)) self.save_new_position = False setPosition(0, 720, 0, 576) elif self.step == 2: self.Timer.stop() self["title"].setText(_("Overscan wizard")) self["introduction"].setText(_("It seems you did not see all the eight arrow heads. This means your TV is " "has overscan enabled, and is not configured properly.\n\n" "Please refer to your TVs manual to find how you can disable overscan on your TV. Look for terms like 'Just fit', 'Full width', etc. " "If you can't find it, ask other users at http://forums.openpli.org.\n\n")) self.list.append(getConfigListEntry(_("Did you see all eight arrow heads?"), self.yes_no)) self.yes_no.value = True self.save_new_position = False setPosition(0, 720, 0, 576) elif self.step == 3: self["introduction"].setText(_("You did not see all eight arrow heads. This means your TV has overscan enabled " "and presents you with a zoomed-in picture, causing you to loose part of a full HD screen. In addition this " "you may also miss parts of the user interface, for example volume bars and more.\n\n" "You can now try to resize and change the position of the user interface until you see the eight arrow heads.\n\n" "When done press OK.\n\n")) self.dst_left = ConfigSlider(default = config.plugins.OSDPositionSetup.dst_left.value, increment = 1, limits = (0, 720)) self.dst_right = ConfigSlider(default = config.plugins.OSDPositionSetup.dst_left.value + config.plugins.OSDPositionSetup.dst_width.value, increment = 1, limits = (0, 720)) self.dst_top = ConfigSlider(default = config.plugins.OSDPositionSetup.dst_top.value, increment = 1, limits = (0, 576)) self.dst_bottom = ConfigSlider(default = config.plugins.OSDPositionSetup.dst_top.value + config.plugins.OSDPositionSetup.dst_height.value, increment = 1, limits = (0, 576)) self.list.append(getConfigListEntry(_("left"), self.dst_left)) self.list.append(getConfigListEntry(_("right"), self.dst_right)) self.list.append(getConfigListEntry(_("top"), self.dst_top)) self.list.append(getConfigListEntry(_("bottom"), self.dst_bottom)) setConfiguredPosition() elif self.step == 4: self["introduction"].setText(_("You did not see all eight arrow heads. This means your TV has overscan enabled " "and presents you with a zoomed-in picture, causing you to loose part of a full HD screen. In addition this " "you may also miss parts of the user interface, for example volume bars and more.\n\n" "Unfortunately, your model of receiver is not capable to adjust the dimensions of the user interface. " "If not everything is visible, you should change the installed skin to one that supports the overscan area of your TV.\n\n" "When you select a different skin, the user interface of your receiver will restart.\n\n" "Note: you can always start the Overscan wizard later, via\n\nmenu->installation->system->Overscan wizard")) self.yes_no.value = False self.list.append(getConfigListEntry(_("Do you want to select a different skin?"), self.yes_no)) elif self.step == 5: self.Timer.stop() self["title"].setText(_("Overscan wizard")) self["introduction"].setText(_("The overscan wizard has been completed.\n\n" "Note: you can always start the Overscan wizard later, via\n\nmenu->installation->system->Overscan wizard")) self.yes_no.value = True self.list.append(getConfigListEntry(_("Do you want to quit the overscan wizard?"), self.yes_no)) elif self.step == 6: config.skin.primary_skin.value = "PLi-HD/skin.xml" config.save() self["introduction"].setText(_("The user interface of the receiver will now restart to select the selected skin")) quitMainloop(3) self["config"].list = self.list self["config"].l.setList(self.list) if self["config"].instance: self.__layoutFinished()
def setScreen(self): self.list = [] if self.step == 1: self["introduction"].setText( _("The overscan wizard helps you to setup your TV in the correct way.\n\n" "For the majority of TV's, the factory default is to have overscan enabled. " "This means you are always watching a \"zoomed in\" picture instead of real HD, and parts of the user inferface (skin) may be invisible.\n\n" "The yellow area means a 5% border area of a full HD picture will be invisible.\n" "The green area means a 10% border area of a full HD picture will be invisible.\n\n" "In other words, if the yellow box touches all four sides of your screen, you have at least 5% overscan on all sides.\n\n" "If you see the tips of all eight arrowheads, then your TV has overscan disabled.\n\n" "Test Pattern by TigerDave - www.tigerdave.com/ht_menu.htm")) self.yes_no = ConfigYesNo(default=True, graphic=False) self.list.append( getConfigListEntry(_("Did you see all eight arrow heads?"), self.yes_no)) self.save_new_position = False setPosition(0, 720, 0, 576) elif self.step == 2: self.Timer.stop() self["title"].setText(_("Overscan wizard")) self["introduction"].setText( _("It seems you did not see all the eight arrow heads. This means your TV " "has overscan enabled, and is not configured properly.\n\n" "Please refer to your TV's manual to find how you can disable overscan on your TV. Look for terms like 'Just fit', 'Full width', etc. " "If you can't find it, ask other users at http://forums.openpli.org.\n\n" )) self.list.append( getConfigListEntry(_("Did you see all eight arrow heads?"), self.yes_no)) self.yes_no.value = True self.save_new_position = False setPosition(0, 720, 0, 576) elif self.step == 3: self["introduction"].setText( _("You did not see all eight arrow heads. This means your TV has overscan enabled " "and presents you with a zoomed-in picture, causing you to loose part of a full HD screen. In addition to this " "you may also miss parts of the user interface, for example volume bars and more.\n\n" "You can now try to resize and change the position of the user interface until you see the eight arrow heads.\n\n" "When done press OK.\n\n")) self.dst_left = ConfigSlider( default=config.plugins.OSDPositionSetup.dst_left.value, increment=1, limits=(0, 720)) self.dst_right = ConfigSlider( default=config.plugins.OSDPositionSetup.dst_left.value + config.plugins.OSDPositionSetup.dst_width.value, increment=1, limits=(0, 720)) self.dst_top = ConfigSlider( default=config.plugins.OSDPositionSetup.dst_top.value, increment=1, limits=(0, 576)) self.dst_bottom = ConfigSlider( default=config.plugins.OSDPositionSetup.dst_top.value + config.plugins.OSDPositionSetup.dst_height.value, increment=1, limits=(0, 576)) self.list.append(getConfigListEntry(_("left"), self.dst_left)) self.list.append(getConfigListEntry(_("right"), self.dst_right)) self.list.append(getConfigListEntry(_("top"), self.dst_top)) self.list.append(getConfigListEntry(_("bottom"), self.dst_bottom)) setConfiguredPosition() elif self.step == 4: self["introduction"].setText( _("You did not see all eight arrow heads. This means your TV has overscan enabled " "and presents you with a zoomed-in picture, causing you to loose part of a full HD screen. In addition this " "you may also miss parts of the user interface, for example volume bars and more.\n\n" "Unfortunately, your model of receiver is not capable to adjust the dimensions of the user interface. " "If not everything is visible, you should change the installed skin to one that supports the overscan area of your TV.\n\n" "When you select a different skin, the user interface of your receiver will restart.\n\n" "Note: you can always start the Overscan Wizard later, via\n\nmenu->settings->system->userinterface->position & size" )) self.yes_no.value = False self.list.append( getConfigListEntry( _("Do you want to select a different skin?"), self.yes_no)) elif self.step == 5: self.Timer.stop() self["title"].setText(_("Overscan Wizard")) self["introduction"].setText( _("The overscan wizard has been completed.\n\n" "Note: you can always start the Overscan Wizard later, via\n\nmenu->settings->system->userinterface->position & size" )) self.yes_no.value = True self.list.append( getConfigListEntry( _("Do you want to quit the overscan wizard?"), self.yes_no)) elif self.step == 6: config.skin.primary_skin.value = "GigabluePax/skin.xml" config.save() self["introduction"].setText( _("The user interface of the receiver will now restart to select the selected skin" )) quitMainloop(3) self["config"].list = self.list self["config"].l.setList(self.list) if self["config"].instance: self.__layoutFinished()
def __init__(self, wakeupData=None): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [] self.record_event = [] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = None self.isRecordTimerImageStandard = False if not self.RecordTimer: self.RecordTimer = RecordTimer.RecordTimer() self.isRecordTimerImageStandard = True self.PowerTimer = None self.PowerTimer = PowerTimer.PowerTimer() self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False #wakeup data try: self.lastshutdowntime, self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = [ int(n) for n in wakeupData.split(',') ] except: print "=" * 100 print "[NAVIGATION] ERROR: can't read wakeup data" self.lastshutdowntime, self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = -1, -1, -1, 0, 0, -1, 0 #print ctime(self.lastshutdowntime), ctime(self.wakeuptime), ctime(self.timertime), self.wakeuptyp, self.getstandby, ctime(self.recordtime), self.forcerecord now = time() self.wakeupwindow_plus = self.timertime + 300 self.wakeupwindow_minus = self.wakeuptime - ( config.workaround.wakeupwindow.value * 60) self.syncCount = 0 self.bootTime = 120 #if time diff from last shutdown and now -> lower than value = Box has Fake Time self.hasFakeTime = ( now <= 31536000 or now - self.lastshutdowntime <= self.bootTime ) and self.getstandby < 2 #set hasFakeTime only if was last shutdown to deep standby wasTimerWakeup, wasTimerWakeup_failure = getFPWasTimerWakeup(True) #TODO: verify wakeup-state for boxes where only after shutdown removed the wakeup-state (for boxes where "/proc/stb/fp/was_timer_wakeup" is not writable (clearFPWasTimerWakeup() in StbHardware.py has no effect -> after x hours and restart/reboot is wasTimerWakeup = True) print "=" * 100 if self.getstandby < 2 and not self.hasFakeTime: print "[NAVIGATION] time diff from shutdown to now = %is" % ( now - self.lastshutdowntime) if self.wakeuptime > 0: print "[NAVIGATION] wakeup time from deep-standby expected: *** %s ***" % ( ctime(self.wakeuptime)) print "-" * 100 thisBox = getBoxType() if not config.workaround.deeprecord.value and ( wasTimerWakeup_failure or thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3', 'et8000') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'fulan', 'entwopia') or getMachineBuild() in ('dags7335', 'dags7356', 'dags7362')): print "[NAVIGATION] FORCED DEEPSTANDBY-WORKAROUND FOR THIS BOXTYPE (%s)" % thisBox config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() if config.workaround.deeprecord.value: #work-around for boxes where driver not sent was_timer_wakeup signal to e2 wasTimerWakeup = False print "[NAVIGATION] starting deepstandby-workaround" if self.wakeuptime > 0: print "[NAVIGATION] timer wakeup detection window: %s - %s" % ( ctime(self.wakeupwindow_minus), ctime(self.wakeupwindow_plus)) if self.hasFakeTime: # check for NTP-time sync, if no sync, wait for transponder time self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print "[NAVIGATION] wait for time sync" print "~" * 100 elif now >= self.wakeupwindow_minus and now <= self.wakeupwindow_plus: # if there is a recording sheduled, set the wasTimerWakeup flag wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() print "[NAVIGATION] was timer wakeup = %s" % wasTimerWakeup print "[NAVIGATION] current time is %s" % ctime(now) if wasTimerWakeup: self.__wasTimerWakeup = True print "-" * 100 if self.wakeuptime > 0: print "[NAVIGATION] wakeup time was %s" % ctime( self.wakeuptime) else: print "[NAVIGATION] wakeup time was not set" if self.hasFakeTime: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print "[NAVIGATION] wait for time sync" print "~" * 100 else: self.wakeupCheck() else: if not self.hasFakeTime or not config.workaround.deeprecord.value: self.wakeupCheck(False)
def __init__(self, wakeupData=None): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [] self.record_event = [] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = None self.isRecordTimerImageStandard = False if not self.RecordTimer: self.RecordTimer = RecordTimer.RecordTimer() self.isRecordTimerImageStandard = True self.PowerTimer = None self.PowerTimer = PowerTimer.PowerTimer() self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False #wakeup data try: self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = [ int(n) for n in wakeupData.split(',') ] except: print "=" * 100 print "[NAVIGATION] ERROR: can't read wakeup data" self.wakeuptime, self.timertime, self.wakeuptyp, self.getstandby, self.recordtime, self.forcerecord = -1, -1, 0, 0, -1, 0 #print ctime(self.wakeuptime), ctime(self.timertime), self.wakeuptyp, self.getstandby, ctime(self.recordtime), self.forcerecord now = time() timediff_wakeup = self.wakeuptime - now timediff_timer = self.timertime - now self.syncCount = 0 wasTimerWakeup = getFPWasTimerWakeup() #TODO: verify wakeup-state for boxes where only after shutdown removed the wakeup-state (for boxes where "/proc/stb/fp/was_timer_wakeup" is not writable (clearFPWasTimerWakeup() in StbHardware.py has no effect -> after x hours and restart/reboot is wasTimerWakeup = True) print "=" * 100 thisBox = getBoxType() if not config.workaround.deeprecord.value and thisBox in ( 'ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3') or getBrandOEM() in ( 'ebox', 'azbox', 'xp', 'ini', 'dags', 'fulan', 'entwopia'): print "[NAVIGATION] FORCED DEEPSTANDBY-WORKAROUND FOR THIS BOXTYPE (%s)" % thisBox config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() if config.workaround.deeprecord.value: #work-around for boxes where driver not sent was_timer_wakeup signal to e2 wasTimerWakeup = False print "[NAVIGATION] starting deepstandby-workaround" if now <= 31536000: # check for NTP-time sync, if no sync, wait for transponder time self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print "[NAVIGATION] wait for time sync" print "~" * 100 elif abs(timediff_wakeup) <= 600 or abs( timediff_timer ) <= 600: # if there is a recording sheduled in the next 10 mins or starting before 10 mins, set the wasTimerWakeup flag (wakeup time is 5 min before timer starts, some boxes starts but earlier than is set) wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() print "[NAVIGATION] was timer wakeup = %s" % wasTimerWakeup print "[NAVIGATION] current time is %s" % ctime(now) if wasTimerWakeup: self.__wasTimerWakeup = True print "-" * 100 print "[NAVIGATION] wakeup time was %s" % ctime(self.wakeuptime) if now <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print "[NAVIGATION] wait for time sync" print "~" * 100 else: self.wakeupCheck() else: if now > 31536000: if self.timertime > 0: print "[NAVIGATION] next '%s' starts at %s" % ( { 0: "record-timer", 1: "zap-timer", 2: "power-timer", 3: "plugin-timer" }[self.wakeuptyp], ctime(self.timertime)) else: print "[NAVIGATION] no next timers" print "=" * 100
def __init__(self, nextRecordTimerAfterEventActionAuto=False, nextPowerManagerAfterEventActionAuto=False): if NavigationInstance.instance is not None: raise NavigationInstance.instance NavigationInstance.instance = self self.ServiceHandler = eServiceCenter.getInstance() import Navigation as Nav Nav.navcore = self self.pnav = pNavigation() self.pnav.m_event.get().append(self.dispatchEvent) self.pnav.m_record_event.get().append(self.dispatchRecordEvent) self.event = [] self.record_event = [] self.currentlyPlayingServiceReference = None self.currentlyPlayingServiceOrGroup = None self.currentlyPlayingService = None self.RecordTimer = None for p in plugins.getPlugins(PluginDescriptor.WHERE_RECORDTIMER): self.RecordTimer = p() if self.RecordTimer: break if not self.RecordTimer: self.RecordTimer = RecordTimer.RecordTimer() self.PowerTimer = None self.PowerTimer = PowerTimer.PowerTimer() self.nextRecordTimerAfterEventActionAuto = nextRecordTimerAfterEventActionAuto self.nextPowerManagerAfterEventActionAuto = nextPowerManagerAfterEventActionAuto self.__wasTimerWakeup = False self.__wasRecTimerWakeup = False self.__wasPowerTimerWakeup = False self.syncCount = 0 now = time() nextZT = self.RecordTimer.getNextZapTime() nextRT = self.RecordTimer.getNextRecordingTime() nextPT = self.PowerTimer.getNextPowerManagerTime(getNextTimerTyp=True) timediffZT = nextZT - now timediffRT = nextRT - now timediffPT = nextPT[0][0] - now wasTimerWakeup = getFPWasTimerWakeup() #TODO: verify wakeup-state for boxes where only after shutdown removed the wakeup-state (for boxes where "/proc/stb/fp/was_timer_wakeup" is not writable (clearFPWasTimerWakeup() in StbHardware.py has no effect -> after x hours and restart/reboot is wasTimerWakeup = True) thisBox = getBoxType() if thisBox in ('ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'beyonwizt3') or getBrandOEM() in ('ebox', 'azbox', 'xp', 'ini', 'dags', 'fulan', 'entwopia'): config.workaround.deeprecord.setValue(True) config.workaround.deeprecord.save() config.save() print "[NAVIGATION] USE DEEPSTAND-WORKAROUND FOR THIS BOXTYPE (%s) !!" % thisBox if not wasTimerWakeup and config.workaround.deeprecord.value: #work-around for boxes where driver not sent was_timer_wakeup signal to e2 print "==================================================================================" print "[NAVIGATION] getNextZapTime= %s" % nextZT print "[NAVIGATION] nextRecordTimerAfterEventActionAuto= %s" % nextRecordTimerAfterEventActionAuto print "[NAVIGATION] current Time=%s" % now print "[NAVIGATION] timediff=%s" % abs(timediffZT) print "==================================================================================" print "[NAVIGATION] getNextRecordingTime= %s" % nextRT print "[NAVIGATION] nextRecordTimerAfterEventActionAuto= %s" % nextRecordTimerAfterEventActionAuto print "[NAVIGATION] current Time=%s" % now print "[NAVIGATION] timediff=%s" % abs(timediffRT) print "==================================================================================" print "[NAVIGATION] getNextPowerManagerTime= %s" % nextPT[0][0] print "[NAVIGATION] nextPowerManagerAfterEventActionAuto= %s" % nextPowerManagerAfterEventActionAuto print "[NAVIGATION] current Time=%s" % now print "[NAVIGATION] timediff=%s" % abs(timediffPT) print "==================================================================================" if now <= 31536000: # check for NTP-time sync, if no sync, wait for transponder time self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print "[NAVIGATION] [work-around] wait for time sync" elif abs(timediffRT) <= 600 or abs( timediffZT ) <= 600: # if there is a recording sheduled in the next 10 mins, set the wasTimerWakeup flag (wakeup time is 5 min before timer starts, some boxes starts but earlier than is set) wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() elif abs(timediffPT) <= 600 and ( nextPT[0][1] == PowerTimer.TIMERTYPE.WAKEUP or nextPT[0][1] == PowerTimer.TIMERTYPE.WAKEUPTOSTANDBY or nextPT[0][2] == PowerTimer.AFTEREVENT.WAKEUP or nextPT[0][2] == PowerTimer.AFTEREVENT.WAKEUPTOSTANDBY ): # if there is a power timer in the next 5 mins, set the wasTimerWakeup flag wasTimerWakeup = True f = open("/tmp/was_timer_wakeup_workaround.txt", "w") file = f.write(str(wasTimerWakeup)) f.close() print "[NAVIGATION] wasTimerWakeup = %s, current time is %s" % ( wasTimerWakeup, ctime(now)) stbytimer = 5 # original is 15 if wasTimerWakeup: self.__wasTimerWakeup = True if now <= 31536000: self.timesynctimer = eTimer() self.timesynctimer.callback.append(self.TimeSynctimer) self.timesynctimer.start(5000, True) print "[NAVIGATION] wait for time sync" elif self.nextRecordTimerAfterEventActionAuto and abs( timediffRT) <= 600: self.__wasRecTimerWakeup = True print '[NAVIGATION] RECTIMER: wakeup to standby detected. Timer starts at %s' % ctime( nextRT) f = open("/tmp/was_rectimer_wakeup", "w") f.write('1') f.close() # as we woke the box to record, place the box in standby. self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(stbytimer * 1000, True) elif self.nextRecordTimerAfterEventActionAuto and abs( timediffZT) <= 600: self.__wasRecTimerWakeup = True print '[NAVIGATION] ZAPTIMER: wakeup detected. Timer starts at %s' % ctime( nextZT) f = open("/tmp/was_rectimer_wakeup", "w") f.write('1') f.close() if abs( timediffZT ) > 60 + stbytimer: #more than 1 minutes to wake up from zaptimer - go in standby self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(stbytimer * 1000, True) elif self.nextPowerManagerAfterEventActionAuto and abs( timediffPT) <= 600 and ( nextPT[0][1] == PowerTimer.TIMERTYPE.WAKEUP or nextPT[0][2] == PowerTimer.AFTEREVENT.WAKEUP): self.__wasPowerTimerWakeup = True print '[NAVIGATION] POWERTIMER: wakeup detected. Timer starts at %s' % ctime( nextPT[0][0]) if abs( timediffPT ) > 60 + stbytimer: #more than 1 minutes to wake up from powertimer - go in standby self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(stbytimer * 1000, True) elif self.nextPowerManagerAfterEventActionAuto and abs( timediffPT) <= 600 and ( nextPT[0][1] == PowerTimer.TIMERTYPE.WAKEUPTOSTANDBY or nextPT[0][2] == PowerTimer.AFTEREVENT.WAKEUPTOSTANDBY): self.__wasPowerTimerWakeup = True print '[NAVIGATION] POWERTIMER: wakeup to standby detected. Timer starts at %s' % ctime( nextPT[0][0]) f = open("/tmp/was_powertimer_wakeup", "w") f.write('1') f.close() # as a PowerTimer WakeToStandby was actiond to it. self.standbytimer = eTimer() self.standbytimer.callback.append(self.gotostandby) self.standbytimer.start(stbytimer * 1000, True)