Changeset 175
- Timestamp:
- 31/10/06 14:27:04 (2 years ago)
- Files:
-
- 1 modified
-
trunk/wakeup/src/helpers/wakeupserver.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wakeup/src/helpers/wakeupserver.py
r174 r175 68 68 69 69 def __init__(self): 70 _debug_('in __init__' )70 _debug_('in __init__', 2) 71 71 self.now = now() 72 72 self.resetTimeout() … … 99 99 try: 100 100 if os.stat(config.TV_RECORD_SCHEDULE)[stat.ST_MTIME] == mod_time: 101 _debug_('Return cached data' )101 _debug_('Return cached data', 2) 102 102 return scheduledRecordings 103 103 except OSError: … … 187 187 _debug_('in findNextProgram', 2) 188 188 189 next_program = None 190 189 191 progs = self.getScheduledRecordings().getProgramList() 190 191 next_program = None192 192 proglist = list(progs) 193 193 proglist.sort(self.progsTimeCompare) 194 194 for progitem in proglist: 195 195 prog = progs[progitem] 196 _debug_('prog=%s' % (prog) )196 _debug_('prog=%s' % (prog), 2) 197 197 try: 198 198 recording = prog.isRecording … … 200 200 except: 201 201 recording = False 202 _debug_('recording=%s' % (recording))203 202 _debug_('prog.stop=%s, now=%s' % (localtime(prog.stop+config.TV_RECORD_PADDING_POST), self.now)) 204 203 if self.now > prog.stop + config.TV_RECORD_PADDING_POST: 204 _debug_('skipping %s' % (prog), 2) 205 205 continue 206 else:207 _debug_('prog.stop=%s' % (localtime(prog.stop)))208 206 209 207 if not recording: … … 216 214 217 215 self.next_program = next_program 218 _debug_(' next_program=%s' % (next_program))216 _debug_('%s' % (next_program)) 219 217 return next_program 220 218 221 219 222 220 def shutdown(self): 221 '''execute the shutdown command (currently disabled)''' 222 return 223 223 if not config.SHUTDOWN_SYS_CMD: 224 224 return … … 315 315 # 10 minuts is hardcoded in nvram_wakeup 316 316 wakeup = localtime(self.next_wakeup) - TimeDelta(0,config.WAKEUP_REBOOT_TIME,0) 317 _debug_('wakeup=%s reboot=%s now=%s' % (localtime(self.next_wakeup), wakeup, self.now)) 317 _debug_('wakeup=%s' % (localtime(self.next_wakeup))) 318 _debug_('reboot=%s' % (wakeup)) 319 _debug_('now=%s' % (self.now)) 318 320 if self.now > wakeup: 319 321 self.setMessage(-3, ('SUSPENDED BY NEXT WAKEUP IN %d MINS' % \ … … 344 346 self.need_reboot = False 345 347 self.setMessage(0, ('TIME FOR NVRAM WAKEUP HAS BEEN SET')) 346 #self.shutdown()348 self.shutdown() 347 349 return 348 350 elif self.nvram_rc == 1: 349 351 self.need_reboot = True 350 352 self.setMessage(0, ('TIME FOR NVRAM WAKEUP WITH REBOOT HAS BEEN SET')) 351 #self.shutdown()353 self.shutdown() 352 354 return 353 355 … … 355 357 self.need_reboot = False 356 358 self.setMessage(0, ('TIME FOR NVRAM WAKEUP FAILED (%s)' % self.nvram_rc)) 357 #self.shutdown()359 self.shutdown() 358 360 return 359 361 … … 440 442 441 443 def startMinuteCheck(self): 442 _debug_('in startMinuteCheck' )444 _debug_('in startMinuteCheck', 2) 443 445 self.now = now() 444 446 next_minute = ((int(self.now)/60) * 60 + 90) - int(self.now) … … 448 450 449 451 def minuteCheck(self): 450 _debug_('in minuteCheck' )452 _debug_('in minuteCheck', 2) 451 453 self.now = now() 452 454 next_minute = ((int(self.now)/60) * 60 + 90) - int(self.now)
