Esempio n. 1
0
	if config.misc.NTPserver.value == "pool.ntp.org":
		return
	print "[NTPDATE] save /etc/default/ntpdate"
	f = open("/etc/default/ntpdate", "w")
	f.write('NTPSERVERS="' + config.misc.NTPserver.value + '"')
	f.close()
	os.chmod("/etc/default/ntpdate", 0755)
	from Components.Console import Console
	Console = Console()
	Console.ePopen('/usr/bin/ntpdate-sync')
config.misc.NTPserver.addNotifier(NTPserverChanged, immediate_feedback = True)

profile("Twisted")
try:
	import e2reactor
	e2reactor.install()

	from twisted.internet import reactor

	def runReactor():
		reactor.run(installSignalHandlers=False)
except ImportError:
	print "twisted not available"
	def runReactor():
		enigma.runMainloop()

profile("LOAD:Plugin")

# initialize autorun plugins and plugin menu entries
from Components.PluginComponent import plugins
Esempio n. 2
0
    f = open("/etc/default/ntpdate", "w")
    f.write('NTPSERVERS="' + config.misc.NTPserver.value + '"')
    f.close()
    os.chmod("/etc/default/ntpdate", 0755)
    from Components.Console import Console
    Console = Console()
    Console.ePopen('/usr/bin/ntpdate-sync')


config.misc.NTPserver.addNotifier(NTPserverChanged, immediate_feedback=False)
config.misc.NTPserver.callNotifiersOnSaveAndCancel = True

profile("Twisted")
try:
    import e2reactor
    e2reactor.install()

    from twisted.internet import reactor

    def runReactor():
        reactor.run(installSignalHandlers=False)
except ImportError:
    print "twisted not available"

    def runReactor():
        enigma.runMainloop()


profile("LOAD:Plugin")

from twisted.python import log
#################################
#                               #
#  Code execution starts here!  #
#                               #
#################################

from sys import stdout

MODULE_NAME = __name__.split(".")[-1]

profile("Twisted")
try:  # Configure the twisted processor
	from twisted.python.runtime import platform
	platform.supportsThreads = lambda: True
	from e2reactor import install
	install()
	from twisted.internet import reactor

	def runReactor():
		reactor.run(installSignalHandlers=False)

except ImportError:
	print("[StartEnigma] Error: Twisted not available!")

	def runReactor():
		enigma.runMainloop()

try:  # Configure the twisted logging
	from twisted.python import log, util

	def quietEmit(self, eventDict):