from Tools import RedirectOutput
-from enigma import *
+from enigma import runMainloop, eDVBDB, eTimer, quitMainloop, eDVBVolumecontrol, \
+ getDesktop, ePythonConfigQuery, eAVSwitch, eWindow
from tools import *
from Components.Language import language
language.addCallback(setEPGLanguage)
-import traceback
+from traceback import print_exc
import Screens.InfoBar
from Screens.SimpleSummary import SimpleSummary
-import sys
-import time
+from sys import stdout, exc_info
import ServiceReference
from skin import readSkin, applyAllAttributes
from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE
-from Components.config import config, ConfigText, configfile, ConfigSubsection, ConfigInteger
+from Components.config import config, configfile, ConfigText, ConfigSubsection, ConfigInteger
InitFallbackFiles()
eDVBDB.getInstance().reloadBouquets()
try:
return screen(self, *arguments, **kwargs)
except:
- errstr = "Screen %s(%s, %s): %s" % (str(screen), str(arguments), str(kwargs), sys.exc_info()[0])
+ errstr = "Screen %s(%s, %s): %s" % (str(screen), str(arguments), str(kwargs), exc_info()[0])
print errstr
- traceback.print_exc(file=sys.stdout)
+ print_exc(file=stdout)
quitMainloop(5)
def instantiateDialog(self, screen, *arguments, **kwargs):
except:
print 'EXCEPTION IN DIALOG INIT CODE, ABORTING:'
print '-'*60
- traceback.print_exc(file=sys.stdout)
+ print_exc(file=stdout)
quitMainloop(5)
print '-'*60
self.muteDialog.hide()
self.volumeDialog.setValue(vol)
-from Screens.Standby import Standby
+from Screens.Standby import Standby, TryQuitMainloop, inTryQuitMainloop
class PowerKey:
""" PowerKey stuff - handles the powerkey press and powerkey release actions"""
def powertimer(self):
print "PowerOff - Now!"
- self.quit()
+ global inTryQuitMainloop
+ if not inTryQuitMainloop:
+ self.session.open(TryQuitMainloop, 1)
def powerdown(self):
self.standbyblocked = 0
def standby(self):
if self.session.current_dialog and self.session.current_dialog.ALLOW_SUSPEND:
- self.session.open(Standby, self)
-
- def quit(self):
- # halt
- quitMainloop(1)
+ self.session.open(Standby)
from Screens.Scart import Scart
# we need session.scart to access it from within menu.xml
session.scart = AutoScartControl(session)
-
+
runReactor()
configfile.save()
-
- from Tools.DreamboxHardware import setFPWakeuptime
+
from time import time
+ from Tools.DreamboxHardware import setFPWakeuptime
nextRecordingTime = session.nav.RecordTimer.getNextRecordingTime()
if nextRecordingTime != -1:
if (nextRecordingTime - time() < 330): # no time to switch box back on
except:
print 'EXCEPTION IN PYTHON STARTUP CODE:'
print '-'*60
- traceback.print_exc(file=sys.stdout)
+ print_exc(file=stdout)
quitMainloop(5)
print '-'*60