Advertisement
SharkyEXE

Untitled

Aug 5th, 2018
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. from enigma import eTimer
  2. from Components.config import config
  3. from Components.Console import Console
  4.  
  5. _session = None
  6.  
  7. class NTPSyncPoller:
  8. """Automatically Poll NTP"""
  9. def __init__(self):
  10. self.timer = eTimer()
  11. self.Console = Console()
  12.  
  13. def start(self):
  14. if not self.timer.callback:
  15. self.timer.callback.append(self.NTPStart)
  16. self.timer.startLongTimer(0)
  17.  
  18. def stop(self):
  19. if self.timer.callback:
  20. self.timer.callback.remove(self.NTPStart)
  21. self.timer.stop()
  22.  
  23. def NTPStart(self):
  24. if config.plugins.SystemTime.choiceSystemTime.value == "1":
  25. self.Console.ePopen('/usr/bin/ntpdate -b -s -u pool.ntp.org')
  26. self.timer.startLongTimer(int(config.plugins.SystemTime.useNTPminutes.value) * 60)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement