Esempio n. 1
0
	def __init__(self, session, device):
		Screen.__init__(self, session)
		self.inputDevice = device
		iInputDevices.currentDevice = self.inputDevice
		self.onChangedEntry = [ ]
		self.setup_title = _("Input device setup")
		self.isStepSlider = None
		self.enableEntry = None
		self.repeatEntry = None
		self.delayEntry = None
		self.nameEntry = None
		self.enableConfigEntry = None

		self.list = [ ]
		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)

		self["actions"] = ActionMap(["SetupActions", "MenuActions"],
			{
				"cancel": self.keyCancel,
				"save": self.apply,
				"menu": self.closeRecursive,
			}, -2)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["key_yellow"] = StaticText()
		self["key_blue"] = StaticText()
		self["introduction"] = StaticText()

		self.createSetup()
		self.onLayoutFinish.append(self.layoutFinished)
		self.onClose.append(self.cleanup)
Esempio n. 2
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self.finished_cb = None
		self.updateSatList()
		self.service = session.nav.getCurrentService()
		self.feinfo = None
		self.networkid = 0
		frontendData = None
		if self.service is not None:
			self.feinfo = self.service.frontendInfo()
			frontendData = self.feinfo and self.feinfo.getAll(True)
		
		self.createConfig(frontendData)

		del self.feinfo
		del self.service

		self["actions"] = NumberActionMap(["SetupActions"],
		{
			"ok": self.keyGo,
			"cancel": self.keyCancel,
		}, -2)

		self.statusTimer = eTimer()
		self.statusTimer.callback.append(self.updateStatus)
		#self.statusTimer.start(5000, True)

		self.list = []
		ConfigListScreen.__init__(self, self.list)
		if not self.scan_nims.value == "":
			self.createSetup()
			self["introduction"] = Label(_("Press OK to start the scan"))
		else:
			self["introduction"] = Label(_("Nothing to scan!\nPlease setup your tuner settings before you start a service scan."))
	def __init__(self, session):
		Screen.__init__(self, session)
		
		self["red"] = Label()
		self["green"] = Label()
		
		self.list = []
		self["list"] = PluginList(self.list)
		
		self["actions"] = ActionMap(["WizardActions"],
		{
			"ok": self.save,
			"back": self.close,
		})
		self["PluginDownloadActions"] = ActionMap(["ColorActions"],
		{
			"red": self.delete,
			"green": self.download
		})
		self["SoftwareActions"] = ActionMap(["ColorActions"],
		{
			"red": self.openExtensionmanager
		})
		self["PluginDownloadActions"].setEnabled(False)
		self["SoftwareActions"].setEnabled(False)
		self.onFirstExecBegin.append(self.checkWarnings)
		self.onShown.append(self.updateList)
Esempio n. 4
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self["actions"] = HelpableActionMap(self, "InfobarActions",
			{
				"showMovies": (self.showMovies, _("Play recorded movies...")),
				"showRadio": (self.showRadio, _("Show the radio player...")),
				"showTv": (self.showTv, _("Show the tv player...")),
			}, prio=2)

		self.allowPiP = True

		for x in HelpableScreen, \
				InfoBarBase, InfoBarShowHide, \
				InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder,  DeliteBp, DeliteGp, \
				InfoBarInstantRecord, InfoBarAudioSelection, InfoBarRedButton, InfoBarTimerButton, InfoBarUnhandledKey, InfoBarVmodeButton,\
				InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarSubserviceSelection, InfoBarBuffer, \
				InfoBarTimeshift, InfoBarSeek, InfoBarCueSheetSupport, InfoBarSummarySupport, InfoBarTimeshiftState, \
				InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarSubtitleSupport, InfoBarJobman, InfoBarPowersaver, \
				InfoBarPlugins, InfoBarServiceErrorPopupSupport, InfoBarHotkey:
			x.__init__(self)

		self.helpList.append((self["actions"], "InfobarActions", [("showMovies", _("Watch recordings..."))]))
		self.helpList.append((self["actions"], "InfobarActions", [("showRadio", _("Listen to the radio..."))]))

		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				enigma.iPlayableService.evUpdatedEventInfo: self.__eventInfoChanged
			})

		self.current_begin_time=0
		assert InfoBar.instance is None, "class InfoBar is a singleton class and just one instance of this class is allowed!"
		InfoBar.instance = self
Esempio n. 5
0
	def __init__(self, session):
		Screen.__init__(self, session)

		print "# AutoCardReg"
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions","CiSelectionActions"],
		{
			"left": self.keyLeft,
			"right": self.keyRight,
			"ok": self.ok,
			"cancel": self.close,
			"green": self.monitor,
			"blue": self.save,
		}, -1)

		self["key_blue"] = Label(_("Save"))
		self["key_green"] = Label(_("Monitor"))
		self["static_ip"] = Label(_("Static IP : Please wait..."))

		self.list = [ ]
		self.menuList = ConfigList(self.list)
		self.menuList.list = self.list
		self.menuList.l.setList(self.list)
		self["entries"] = self.menuList

		self.static_ip=None
		self.StaticIPTimer = eTimer()
		self.StaticIPTimer.callback.append(self.iptimeout)

		self.gateway="192.168.1.1"
		self.current_cardnum ="C - 01"
		self.init()
		self.reload_list()
		self.StaticIPTimer.start(500, True)	
		self.hide()
Esempio n. 6
0
	def __init__(self, session, retvalue=1, timeout=-1, default_yes = False):
		self.retval = retvalue
		recordings = session.nav.getRecordings()
		jobs = len(job_manager.getPendingJobs())
		self.connected = False
		reason = ""
		next_rec_time = -1
		if not recordings:
			next_rec_time = session.nav.RecordTimer.getNextRecordingTime()
		if recordings or (next_rec_time > 0 and (next_rec_time - time()) < 360):
			reason = _("Recording(s) are in progress or coming up in few seconds!") + '\n'
		if jobs:
			if jobs == 1:
				job = job_manager.getPendingJobs()[0]
				reason += "%s: %s (%d%%)\n" % (job.getStatustext(), job.name, int(100*job.progress/float(job.end)))
			else:
				reason += (ngettext("%d job is running in the background!", "%d jobs are running in the background!", jobs) % jobs) + '\n'
		if reason:
			text = { 1: _("Really shutdown now?"),
				2: _("Really reboot now?"),
				3: _("Really restart now?"),
				4: _("Really upgrade the frontprocessor and reboot now?"),
				42: _("Really upgrade your settop box and reboot now?") }.get(retvalue)
			if text:
				MessageBox.__init__(self, session, reason+text, type = MessageBox.TYPE_YESNO, timeout = timeout, default = default_yes)
				self.skinName = "MessageBoxSimple"
				session.nav.record_event.append(self.getRecordEvent)
				self.connected = True
				self.onShow.append(self.__onShow)
				self.onHide.append(self.__onHide)
				return
		self.skin = """<screen position="0,0" size="0,0"/>"""
		Screen.__init__(self, session)
		self.close(True)
	def __init__(self, session, type):
		Screen.__init__(self, session)
		
		self.type = type
		
		self.container = eConsoleAppContainer()
		self.container.appClosed.append(self.runFinished)
		self.container.dataAvail.append(self.dataAvail)
		self.onLayoutFinish.append(self.startRun)
		self.onShown.append(self.setWindowTitle)
		
		self.list = []
		self["list"] = PluginList(self.list)
		self.pluginlist = []
		self.expanded = []
		self.installedplugins = []
		
		if self.type == self.DOWNLOAD:
			self["text"] = Label(_("Downloading plugin information. Please wait..."))
		elif self.type == self.REMOVE:
			self["text"] = Label(_("Getting plugin information. Please wait..."))
		
		self.run = 0

		self.remainingdata = ""

		self["actions"] = ActionMap(["WizardActions"], 
		{
			"ok": self.go,
			"back": self.close,
		})
Esempio n. 8
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = ["CommitInfo", "About"]
		self["AboutScrollLabel"] = ScrollLabel(_("Please wait"))

		self["actions"] = ActionMap(["SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown,
				"left": self.left,
				"right": self.right
			})

		self.project = 0
		self.projects = [
			("enigma2", "Enigma2"),
			("openpli-oe-core", "Openpli Oe Core"),
			("enigma2-plugins", "Enigma2 Plugins"),
			("aio-grab", "Aio Grab"),
			("gst-plugin-dvbmediasink", "Gst Plugin Dvbmediasink"),
			("openembedded", "Openembedded"),
			("plugin-xmltvimport", "Plugin Xmltvimport"),
			("plugins-enigma2", "Plugins Enigma2"),
			("skin-magic", "Skin Magic"),
			("tuxtxt", "Tuxtxt")
		]
		self.cachedProjects = {}
		self.Timer = eTimer()
		self.Timer.callback.append(self.readCommitLogs)
		self.Timer.start(50, True)
Esempio n. 9
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self["actions"] = ActionMap(["OkCancelActions", "CiSelectionActions"],
			{
				"left": self.keyLeft,
				"right": self.keyLeft,
				"ok": self.okbuttonClick,
				"cancel": self.cancel
			},-1)

		self.dlg = None
		self.state = { }
		self.list = [ ]

		for slot in range(MAX_NUM_CI):
			state = eDVBCI_UI.getInstance().getState(slot)
			if state != -1:
				self.appendEntries(slot, state)
				CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)

		menuList = ConfigList(self.list)
		menuList.list = self.list
		menuList.l.setList(self.list)
		self["entries"] = menuList
		self["entries"].onSelectionChanged.append(self.selectionChanged)
		self["text"] = Label(_("Slot %d")%(1))
Esempio n. 10
0
File: Ci.py Progetto: OpenLD/enigma2
	def __init__(self, session):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("CIHelper Setup"))
		self.skinName = "CIHelper"
		self.onChangedEntry = [ ]
		self['ci0'] = Label(_("CIHelper for SLOT CI0"))
		self['ci0active'] = Pixmap()
		self['ci0inactive'] = Pixmap()
		self['ci1'] = Label(_("CIHelper for SLOT CI1"))
		self['ci1active'] = Pixmap()
		self['ci1inactive'] = Pixmap()

		self['autostart'] = Label(_("Autostart:"))
		self['labactive'] = Label(_(_("Active")))
		self['labdisabled'] = Label(_(_("Disabled")))
		self['status'] = Label(_("Current Status:"))
		self['labstop'] = Label(_("Stopped"))
		self['labrun'] = Label(_("Running"))
		self['key_red'] = Label()
		self['key_green'] = Label(_("Start"))
		self['key_yellow'] = Label(_("Autostart"))
		self['key_blue'] = Label()
		self.Console = Console()
		self.my_cihelper_active = False
		self.my_cihelper_run = False
		self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'SetupActions'], {'ok': self.setupcihelper, 'back': self.close, 'menu': self.setupcihelper, 'green': self.CIHelperStartStop, 'yellow': self.CIHelperset})
		self.onLayoutFinish.append(self.updateService)
Esempio n. 11
0
	def __init__(self, session):
		Screen.__init__(self, session)
		# don't remove the string out of the _(), or it can't be "translated" anymore.

		# TRANSLATORS: Add here whatever should be shown in the "translator" about screen, up to 6 lines (use \n for newline)
		info = _("TRANSLATOR_INFO")

		if info == "TRANSLATOR_INFO":
			info = "(N/A)"

		infolines = _("").split("\n")
		infomap = {}
		for x in infolines:
			l = x.split(': ')
			if len(l) != 2:
				continue
			(type, value) = l
			infomap[type] = value
		print infomap

		self["TranslationInfo"] = StaticText(info)

		translator_name = infomap.get("Language-Team", "none")
		if translator_name == "none":
			translator_name = infomap.get("Last-Translator", "")

		self["TranslatorName"] = StaticText(translator_name)

		self["actions"] = ActionMap(["SetupActions"],
			{
				"cancel": self.close,
				"ok": self.close,
			})
Esempio n. 12
0
File: Ci.py Progetto: OpenLD/enigma2
	def __init__(self, session, pin, pin_slot):
		Screen.__init__(self, session)
		self.skinName = ["ParentalControlChangePin", "Setup" ]
		self.setup_title = _("Enter pin code")
		self.onChangedEntry = [ ]

		self.slot = pin_slot
		self.pin = pin
		self.list = []
		self.pin1 = ConfigPIN(default = 0, censor = "*")
		self.pin2 = ConfigPIN(default = 0, censor = "*")
		self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1))
		self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2))
		self.list.append(getConfigListEntry(_("Enter PIN"), NoSave(self.pin1)))
		self.list.append(getConfigListEntry(_("Reenter PIN"), NoSave(self.pin2)))
		ConfigListScreen.__init__(self, self.list)

		self["actions"] = NumberActionMap(["DirectionActions", "ColorActions", "OkCancelActions"],
		{
			"cancel": self.cancel,
			"red": self.cancel,
			"save": self.keyOK,
		}, -1)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self.onLayoutFinish.append(self.layoutFinished)
Esempio n. 13
0
File: Ci.py Progetto: OpenLD/enigma2
	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = ["Setup" ]
		self.setup_title = _("CI settings")
		self["HelpWindow"] = Pixmap()
		self["HelpWindow"].hide()
		self["VKeyIcon"] = Boolean(False)
		self['footnote'] = Label()

		self.onChangedEntry = [ ]

		self.list = [ ]
		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)

		from Components.ActionMap import ActionMap
		self["actions"] = ActionMap(["SetupActions", "MenuActions", "ColorActions"],
			{
				"cancel": self.keyCancel,
				"save": self.apply,
				"menu": self.closeRecursive,
			}, -2)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["description"] = Label("")

		self.createSetup()
		self.onLayoutFinish.append(self.layoutFinished)
Esempio n. 14
0
	def __init__(self, session, parent):
		Screen.__init__(self, session, parent=parent)
		self["selected"] = StaticText("ViX:" + getImageVersion())

		AboutText = _("Model: %s %s\n") % (getMachineBrand(), getMachineName())

		if path.exists('/proc/stb/info/chipset'):
			chipset = open('/proc/stb/info/chipset', 'r').read()
			AboutText += _("Chipset: BCM%s") % chipset.replace('\n', '') + "\n"

		AboutText += _("Version: %s") % getImageVersion() + "\n"
		AboutText += _("Build: %s") % getImageBuild() + "\n"
		AboutText += _("Kernel: %s") % about.getKernelVersionString() + "\n"

		string = getDriverDate()
		year = string[0:4]
		month = string[4:6]
		day = string[6:8]
		driversdate = '-'.join((year, month, day))
		AboutText += _("Drivers: %s") % driversdate + "\n"
		AboutText += _("Last update: %s") % getEnigmaVersionString() + "\n\n"

		tempinfo = ""
		if path.exists('/proc/stb/sensors/temp0/value'):
			tempinfo = open('/proc/stb/sensors/temp0/value', 'r').read()
		elif path.exists('/proc/stb/fp/temp_sensor'):
			tempinfo = open('/proc/stb/fp/temp_sensor', 'r').read()
		if tempinfo and int(tempinfo.replace('\n', '')) > 0:
			mark = str('\xc2\xb0')
			AboutText += _("System temperature: %s") % tempinfo.replace('\n', '') + mark + "C\n\n"

		self["AboutText"] = StaticText(AboutText)
Esempio n. 15
0
	def __init__(self, session, menu_path = ""):
		Screen.__init__(self, session)
		self.menu_path = menu_path
		self.screentitle = _("OE Changes")
		self.skinName = "SoftwareUpdateChanges"
		self.logtype = 'oe'
		self["menu_path_compressed"] = StaticText("")
		self["text"] = ScrollLabel()
		self['title_summary'] = StaticText()
		self['text_summary'] = StaticText()
		self["key_red"] = Button(_("Close"))
		self["key_green"] = Button(_("OK"))
		self["key_yellow"] = Button(_("Show E2 Log"))
		self["myactions"] = ActionMap(['ColorActions', 'OkCancelActions', 'DirectionActions'],
									  {
										  'cancel': self.closeRecursive,
										  'green': self.closeRecursive,
										  "red": self.closeRecursive,
										  "yellow": self.changelogtype,
										  "left": self.pageUp,
										  "right": self.pageDown,
										  "down": self.pageDown,
										  "up": self.pageUp
									  }, -1)
		self.onLayoutFinish.append(self.getlog)
Esempio n. 16
0
	def __init__(self, session, menu_path = ""):
		Screen.__init__(self, session)
		screentitle = _("Devices")
		if config.usage.show_menupath.value == 'large':
			menu_path += screentitle
			title = menu_path
			self["menu_path_compressed"] = StaticText("")
		elif config.usage.show_menupath.value == 'small':
			title = screentitle
			self["menu_path_compressed"] = StaticText(menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "")
		else:
			title = screentitle
			self["menu_path_compressed"] = StaticText("")
		Screen.setTitle(self, title)
		self["TunerHeader"] = StaticText(_("Detected tuners:"))
		self["HDDHeader"] = StaticText(_("Detected devices:"))
		self["MountsHeader"] = StaticText(_("Network servers:"))
		self["nims"] = StaticText()
		for count in (0, 1, 2, 3):
			self["Tuner" + str(count)] = StaticText("")
		self["hdd"] = StaticText()
		self["mounts"] = StaticText()
		self.list = []
		self.activityTimer = eTimer()
		self.activityTimer.timeout.get().append(self.populate2)
		self["key_red"] = Button(_("Close"))
		self["actions"] = ActionMap(["SetupActions", "ColorActions", "TimerEditActions"],
									{
										"cancel": self.close,
										"ok": self.close,
										"red": self.close,
									})
		self.onLayoutFinish.append(self.populate)
Esempio n. 17
0
	def __init__(self, session, menu_path = ""):
		Screen.__init__(self, session)
		screentitle = _("Network")
		if config.usage.show_menupath.value == 'large':
			menu_path += screentitle
			title = menu_path
			self["menu_path_compressed"] = StaticText("")
		elif config.usage.show_menupath.value == 'small':
			title = screentitle
			self["menu_path_compressed"] = StaticText(menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "")
		else:
			title = screentitle
			self["menu_path_compressed"] = StaticText("")
		Screen.setTitle(self, title)
		self.skinName = ["SystemNetworkInfo", "WlanStatus"]
		self["LabelBSSID"] = StaticText()
		self["LabelESSID"] = StaticText()
		self["LabelQuality"] = StaticText()
		self["LabelSignal"] = StaticText()
		self["LabelBitrate"] = StaticText()
		self["LabelEnc"] = StaticText()
		self["BSSID"] = StaticText()
		self["ESSID"] = StaticText()
		self["quality"] = StaticText()
		self["signal"] = StaticText()
		self["bitrate"] = StaticText()
		self["enc"] = StaticText()

		self["IFtext"] = StaticText()
		self["IF"] = StaticText()
		self["Statustext"] = StaticText()
		self["statuspic"] = MultiPixmap()
		self["statuspic"].setPixmapNum(1)
		self["statuspic"].show()
		self["devicepic"] = MultiPixmap()

		self.iface = None
		self.createscreen()
		self.iStatus = None

		if iNetwork.isWirelessInterface(self.iface):
			try:
				from Plugins.SystemPlugins.WirelessLan.Wlan import iStatus

				self.iStatus = iStatus
			except:
				pass
			self.resetList()
			self.onClose.append(self.cleanup)

		self["key_red"] = StaticText(_("Close"))

		self["actions"] = ActionMap(["SetupActions", "ColorActions", "DirectionActions"],
									{
										"cancel": self.close,
										"ok": self.close,
										"up": self["AboutScrollLabel"].pageUp,
										"down": self["AboutScrollLabel"].pageDown
									})
		self.onLayoutFinish.append(self.updateStatusbar)
Esempio n. 18
0
	def __init__(self, session, timer):
		Screen.__init__(self, session)
		self.timer = timer

		self.entryDate = None
		self.entryService = None

		self["oktext"] = Label(_("OK"))
		self["canceltext"] = Label(_("Cancel"))
		self["ok"] = Pixmap()
		self["cancel"] = Pixmap()
		self["key_yellow"] = Label(_("Timer type"))
		self["key_blue"] = Label()

		self.createConfig()

		self["actions"] = NumberActionMap(["SetupActions", "GlobalActions", "PiPSetupActions", "ColorActions"],
		{
			"ok": self.keySelect,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"volumeUp": self.incrementStart,
			"volumeDown": self.decrementStart,
			"size+": self.incrementEnd,
			"size-": self.decrementEnd,
			"yellow": self.changeTimerType,
			"blue": self.changeZapWakeupType
		}, -2)

		self.list = []
		ConfigListScreen.__init__(self, self.list, session = session)
		self.setTitle(_("Timer entry"))
		self.createSetup("config")
Esempio n. 19
0
	def __init__(self, session, timer):
		Screen.__init__(self, session)
		self.timer = timer;
		self.log_entries = self.timer.log_entries[:]

		self.fillLogList()

		self["loglist"] = MenuList(self.list)
		self["logentry"] = Label()

		self["key_red"] = Button(_("Delete entry"))
		self["key_green"] = Button()
		self["key_yellow"] = Button("")
		self["key_blue"] = Button(_("Clear log"))

		self.onShown.append(self.updateText)

		self["actions"] = NumberActionMap(["OkCancelActions", "DirectionActions", "ColorActions"],
		{
			"ok": self.keyClose,
			"cancel": self.keyClose,
			"up": self.up,
			"down": self.down,
			"left": self.left,
			"right": self.right,
			"red": self.deleteEntry,
			"blue": self.clearLog
		}, -1)
		self.setTitle(_("Timer log"))
Esempio n. 20
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.list = []
        self.servicelist = ParentalControlList(self.list)
        self["servicelist"] = self.servicelist
        # self.onShown.append(self.chooseLetter)
        self.currentLetter = chr(SPECIAL_CHAR)
        self.readServiceList()
        self.chooseLetterTimer = eTimer()
        self.chooseLetterTimer.callback.append(self.chooseLetter)
        self.onLayoutFinish.append(self.LayoutFinished)

        self["actions"] = NumberActionMap(
            ["DirectionActions", "ColorActions", "OkCancelActions", "NumberActions"],
            {
                "ok": self.select,
                "cancel": self.cancel,
                # "left": self.keyLeft,
                # "right": self.keyRight,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal,
            },
            -1,
        )
Esempio n. 21
0
    def __init__(self, session, pin, pinname):
        Screen.__init__(self, session)
        # for the skin: first try ParentalControlChangePin, then Setup, this allows individual skinning
        self.skinName = ["ParentalControlChangePin", "Setup"]
        self.setup_title = _("Change pin code")
        self.onChangedEntry = []

        self.pin = pin
        self.list = []
        self.pin1 = ConfigPIN(default=1111, censor="*")
        self.pin2 = ConfigPIN(default=1112, censor="*")
        self.pin1.addEndNotifier(boundFunction(self.valueChanged, 1))
        self.pin2.addEndNotifier(boundFunction(self.valueChanged, 2))
        self.list.append(getConfigListEntry(_("New PIN"), NoSave(self.pin1)))
        self.list.append(getConfigListEntry(_("Reenter new PIN"), NoSave(self.pin2)))
        ConfigListScreen.__init__(self, self.list)
        # 		print "old pin:", pin
        # if pin.value != "aaaa":
        # self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList = [self.pin.value], title = _("please enter the old pin"), windowTitle = _("Change pin code")))
        ProtectedScreen.__init__(self)

        self["actions"] = NumberActionMap(
            ["DirectionActions", "ColorActions", "OkCancelActions"],
            {"cancel": self.cancel, "red": self.cancel, "save": self.keyOK},
            -1,
        )
        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("OK"))
        self.onLayoutFinish.append(self.layoutFinished)
Esempio n. 22
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["actions"] = ActionMap(["SetupActions", "MenuActions"],
		{
			"ok": self.keyGo,
			"save": self.keyGo,
			"cancel": self.keyCancel,
			"menu": self.doCloseRecursive,
		}, -2)

		self.session.postScanService = session.nav.getCurrentlyPlayingServiceOrGroup()

		self.list = []
		tlist = []

		known_networks = [ ]
		nims_to_scan = [ ]
		self.finished_cb = None

		for nim in nimmanager.nim_slots:
			# collect networks provided by this tuner

			need_scan = False
			networks = self.getNetworksForNim(nim)

			print "nim %d provides" % nim.slot, networks
			print "known:", known_networks

			# we only need to scan on the first tuner which provides a network.
			# this gives the first tuner for each network priority for scanning.
			for x in networks:
				if x not in known_networks:
					need_scan = True
					print x, "not in ", known_networks
					known_networks.append(x)

			# don't offer to scan nims if nothing is connected
			if not nimmanager.somethingConnected(nim.slot):
				need_scan = False

			if need_scan:
				nims_to_scan.append(nim)

		# we save the config elements to use them on keyGo
		self.nim_enable = [ ]

		if len(nims_to_scan):
			self.scan_clearallservices = ConfigSelection(default = "yes", choices = [("no", _("no")), ("yes", _("yes")), ("yes_hold_feeds", _("yes (keep feeds)"))])
			self.list.append(getConfigListEntry(_("Clear before scan"), self.scan_clearallservices))

			for nim in nims_to_scan:
				nimconfig = ConfigYesNo(default = True)
				nimconfig.nim_index = nim.slot
				self.nim_enable.append(nimconfig)
				self.list.append(getConfigListEntry(_("Scan ") + nim.slot_name + " (" + nim.friendly_type + ")", nimconfig))

		ConfigListScreen.__init__(self, self.list)
		self["header"] = Label(_("Automatic scan"))
		self["footer"] = Label(_("Press OK to scan"))
Esempio n. 23
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self["key_red"] = StaticText(_("Close"))
        self["key_yellow"] = StaticText(_("Delete"))
        self["key_blue"] = StaticText(_("OK"))
        self["text"] = Label(_(""))
        self["state"] = Label(_(""))
        self["step"] = Label(_(""))

        self["actions"] = NumberActionMap(["SetupActions"], {"cancel": self.keyCancel}, -2)
        self["ColorActions"] = HelpableActionMap(
            self,
            "ColorActions",
            {
                "red": (self.close, _("exit")),
                "yellow": (self.DeleteGo, _("password set to blank")),
                "blue": (self.ChangeGo, _("making new password for telnet and ftp")),
            },
        )

        self.hideDeleteButton = False
        if self.checkPassword("root", ""):
            self.hideDeleteButton = True

        self.list = []
        ConfigListScreen.__init__(self, self.list)
        self.pw = ConfigSubsection()
        self.login = 0
        self.createConfig()
        self.createSetup()
        self.timeout = 8
        self.reset = False
Esempio n. 24
0
    def __init__(self, session):
        Screen.__init__(self, session)
        Screen.setTitle(self, _("Plugin Browser"))

        self.firsttime = True

        self["red"] = Label(_("Remove plugins"))
        self["green"] = Label(_("Download plugins"))

        self.list = []
        self["list"] = PluginList(self.list)
        if config.usage.sort_pluginlist.getValue():
            self["list"].list.sort()

        self["actions"] = ActionMap(
            ["SetupActions", "WizardActions"], {"ok": self.save, "back": self.close, "menu": self.menu}
        )
        self["PluginDownloadActions"] = ActionMap(["ColorActions"], {"red": self.delete, "green": self.download})

        self.onFirstExecBegin.append(self.checkWarnings)
        self.onShown.append(self.updateList)
        self.onChangedEntry = []
        self["list"].onSelectionChanged.append(self.selectionChanged)
        self.onLayoutFinish.append(self.saveListsize)
        if config.pluginfilter.userfeed.getValue() != "http://":
            if not os.path.exists("/etc/opkg/user-feed.conf"):
                CreateFeedConfig()
Esempio n. 25
0
	def __init__(self, session, infobar=None):
		Screen.__init__(self, session)
        
		self["actions"] = ActionMap(["SetupActions"],
		{
			"ok": self.ok,
			"cancel": self.cancel,
		}, -2)

		self.list = []
		ConfigListScreen.__init__(self, self.list)
		if self.session.infobar is None:	
			if InfoBar.instance:
				self.infobar = InfoBar.instance
		else:
			self.infobar = self.session.infobar

		self.fillList()

		self.__event_tracker = ServiceEventTracker(screen=self, eventmap=
			{
				iPlayableService.evUpdatedInfo: self.__updatedInfo
			})
		self.cached_subtitle_checked = False
		self.__selected_subtitle = None
Esempio n. 26
0
	def __init__(self, session):
		Screen.__init__(self, session)
		HelpableScreen.__init__(self)

		self.edittext = _("Press OK to edit the settings.")

		self["key_red"] = StaticText(_("Close"))
		self["key_green"] = StaticText(_("Select"))
		self["key_yellow"] = StaticText("")
		self["key_blue"] = StaticText("")
		self["introduction"] = StaticText(self.edittext)

		self.devices = [(iInputDevices.getDeviceName(x),x) for x in iInputDevices.getDeviceList()]
		print "[InputDeviceSelection] found devices :->", len(self.devices),self.devices

		self["OkCancelActions"] = HelpableActionMap(self, "OkCancelActions",
			{
			"cancel": (self.close, _("Exit input device selection.")),
			"ok": (self.okbuttonClick, _("Select input device.")),
			}, -2)

		self["ColorActions"] = HelpableActionMap(self, "ColorActions",
			{
			"red": (self.close, _("Exit input device selection.")),
			"green": (self.okbuttonClick, _("Select input device.")),
			}, -2)

		self.currentIndex = 0
		self.list = []
		self["list"] = List(self.list)
		self.updateList()
		self.onLayoutFinish.append(self.layoutFinished)
		self.onClose.append(self.cleanup)
Esempio n. 27
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.session = session
        self.skinName = "Setup"
        Screen.setTitle(self, _("Plugin Filter..."))
        self["HelpWindow"] = Pixmap()
        self["HelpWindow"].hide()
        self["status"] = StaticText()
        self["labelExitsave"] = Label("[Exit] = " + _("Cancel") + "              [Ok] =" + _("Save"))

        self.onChangedEntry = []
        self.list = []
        ConfigListScreen.__init__(self, self.list, session=self.session, on_change=self.changedEntry)
        self.createSetup()

        self["actions"] = ActionMap(
            ["SetupActions", "ColorActions", "VirtualKeyboardActions"],
            {
                "ok": self.keySave,
                "cancel": self.keyCancel,
                "red": self.keyCancel,
                "green": self.keySave,
                "menu": self.keyCancel,
                "showVirtualKeyboard": self.KeyText,
            },
            -2,
        )

        self["key_red"] = StaticText(_("Cancel"))
        self["key_green"] = StaticText(_("OK"))
        if not self.selectionChanged in self["config"].onSelectionChanged:
            self["config"].onSelectionChanged.append(self.selectionChanged)
        self.selectionChanged()
Esempio n. 28
0
	def __init__(self, session, setup):
		Screen.__init__(self, session)
		# for the skin: first try a setup_<setupID>, then Setup
		self.skinName = ["setup_" + setup, "Setup" ]

		self.onChangedEntry = [ ]

		self.setup = setup
		list = []
		self.refill(list)

		#check for list.entries > 0 else self.close
		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))

		self["actions"] = NumberActionMap(["SetupActions"], 
			{
				"cancel": self.keyCancel,
				"save": self.keySave,
			}, -2)

		ConfigListScreen.__init__(self, list, session = session, on_change = self.changedEntry)

		self.changedEntry()
		self.onLayoutFinish.append(self.layoutFinished)
Esempio n. 29
0
	def __init__(self, session, device):
		Screen.__init__(self, session)
		self.inputDevice = device
		iInputDevices.currentDevice = self.inputDevice
		self.onChangedEntry = [ ]
		self.setup_title = _("Input device setup")
		self.isStepSlider = None
		self.enableEntry = None
		self.repeatEntry = None
		self.delayEntry = None
		self.nameEntry = None
		self.enableConfigEntry = None

		self.list = [ ]
		ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changedEntry)

		self["actions"] = ActionMap(["SetupActions", "MenuActions"],
			{
				"cancel": self.keyCancel,
				"save": self.apply,
				"menu": self.closeRecursive,
			}, -2)

		self["key_red"] = StaticText(_("Cancel"))
		self["key_green"] = StaticText(_("OK"))
		self["key_yellow"] = StaticText()
		self["key_blue"] = StaticText()
		self["introduction"] = StaticText()

		# for generating strings into .po only
		devicenames = [_("STB_BOX front panel"),_("STB_BOX front panel"),_("STB_BOX remote control (native)"),_("STB_BOX advanced remote control (native)"),_("STB_BOX ir keyboard"),_("STB_BOX ir mouse")]

		self.createSetup()
		self.onLayoutFinish.append(self.layoutFinished)
		self.onClose.append(self.cleanup)
Esempio n. 30
0
	def __init__(self, session, menu_path = ""):
		Screen.__init__(self, session)
		screentitle = _("Streaming clients info")
		menu_path += screentitle
		if config.usage.show_menupath.value == 'large':
			title = menu_path
			self["menu_path_compressed"] = StaticText("")
		elif config.usage.show_menupath.value == 'small':
			title = screentitle
			self["menu_path_compressed"] = StaticText(menu_path + " >" if not menu_path.endswith(' / ') else menu_path[:-3] + " >" or "")
		else:
			title = screentitle
			self["menu_path_compressed"] = StaticText("")
		Screen.setTitle(self, title)
		clients = ClientsStreaming("INFO_RESOLVE")
		text = clients.getText()

		self["ScrollLabel"] = ScrollLabel(text or _("No stream clients"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
		{
			"cancel": self.close,
			"ok": self.close,
			"up": self["ScrollLabel"].pageUp,
			"down": self["ScrollLabel"].pageDown
		})
Esempio n. 31
0
    def __init__(self, session, parent):
        Screen.__init__(self, session)
        list = []

        menuID = None
        for x in parent:  #walk through the actual nodelist
            if not x.tag:
                continue
            if x.tag == 'item':
                item_level = int(x.get("level", 0))
                if item_level <= config.usage.setup_level.index:
                    self.addItem(list, x)
                    count += 1
            elif x.tag == 'menu':
                self.addMenu(list, x)
                count += 1
            elif x.tag == "id":
                menuID = x.get("val")
                count = 0

            if menuID is not None:
                # menuupdater?
                if menuupdater.updatedMenuAvailable(menuID):
                    for x in menuupdater.getUpdatedMenu(menuID):
                        if x[1] == count:
                            list.append(
                                (x[0],
                                 boundFunction(self.runScreen,
                                               (x[2], x[3] + ", ")), x[4]))
                            count += 1

        if menuID is not None:
            # plugins
            for l in plugins.getPluginsForMenu(menuID):
                # check if a plugin overrides an existing menu
                plugin_menuid = l[2]
                for x in list:
                    if x[2] == plugin_menuid:
                        list.remove(x)
                        break
                list.append(
                    (l[0], boundFunction(l[1], self.session,
                                         close=self.close), l[2], l[3] or 50))

        # for the skin: first try a menu_<menuID>, then Menu
        self.skinName = []
        if menuID is not None:
            self.skinName.append("menu_" + menuID)
        self.skinName.append("Menu")
        self.menuID = menuID
        ProtectedScreen.__init__(self)

        # Sort by Weight
        list.sort(key=lambda x: int(x[3]))

        self["menu"] = List(list)

        self["actions"] = NumberActionMap(
            ["OkCancelActions", "MenuActions", "NumberActions"], {
                "ok": self.okbuttonClick,
                "cancel": self.closeNonRecursive,
                "menu": self.closeRecursive,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal
            })

        a = parent.get("title", "").encode("UTF-8") or None
        a = a and _(a)
        if a is None:
            a = _(parent.get("text", "").encode("UTF-8"))
        self["title"] = StaticText(a)
        self.menu_title = a
Esempio n. 32
0
    def __init__(self, session, infobar):
        Screen.__init__(self, session)
        self.infobar = infobar or self.session.infobar

        self.wait = eTimer()
        self.wait.timeout.get().append(self.resyncSubtitles)

        self.resume = eTimer()
        self.resume.timeout.get().append(self.resyncSubtitlesResume)

        self["videofps"] = Label("")

        sub = self.infobar.selected_subtitle
        if sub[0] == 0:  # dvb
            menu = [
                getConfigMenuItem("config.subtitles.dvb_subtitles_yellow"),
                getConfigMenuItem("config.subtitles.dvb_subtitles_centered"),
                getConfigMenuItem("config.subtitles.dvb_subtitles_backtrans"),
                getConfigMenuItem(
                    "config.subtitles.dvb_subtitles_original_position"),
                getConfigMenuItem("config.subtitles.subtitle_position"),
                getConfigMenuItem(
                    "config.subtitles.subtitle_bad_timing_delay"),
                getConfigMenuItem(
                    "config.subtitles.subtitle_noPTSrecordingdelay"),
            ]
        elif sub[0] == 1:  # teletext
            menu = [
                getConfigMenuItem("config.subtitles.ttx_subtitle_colors"),
                getConfigMenuItem(
                    "config.subtitles.ttx_subtitle_original_position"),
                getConfigMenuItem("config.subtitles.subtitle_fontsize"),
                getConfigMenuItem("config.subtitles.subtitle_position"),
                getConfigMenuItem("config.subtitles.subtitle_rewrap"),
                getConfigMenuItem("config.subtitles.subtitle_borderwidth"),
                getConfigMenuItem("config.subtitles.showbackground"),
                getConfigMenuItem("config.subtitles.subtitle_alignment"),
                getConfigMenuItem(
                    "config.subtitles.subtitle_bad_timing_delay"),
                getConfigMenuItem(
                    "config.subtitles.subtitle_noPTSrecordingdelay"),
            ]
        else:  # pango
            menu = [
                getConfigMenuItem("config.subtitles.pango_subtitles_delay"),
                getConfigMenuItem("config.subtitles.pango_subtitle_colors"),
                getConfigMenuItem(
                    "config.subtitles.pango_subtitle_fontswitch"),
                getConfigMenuItem("config.subtitles.colourise_dialogs"),
                getConfigMenuItem("config.subtitles.subtitle_fontsize"),
                getConfigMenuItem("config.subtitles.subtitle_position"),
                getConfigMenuItem("config.subtitles.subtitle_alignment"),
                getConfigMenuItem("config.subtitles.subtitle_rewrap"),
                getConfigMenuItem("config.subtitles.pango_subtitle_removehi"),
                getConfigMenuItem("config.subtitles.subtitle_borderwidth"),
                getConfigMenuItem("config.subtitles.showbackground"),
                getConfigMenuItem("config.subtitles.pango_subtitles_fps"),
            ]
            self["videofps"].setText(
                _("Video: %s fps") % (self.getFps().rstrip(".000")))

        ConfigListScreen.__init__(self,
                                  menu,
                                  self.session,
                                  on_change=self.changedEntry)

        self["actions"] = NumberActionMap(
            ["SetupActions"], {
                "cancel": self.cancel,
                "ok": self.ok,
                "1": self.keyNumber,
                "3": self.keyNumber,
                "4": self.keyNumber,
                "6": self.keyNumber,
                "7": self.keyNumber,
                "9": self.keyNumber,
                "0": self.keyNumber,
            }, -2)

        self.onLayoutFinish.append(self.layoutFinished)
Esempio n. 33
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_('About'))
        hddsplit = skin.parameters.get('AboutHddSplit', 0)
        AboutText = _('Model: %s %s') % (getMachineBrand(),
                                         getMachineName()) + '\n'
        AboutText += _('Image: ') + about.getImageTypeString() + '\n'
        AboutText += _(
            'Kernel version: ') + about.getKernelVersionString() + '\n'
        if path.exists('/proc/stb/info/chipset'):
            AboutText += _('Chipset: %s') % about.getChipSetString() + '\n'
        AboutText += _('CPU: %s') % about.getCPUString() + '\n'
        AboutText += _('Version: %s') % getImageVersion() + '\n'
        AboutText += _('Build: %s') % getImageBuild() + '\n'
        if path.exists('/proc/stb/info/release') and getBoxType() in (
                'et7000', 'et7500', 'et8500'):
            realdriverdate = open('/proc/stb/info/release', 'r')
            for line in realdriverdate:
                tmp = line.strip()
                AboutText += _('Drivers: %s') % tmp + '\n'

            realdriverdate.close()
        else:
            string = getDriverDate()
            year = string[0:4]
            month = string[4:6]
            day = string[6:8]
            driversdate = '-'.join((year, month, day))
            AboutText += _('Drivers: %s') % driversdate + '\n'
        EnigmaVersion = 'Enigma: ' + about.getEnigmaVersionString()
        self['EnigmaVersion'] = StaticText(EnigmaVersion)
        AboutText += EnigmaVersion + '\n'
        AboutText += _(
            'Enigma (re)starts: %d\n') % config.misc.startCounter.value
        GStreamerVersion = 'GStreamer: ' + about.getGStreamerVersionString(
        ).replace('GStreamer', '')
        self['GStreamerVersion'] = StaticText(GStreamerVersion)
        AboutText += GStreamerVersion + '\n'
        ImageVersion = _('Last upgrade: ') + about.getImageVersionString()
        self['ImageVersion'] = StaticText(ImageVersion)
        AboutText += ImageVersion + '\n'
        AboutText += _(
            'Python version: ') + about.getPythonVersionString() + '\n' + '\n'
        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ''
        else:
            fp_version = _('Frontprocessor version: %s') % fp_version
            AboutText += fp_version + '\n'
        self['FPVersion'] = StaticText(fp_version)
        skinWidth = getDesktop(0).size().width()
        skinHeight = getDesktop(0).size().height()
        AboutText += _('Skin Name: %s') % config.skin.primary_skin.value[
            0:-9] + _('  (%s x %s)') % (skinWidth, skinHeight) + '\n'
        if path.exists('/etc/enigma2/EtRcType'):
            rfp = open('/etc/enigma2/EtRcType', 'r')
            Remote = rfp.read()
            rfp.close
            AboutText += _('Remote control type') + _(': ') + Remote + '\n'
        else:
            AboutText += _('Remote control type') + _(
                ': ') + iRcTypeControl.getBoxType() + '\n'
        if path.exists('/proc/stb/ir/rc/type'):
            fp = open('/proc/stb/ir/rc/type', 'r')
            RcID = fp.read()
            fp.close
            AboutText += _('Remote control ID') + _(': ') + RcID
        self['TunerHeader'] = StaticText(_('Detected NIMs:'))
        AboutText += '\n' + _('Detected NIMs:') + '\n'
        nims = nimmanager.nimList(showFBCTuners=False)
        for count in range(len(nims)):
            if count < 4:
                self['Tuner' + str(count)] = StaticText(nims[count])
            else:
                self['Tuner' + str(count)] = StaticText('')
            AboutText += nims[count] + '\n'

        self['HDDHeader'] = StaticText(_('Detected HDD:'))
        AboutText += '\n' + _('Detected HDD:') + '\n'
        hddlist = harddiskmanager.HDDList()
        hddinfo = ''
        if hddlist:
            formatstring = hddsplit and '%s:%s, %.1f %sB %s' or '%s\n(%s, %.1f %sB %s)'
            for count in range(len(hddlist)):
                if hddinfo:
                    hddinfo += '\n'
                hdd = hddlist[count][1]
                if int(hdd.free()) > 1024:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free() / 1024.0, 'G',
                                               _('free'))
                else:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free(), 'M', _('free'))

        else:
            hddinfo = _('none')
        self['hddA'] = StaticText(hddinfo)
        AboutText += hddinfo + '\n\n' + _('Network Info:')
        for x in about.GetIPsFromNetworkInterfaces():
            AboutText += '\n' + x[0] + ': ' + x[1]

        self['AboutScrollLabel'] = ScrollLabel(AboutText)
        self['key_green'] = Button(_('Troubleshoot'))
        self['key_red'] = Button(_('Latest Commits'))
        self['key_yellow'] = Button(_('Memory Info'))
        self['key_blue'] = Button(_('%s ') % getMachineName() + _('picture'))
        self['actions'] = ActionMap(
            [
                'ColorActions', 'SetupActions', 'DirectionActions',
                'ChannelSelectEPGActions'
            ], {
                'cancel': self.close,
                'ok': self.close,
                'info': self.showTranslationInfo,
                'red': self.showCommits,
                'green': self.showTroubleshoot,
                'yellow': self.showMemoryInfo,
                'blue': self.showModelPic,
                'up': self['AboutScrollLabel'].pageUp,
                'down': self['AboutScrollLabel'].pageDown
            })
Esempio n. 34
0
	def __init__(self, session, text, type = TYPE_YESNO, timeout = -1, close_on_any_key = False, default = True, enable_input = True, msgBoxID = None, picon = None, simple = False, list = []):
		self.type = type
		Screen.__init__(self, session)

		if simple:
			self.skinName="MessageBoxSimple"
		
		self.msgBoxID = msgBoxID

		self["text"] = Label(text)
		self["Text"] = StaticText(text)
		self["selectedChoice"] = StaticText()

		self.text = text
		self.close_on_any_key = close_on_any_key

		self["ErrorPixmap"] = Pixmap()
		self["QuestionPixmap"] = Pixmap()
		self["InfoPixmap"] = Pixmap()
		self.timerRunning = False
		self.initTimeout(timeout)

		picon = picon or type
		if picon != self.TYPE_ERROR:
			self["ErrorPixmap"].hide()
		if picon != self.TYPE_YESNO:
			self["QuestionPixmap"].hide()
		if picon != self.TYPE_INFO:
			self["InfoPixmap"].hide()

		if type == self.TYPE_YESNO:
			if list:
				self.list = list
			elif default == True:
				self.list = [ (_("yes"), True), (_("no"), False) ]
			else:
				self.list = [ (_("no"), False), (_("yes"), True) ]
		else:
			self.list = []
		
		self["list"] = MenuList(self.list)
		if self.list:
			self["selectedChoice"].setText(self.list[0][0])
		else:
			self["list"].hide()

		if enable_input:
			self["actions"] = ActionMap(["MsgBoxActions", "DirectionActions"], 
				{
					"cancel": self.cancel,
					"ok": self.ok,
					"alwaysOK": self.alwaysOK,
					"up": self.up,
					"down": self.down,
					"left": self.left,
					"right": self.right,
					"upRepeated": self.up,
					"downRepeated": self.down,
					"leftRepeated": self.left,
					"rightRepeated": self.right
				}, -1)

		self.onLayoutFinish.append(self.layoutFinished)
Esempio n. 35
0
    def __init__(self, session, StandbyCounterIncrease=True):
        Screen.__init__(self, session)
        self.avswitch = AVSwitch()

        print "[Standby] enter standby"

        if os.path.exists("/usr/script/standby_enter.sh"):
            Console().ePopen("/usr/script/standby_enter.sh")

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        from Screens.InfoBar import InfoBar
        from Screens.SleepTimerEdit import isNextWakeupTime
        self.infoBarInstance = InfoBar.instance
        self.StandbyCounterIncrease = StandbyCounterIncrease
        self.standbyTimeoutTimer = eTimer()
        self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.standbyWakeupTimer = eTimer()
        self.standbyWakeupTimer.callback.append(self.standbyWakeup)
        self.timeHandler = None

        self.setMute()

        self.paused_service = self.paused_action = False

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        if Components.ParentalControl.parentalControl.isProtected(
                self.prev_running_service):
            self.prev_running_service = eServiceReference(
                config.tv.lastservice.value)
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.rsplit(":", 1)[1].startswith("/"):
                self.paused_service = hasattr(
                    self.session.current_dialog, "pauseService") and hasattr(
                        self.session.current_dialog, "unPauseService"
                    ) and self.session.current_dialog or self.infoBarInstance
                self.paused_action = hasattr(
                    self.paused_service, "seekstate"
                ) and hasattr(
                    self.paused_service, "SEEK_STATE_PLAY"
                ) and self.paused_service.seekstate == self.paused_service.SEEK_STATE_PLAY
                self.paused_action and self.paused_service.pauseService()
        if not self.paused_service:
            self.timeHandler = eDVBLocalTimeHandler.getInstance()
            if self.timeHandler.ready():
                if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.stopService()
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                self.timeHandler = None
            else:
                self.timeHandler.m_timeUpdated.get().append(self.stopService)

        if self.session.pipshown:
            self.infoBarInstance and hasattr(
                self.infoBarInstance,
                "showPiP") and self.infoBarInstance.showPiP()

        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")

        gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
        if gotoShutdownTime:
            self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

        gotoWakeupTime = isNextWakeupTime(True)
        if gotoWakeupTime != -1:
            curtime = localtime(time())
            if curtime.tm_year > 1970:
                wakeup_time = int(gotoWakeupTime - time())
                if wakeup_time > 0:
                    self.standbyWakeupTimer.startLongTimer(wakeup_time)

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
Esempio n. 36
0
bgColor = r,g,b = 0, 0, 0

window = pygame.display.set_mode(size)
pygame.mouse.set_visible(False)

players = pygame.sprite.Group()
screens = pygame.sprite.Group()
choices = pygame.sprite.Group()
all = pygame.sprite.OrderedUpdates()

Player.containers = (players, all)
Screen.containers = (screens, all)
Choice.containers = (choices, all)

screen = Screen("Room(1.5)", size)
player = Player(pygame.mouse.get_pos())

playersHitChoices = {}

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT: 
            sys.exit()
        elif event.type == pygame.MOUSEMOTION:
            player.move(event.pos)
        elif event.type == pygame.MOUSEBUTTONUP:
            player.unclick()
        elif event.type == pygame.MOUSEBUTTONDOWN:
            player.click()
Esempio n. 37
0
    def __init__(self, session, StandbyCounterIncrease=True):
        Screen.__init__(self, session)
        self.avswitch = AVSwitch()

        print "enter standby"

        self["actions"] = ActionMap(["StandbyActions"], {
            "power": self.Power,
            "discrete_on": self.Power
        }, -1)

        globalActionMap.setEnabled(False)

        from Screens.InfoBar import InfoBar
        self.infoBarInstance = InfoBar.instance
        self.StandbyCounterIncrease = StandbyCounterIncrease
        self.standbyTimeoutTimer = eTimer()
        self.standbyTimeoutTimer.callback.append(self.standbyTimeout)
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None

        #mute adc
        self.setMute()

        self.paused_service = None

        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.rsplit(":", 1)[1].startswith("/"):
                self.paused_service = True
                self.infoBarInstance.pauseService()
        if not self.paused_service:
            self.timeHandler = eDVBLocalTimeHandler.getInstance()
            if self.timeHandler.ready():
                if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                    self.stopService()
                else:
                    self.standbyStopServiceTimer.startLongTimer(5)
                self.timeHandler = None
            else:
                self.timeHandler.m_timeUpdated.get().append(self.stopService)

        if self.session.pipshown:
            self.infoBarInstance and hasattr(
                self.infoBarInstance,
                "showPiP") and self.infoBarInstance.showPiP()

        #set input to vcr scart
        if SystemInfo["ScartSwitch"]:
            self.avswitch.setInput("SCART")
        else:
            self.avswitch.setInput("AUX")

        if (getBrandOEM() in ('fulan')):
            open("/proc/stb/hdmi/output", "w").write("off")

        if int(
                config.usage.hdd_standby_in_standby.value
        ) != -1:  # HDD standby timer value (box in standby) / -1 = same as when box is active
            for hdd in harddiskmanager.HDDList():
                hdd[1].setIdleTime(
                    int(config.usage.hdd_standby_in_standby.value))

        gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value)
        if gotoShutdownTime:
            self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime)

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
Esempio n. 38
0
    def __init__(self, session, type=0, iface='eth0'):
        Screen.__init__(self, session)
        self.session = session
        self.type = type  # update type
        self.iface = iface

        self.drawProgressBarTimer = eTimer()
        self.drawProgressBarTimer.callback.append(self.drawProgressBar)

        self.checkEnvTimer = eTimer()
        self.checkEnvTimer.callback.append(self.checkEnv)

        self.progressSpin = ["%  /", "%  |", "%  -"]
        if self.iface == 'wlan0' or self.iface == 'ath0' or self.iface == 'ra0':
            lan = "Wireless"
        else:
            lan = "Integrated Ethernet"
        modelDir = open("/proc/stb/info/modelname").read().strip('\n')
        self.imageInfo = {
            self.INTERNET_UPDATE: {
                "title": "SW Update - " + lan,
                "imagedir": "K3_OE3/" + modelDir + "_REL"
            },
            self.INTERNET_SR_UPDATE: {
                "title": "SR SW Update - " + lan,
                "imagedir": "K3_OE3/" + modelDir + "SR_REL"
            },
            self.INTERNET_UPDATE_BETA: {
                "title": "SW Update (BETA) - " + lan,
                "imagedir": "K3_OE3/" + modelDir
            },
            self.INTERNET_SR_UPDATE_BETA: {
                "title": "SR SW Update (BETA) - " + lan,
                "imagedir": "K3_OE3/" + modelDir + "SR"
            }
        }
        self.setTitle(self.imageInfo[self.type]["title"])

        self.swList = []
        self["menulist"] = MenuList(self.swList)
        self["menulist"].hide()
        self["percent"] = Label(_(" "))
        self["run"] = Label(_(" "))
        self["prog"] = Label(_(" "))
        self["top"] = Label(_(" "))
        self["bottom"] = Label(_(" "))
        self["text"] = Label(_("Downloading list information. Please wait..."))

        self["actions"] = ActionMap(
            ["MinuteInputActions", "ColorActions"], {
                "cancel": self.cancel,
                "ok": self.ok,
                "up": self.up,
                "down": self.down,
            }, -1)

        self.requiredSize = -1
        self.serverAlive = False
        self.downloadingSW = False
        self.downloadedSW = {}

        def progressBar(configElement):
            num = int(configElement.value)
            if num > 0:
                self["run"].setText(_(self.progressSpin[num % 3]))
                self["prog"].setText("[" + "=" * (40 * num / 100) + "]")
                self["percent"].setText(_("%d" % num))
            else:
                self["run"].setText(_(" "))
                self["prog"].setText(_(" "))
                self["percent"].setText(_(" "))

        def progressAction(configElement):
            num = int(configElement.value)
            if num == -1:
                self.drawProgressBarTimer.stop()
                MiniFTP_Thread.getInstance().Stop_Thread()
                self.downloadingSW = False
                self.downloadedSW = {}
            elif num < 100:
                self.drawProgressBarTimer.start(1000, True)
            elif num == 100:
                self.drawProgressBarTimer.stop()
                MiniFTP_Thread.getInstance().Stop_Thread()
                self.downloadingSW = False

                if self.downloadedSWSizeOk():
                    #					self.downloadBurn()
                    self.session.openWithCallback(
                        self.downloadBurn, MessageBox,
                        _("Downloading Finished!!\nDo you really want to update \nthe file \"%s\"?"
                          ) % self["menulist"].getCurrent())
                else:
                    self.session.open(
                        MessageBox,
                        _("Failed while checking downloaded SW!\nTry again please."
                          ), MessageBox.TYPE_ERROR)
                    self.downloadCancel(True)

        config.progress = NoSave(ConfigSelectionNumber(-1, 100, 1, default=-1))
        config.progress.addNotifier(progressBar, False)
        config.progress.addNotifier(progressAction, False)

        self.checkEnvTimer.start(1000, True)
Esempio n. 39
0
from Player import Player
from Treasure import Treasure
from Projectile import Projectile
from Enemy import Enemy
from Platform import Platform
from Upgrades import Heart, JumpBoost

pygame.init()
score = 0
win_score = 10
fps = 60

# create game window and clock
screen_width = 1000
screen_height = 739
window = Screen(screen_width, screen_height)
window = window.create_screen()
clock = pygame.time.Clock()

# load in background and its properties
background = pygame.image.load("assets/background/background.jpg")
background_flipped = pygame.image.load("assets/background/background_flipped.jpg")
background_x1 = 0
background_x2 = background.get_width()
treasure_image = pygame.image.load("assets/misc/treasure.png")

# load in music and sound effects
pygame.mixer.music.load('assets/sound/theme.mp3')
treasure_sound = pygame.mixer.Sound('assets/sound/treasure.wav')
explosion_sound = pygame.mixer.Sound('assets/sound/explosion.wav')
fireball_sound = pygame.mixer.Sound('assets/sound/fireball.wav')
Esempio n. 40
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("About"))
        hddsplit = parameters.get("AboutHddSplit", 1)

        AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
        cpu = about.getCPUInfoString()
        AboutText += _("CPU: ") + cpu + "\n"
        AboutText += _("Image: ") + about.getImageTypeString(
        ) + "-" + getImageBuild() + "\n"
        AboutText += _("Build date: ") + about.getBuildDateString() + "\n"
        AboutText += _("Last update: ") + about.getUpdateDateString() + "\n"

        # [WanWizard] Removed until we find a reliable way to determine the installation date
        # AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

        EnigmaVersion = about.getEnigmaVersionString()
        EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
        if len(EnigmaVersion) == 3:
            EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[
                2] + "-" + EnigmaVersion[1] + ")"
        else:
            EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
        EnigmaVersion = _("Enigma version: ") + EnigmaVersion
        self["EnigmaVersion"] = StaticText(EnigmaVersion)
        AboutText += "\n" + EnigmaVersion + "\n"

        AboutText += _(
            "Kernel version: ") + about.getKernelVersionString() + "\n"

        AboutText += _(
            "DVB driver version: ") + about.getDriverInstalledDate() + "\n"

        GStreamerVersion = _("Media player: GStreamer, version "
                             ) + about.getGStreamerVersionString().replace(
                                 "GStreamer", "")
        self["GStreamerVersion"] = StaticText(GStreamerVersion)

        ffmpegVersion = _(
            "Media player: ffmpeg, version ") + about.getffmpegVersionString()
        self["ffmpegVersion"] = StaticText(ffmpegVersion)

        if cpu.upper().startswith('HI') or os.path.isdir('/proc/hisi'):
            AboutText += ffmpegVersion + "\n"
        else:
            AboutText += GStreamerVersion + "\n"

        AboutText += _(
            "Python version: ") + about.getPythonVersionString() + "\n"

        AboutText += _(
            "Enigma (re)starts: %d\n") % config.misc.startCounter.value
        AboutText += _("Uptime: %s\n") % about.getBoxUptime()
        AboutText += _("Enigma debug level: %d\n") % eGetEnigmaDebugLvl()

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %s") % fp_version
            AboutText += fp_version + "\n"

        self["FPVersion"] = StaticText(fp_version)

        AboutText += _('Skin & Resolution: %s (%sx%s)\n') % (
            config.skin.primary_skin.value.split('/')[0],
            getDesktop(0).size().width(), getDesktop(0).size().height())

        self["TunerHeader"] = StaticText(_("Detected NIMs:"))
        AboutText += "\n" + _("Detected NIMs:") + "\n"

        nims = nimmanager.nimListCompressed()
        for count in range(len(nims)):
            if count < 4:
                self["Tuner" + str(count)] = StaticText(nims[count])
            else:
                self["Tuner" + str(count)] = StaticText("")
            AboutText += nims[count] + "\n"

        self["HDDHeader"] = StaticText(_("Detected storage devices:"))
        AboutText += "\n" + _("Detected storage devices:") + "\n"

        hddlist = harddiskmanager.HDDList()
        hddinfo = ""
        if hddlist:
            formatstring = hddsplit and "%s:%s, %.1f %s %s" or "%s\n(%s, %.1f %s %s)"
            for count in range(len(hddlist)):
                if hddinfo:
                    hddinfo += "\n"
                hdd = hddlist[count][1]
                if int(hdd.free()) > 1024:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free() / 1024.0, _("GB"),
                                               _("free"))
                else:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free(), _("MB"), _("free"))
        else:
            hddinfo = _("none")
        self["hddA"] = StaticText(hddinfo)
        AboutText += hddinfo + "\n\n" + _("Network Info:")
        for x in about.GetIPsFromNetworkInterfaces():
            AboutText += "\n" + x[0] + ": " + x[1]
        if SystemInfo["HasHDMI-CEC"] and config.hdmicec.enabled.value:
            address = config.hdmicec.fixed_physical_address.value if config.hdmicec.fixed_physical_address.value != "0.0.0.0" else _(
                "not set")
            AboutText += "\n\n" + _("HDMI-CEC address") + ": " + address

        self["AboutScrollLabel"] = ScrollLabel(AboutText)
        self["key_green"] = Button(_("Translations"))
        self["key_red"] = Button(_("Latest Commits"))
        self["key_yellow"] = Button(_("Troubleshoot"))
        self["key_blue"] = Button(_("Memory Info"))

        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "red": self.showCommits,
                "green": self.showTranslationInfo,
                "blue": self.showMemoryInfo,
                "yellow": self.showTroubleshoot,
                "up": self["AboutScrollLabel"].pageUp,
                "down": self["AboutScrollLabel"].pageDown
            })
Esempio n. 41
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self["eventname"] = Label()
     self["state"] = Label()
     self["speed"] = Label()
     self["statusicon"] = MultiPixmap()
Esempio n. 42
0
 def __init__(self, session, parent):
     Screen.__init__(self, session, parent=parent)
     self["entry"] = StaticText("")
     self["desc"] = StaticText("")
     self.onShow.append(self.addWatcher)
     self.onHide.append(self.removeWatcher)
    def __init__(self, session, title="", **kwargs):
        Screen.__init__(self, session)
        self.setTitle(_("Virtual keyboard"))
        self.keys_list = []
        self.shiftkeys_list = []
        self.thirdkeys_list = []
        self.lang = language.getLanguage()
        self.nextLang = None
        self.shiftMode = 0
        self.selectedKey = 0
        self.smsChar = None
        self.sms = NumericalTextInput(self.smsOK)

        self.key_bg = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_bg.png"))
        self.key_sel = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_sel.png"))
        self.key_backspace = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_backspace.png"))
        self.key_all = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_all.png"))
        self.key_clr = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_clr.png"))
        self.key_esc = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_esc.png"))
        self.key_ok = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_ok.png"))
        self.key_shift = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_shift.png"))
        self.key_shift_sel = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_shift_sel.png"))
        self.key_space = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_space.png"))
        self.key_left = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_left.png"))
        self.key_right = LoadPixmap(path=resolveFilename(
            SCOPE_CURRENT_SKIN, "skin_default/vkey_right.png"))

        self.keyImages = {
            "BACKSPACE": self.key_backspace,
            "ALL": self.key_all,
            "EXIT": self.key_esc,
            "OK": self.key_ok,
            "SHIFT": self.key_shift,
            "SPACE": self.key_space,
            "LEFT": self.key_left,
            "RIGHT": self.key_right
        }
        self.keyImagesShift = {
            "BACKSPACE": self.key_backspace,
            "CLEAR": self.key_clr,
            "EXIT": self.key_esc,
            "OK": self.key_ok,
            "SHIFT": self.key_shift_sel,
            "SPACE": self.key_space,
            "LEFT": self.key_left,
            "RIGHT": self.key_right
        }
        self.keyImagesThird = {
            "BACKSPACE": self.key_backspace,
            "ALL": self.key_all,
            "CLEAR": self.key_clr,
            "EXIT": self.key_esc,
            "OK": self.key_ok,
            "SHIFT": self.key_shift_sel,
            "SPACE": self.key_space,
            "LEFT": self.key_left,
            "RIGHT": self.key_right
        }

        self["key_red"] = StaticText(_("Exit"))
        self["key_green"] = StaticText(_("OK"))
        self["key_yellow"] = StaticText("")
        self["country"] = StaticText("")
        self["header"] = Label(title)
        self["text"] = Input(currPos=len(
            kwargs.get("text", "").decode("utf-8", 'ignore')),
                             allMarked=False,
                             **kwargs)
        self["list"] = VirtualKeyBoardList([])

        self["actions"] = NumberActionMap(
            [
                "OkCancelActions", "WizardActions", "ColorActions",
                "KeyboardInputActions", "InputBoxActions", "InputAsciiActions"
            ], {
                "gotAsciiCode": self.keyGotAscii,
                "ok": self.okClicked,
                "cancel": self.exit,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
                "red": self.exit,
                "green": self.ok,
                "yellow": self.switchLang,
                "blue": self.shiftClicked,
                "deleteBackward": self.backClicked,
                "deleteForward": self.forwardClicked,
                "back": self.exit,
                "pageUp": self.cursorRight,
                "pageDown": self.cursorLeft,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal,
            }, -2)
        self.setLang()
        self.onExecBegin.append(self.setKeyboardModeAscii)
        self.onLayoutFinish.append(self.buildVirtualKeyBoard)
        self.onClose.append(self.__onClose)
Esempio n. 44
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("About"))
        hddsplit, = skin.parameters.get("AboutHddSplit", (0, ))

        AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
        AboutText += _("CPU: ") + about.getCPUInfoString() + "\n"
        AboutText += _("Image: ") + about.getImageTypeString() + "\n"
        AboutText += _("Installed: ") + about.getFlashDateString() + "\n"
        AboutText += _(
            "Kernel version: ") + about.getKernelVersionString() + "\n"

        EnigmaVersion = "Enigma: " + about.getEnigmaVersionString()
        self["EnigmaVersion"] = StaticText(EnigmaVersion)
        AboutText += EnigmaVersion + "\n"
        AboutText += _(
            "Enigma (re)starts: %d\n") % config.misc.startCounter.value

        GStreamerVersion = "GStreamer: " + about.getGStreamerVersionString(
        ).replace("GStreamer", "")
        self["GStreamerVersion"] = StaticText(GStreamerVersion)
        AboutText += GStreamerVersion + "\n"

        ImageVersion = _("Last upgrade: ") + about.getImageVersionString()
        self["ImageVersion"] = StaticText(ImageVersion)
        AboutText += ImageVersion + "\n"

        AboutText += _("DVB drivers: ") + about.getDriverInstalledDate() + "\n"

        AboutText += _(
            "Python version: ") + about.getPythonVersionString() + "\n"

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %d") % fp_version
            AboutText += fp_version + "\n"

        self["FPVersion"] = StaticText(fp_version)

        self["TunerHeader"] = StaticText(_("Detected NIMs:"))
        AboutText += "\n" + _("Detected NIMs:") + "\n"

        nims = nimmanager.nimList(showFBCTuners=False)
        for count in range(len(nims)):
            if count < 4:
                self["Tuner" + str(count)] = StaticText(nims[count])
            else:
                self["Tuner" + str(count)] = StaticText("")
            AboutText += nims[count] + "\n"

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        AboutText += "\n" + _("Detected HDD:") + "\n"

        hddlist = harddiskmanager.HDDList()
        hddinfo = ""
        if hddlist:
            formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)"
            for count in range(len(hddlist)):
                if hddinfo:
                    hddinfo += "\n"
                hdd = hddlist[count][1]
                if int(hdd.free()) > 1024:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free() / 1024.0, "G",
                                               _("free"))
                else:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free(), "M", _("free"))
        else:
            hddinfo = _("none")
        self["hddA"] = StaticText(hddinfo)
        AboutText += hddinfo
        self["AboutScrollLabel"] = ScrollLabel(AboutText)
        self["key_green"] = Button(_("Translations"))
        self["key_red"] = Button(_("Latest Commits"))
        self["key_blue"] = Button(_("Memory Info"))

        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "red": self.showCommits,
                "green": self.showTranslationInfo,
                "blue": self.showMemoryInfo,
                "up": self["AboutScrollLabel"].pageUp,
                "down": self["AboutScrollLabel"].pageDown
            })
Esempio n. 45
0
    def __init__(self, session, selectedmovie=None):
        Screen.__init__(self, session)
        HelpableScreen.__init__(self)

        self.tags = []
        if selectedmovie:
            self.selected_tags = config.movielist.last_selected_tags.value
        else:
            self.selected_tags = None
        self.selected_tags_ele = None

        self.movemode = False
        self.bouquet_mark_edit = False

        self.delayTimer = eTimer()
        self.delayTimer.callback.append(self.updateHDDData)

        self["waitingtext"] = Label(_("Please wait... Loading list..."))

        # create optional description border and hide immediately
        self["DescriptionBorder"] = Pixmap()
        self["DescriptionBorder"].hide()

        if not fileExists(config.movielist.last_videodir.value):
            self.getDefaultMoviePath()
        self.current_ref = eServiceReference(
            "2:0:1:0:0:0:0:0:0:0:" + config.movielist.last_videodir.value)

        self["list"] = MovieList(None, config.movielist.listtype.value,
                                 config.movielist.moviesort.value,
                                 config.movielist.description.value)

        self.list = self["list"]
        self.selectedmovie = selectedmovie

        # Need list for init
        SelectionEventInfo.__init__(self)

        self["key_red"] = Button(_("All"))
        self["key_green"] = Button("")
        self["key_yellow"] = Button("")
        self["key_blue"] = Button("")

        self["freeDiskSpace"] = self.diskinfo = DiskInfo(
            config.movielist.last_videodir.value, DiskInfo.FREE, update=False)

        if config.usage.setup_level.index >= 2:  # expert+
            self["InfobarActions"] = HelpableActionMap(
                self, "InfobarActions", {
                    "showMovies":
                    (self.doPathSelect, _("select the movie path")),
                })

        self["MovieSelectionActions"] = HelpableActionMap(
            self, "MovieSelectionActions", {
                "contextMenu": (self.doContext, _("menu")),
                "showEventInfo":
                (self.showEventInformation, _("show event details")),
            })

        self["ColorActions"] = HelpableActionMap(
            self, "ColorActions", {
                "red": (self.showAll, _("show all")),
                "green": (self.showTagsFirst, _("show first selected tag")),
                "yellow": (self.showTagsSecond, _("show second selected tag")),
                "blue": (self.showTagsSelect, _("show tag menu")),
            })

        self["OkCancelActions"] = HelpableActionMap(
            self, "OkCancelActions", {
                "cancel": (self.abort, _("exit movielist")),
                "ok": (self.movieSelected, _("select movie")),
            })

        self.onShown.append(self.go)
        self.onLayoutFinish.append(self.saveListsize)
        self.inited = False
Esempio n. 46
0
	def __init__(self, session, text, type=TYPE_YESNO, timeout=-1, close_on_any_key=False, default=True, enable_input=True, msgBoxID=None, picon=None, simple=False, list=[], timeout_default=None, title=None):
		self.type = type
		Screen.__init__(self, session)
		self.setScreenPathMode(None)
		if simple:
			self.skinName="MessageBoxSimple"

		self.msgBoxID = msgBoxID

		self["autoresize"] = Label("") #do not remove, used for autoResize()
		self["text"] = Label(text)
		self["Text"] = StaticText(text)
		self["selectedChoice"] = StaticText()

		self.text = text
		self.close_on_any_key = close_on_any_key
		self.timeout_default = timeout_default

		self["ErrorPixmap"] = Pixmap()
		self["QuestionPixmap"] = Pixmap()
		self["InfoPixmap"] = Pixmap()
		self["WarningPixmap"] = Pixmap()
		self.timerRunning = False
		self.initTimeout(timeout)

		picon = picon or type
		if picon != self.TYPE_ERROR:
			self["ErrorPixmap"].hide()
		if picon != self.TYPE_YESNO:
			self["QuestionPixmap"].hide()
		if picon != self.TYPE_INFO:
			self["InfoPixmap"].hide()
		if picon != self.TYPE_WARNING:
			self["WarningPixmap"].hide()
		self.title = title or self.type < self.TYPE_MESSAGE and [_("Question"), _("Information"), _("Warning"), _("Error")][self.type] or _("Message")
		if type == self.TYPE_YESNO:
			if list:
				self.list = list
			elif default:
				self.list = [ (_("yes"), True), (_("no"), False) ]
			else:
				self.list = [ (_("no"), False), (_("yes"), True) ]
		else:
			self.list = []

		self["list"] = MenuList(self.list)
		if self.list:
			self["selectedChoice"].setText(self.list[0][0])
		else:
			self["list"].hide()

		if enable_input:
			self["actions"] = ActionMap(["MsgBoxActions", "DirectionActions"],
				{
					"cancel": self.cancel,
					"ok": self.ok,
					"alwaysOK": self.alwaysOK,
					"up": self.up,
					"down": self.down,
					"left": self.left,
					"right": self.right,
					"upRepeated": self.up,
					"downRepeated": self.down,
					"leftRepeated": self.left,
					"rightRepeated": self.right
				}, -1)
		self.setTitle(self.title)
Esempio n. 47
0
	def __init__(self, session):
		Screen.__init__(self, session)
		hddsplit = skin.parameters.get("AboutHddSplit", 0)

		#AboutHddSplit = 0
		#try:
		#	hddsplit = skin.parameters.get("AboutHddSplit",(0))[0]
		#except:
		#	hddsplit = AboutHddSplit

		if boxtype == 'gb800solo':
			BoxName = "GigaBlue HD 800SOLO"
		elif boxtype == 'gb800se':
			BoxName = "GigaBlue HD 800SE"
		elif boxtype == 'gb800ue':
			BoxName = "GigaBlue HD 800UE"
		elif boxtype == 'gbquad':
			BoxName = "GigaBlue Quad"
		elif boxtype == 'gbquad4k':
			BoxName = "GigaBlue Quad 4k"
		elif boxtype == 'gbue4k':
			BoxName = "GigaBlue UE 4k"
		elif boxtype == 'gbquadplus':
			BoxName = "GigaBlue HD Quadplus"
		elif boxtype == 'gb800seplus':
			BoxName = "GigaBlue HD 800SEplus"
		elif boxtype == 'gb800ueplus':
			BoxName = "GigaBlue HD 800UEplus"
		elif boxtype == 'gbipbox':
			BoxName = "GigaBlue IP Box"
		elif boxtype == 'gbultra':
			BoxName = "GigaBlue HD Ultra"
		elif boxtype == 'gbultraue':
			BoxName = "GigaBlue HD Ultra UE"
		elif boxtype == 'gbultraueh':
			BoxName = "GigaBlue HD Ultra UEh"
		elif boxtype == 'gbultrase':
			BoxName = "GigaBlue HD Ultra SE"
		elif boxtype == 'gbx1':
			BoxName = "GigaBlue X1"
		elif boxtype == 'gbx2':
			BoxName = "GigaBlue X2"
		elif boxtype == 'gbx3':
			BoxName = "GigaBlue X3"
		elif boxtype == 'gbx3h':
			BoxName = "GigaBlue X3h"
		elif boxtype == 'spycat':
			BoxName = "XCORE Spycat"
		elif boxtype == 'quadbox2400':
			BoxName = "AX Quadbox HD2400"
		else:
			BoxName = about.getHardwareTypeString()

		self.setTitle(_("About") + " " + BoxName)

		ImageType = about.getImageTypeString()
		self["ImageType"] = StaticText(ImageType)

		Boxserial = popen('cat /proc/stb/info/sn').read().strip()
		serial = ""
		if Boxserial != "":
			serial = ":Serial : " + Boxserial

		AboutHeader = _("About") + " " + BoxName 
		self["AboutHeader"] = StaticText(AboutHeader)

		AboutText = BoxName + " - " + ImageType + serial + "\n"

		#AboutText += _("Hardware: ") + about.getHardwareTypeString() + "\n"
		#AboutText += _("CPU: ") + about.getCPUInfoString() + "\n"
		#AboutText += _("Installed: ") + about.getFlashDateString() + "\n"
		#AboutText += _("Image: ") + about.getImageTypeString() + "\n"

		CPUinfo = _("CPU: ") + about.getCPUInfoString()
		self["CPUinfo"] = StaticText(CPUinfo)
		AboutText += CPUinfo + "\n"

		CPUspeed = _("Speed: ") + about.getCPUSpeedString()
		self["CPUspeed"] = StaticText(CPUspeed)
		#AboutText += "(" + about.getCPUSpeedString() + ")\n"

		ChipsetInfo = _("Chipset: ") + about.getChipSetString()
		self["ChipsetInfo"] = StaticText(ChipsetInfo)
		AboutText += ChipsetInfo + "\n"

		AboutText += _("Enigma (re)starts: %d\n") % config.misc.startCounter.value

		fp_version = getFPVersion()
		if fp_version is None:
			fp_version = ""
		else:
			fp_version = _("Frontprocessor version: %s") % fp_version
			#AboutText += fp_version +"\n"
		self["FPVersion"] = StaticText(fp_version) 

		AboutText += "\n"

		KernelVersion = _("Kernel version: ") + about.getKernelVersionString()
		self["KernelVersion"] = StaticText(KernelVersion)
		AboutText += KernelVersion + "\n"

		if getMachineBuild() == 'gb7252':
			b = popen('cat /proc/stb/info/version').read().strip()
			driverdate=str(b[0:4] + '-' + b[4:6] + '-' + b[6:8] + ' ' + b[8:10]  + ':' + b[10:12] + ':' + b[12:14])
			AboutText += _("DVB drivers: ") + driverdate + "\n"
		else:
			AboutText += _("DVB drivers: ") + self.realDriverDate() + "\n"
			#AboutText += _("DVB drivers: ") + about.getDriverInstalledDate() + "\n"

		ImageVersion = _("Last upgrade: ") + about.getImageVersionString()
		self["ImageVersion"] = StaticText(ImageVersion)
		AboutText += ImageVersion + "\n"

		EnigmaVersion = _("GUI Build: ") + about.getEnigmaVersionString() + "\n"
		self["EnigmaVersion"] = StaticText(EnigmaVersion)
		#AboutText += EnigmaVersion

		#AboutText += _("Enigma (re)starts: %d\n") % config.misc.startCounter.value

		FlashDate = _("Flashed: ") + about.getFlashDateString()
		self["FlashDate"] = StaticText(FlashDate)
		AboutText += FlashDate + "\n"

		EnigmaSkin = _("Skin: ") + config.skin.primary_skin.value[0:-9]
		self["EnigmaSkin"] = StaticText(EnigmaSkin)
		AboutText += EnigmaSkin + "\n"

		AboutText += _("Python version: ") + about.getPythonVersionString() + "\n"

		GStreamerVersion = _("GStreamer: ") + about.getGStreamerVersionString().replace("GStreamer","")
		self["GStreamerVersion"] = StaticText(GStreamerVersion)
		AboutText += GStreamerVersion + "\n"

		twisted = popen('opkg list-installed  |grep -i python-twisted-core').read().strip().split(' - ')[1]
		AboutText += "Python-Twisted: " + str(twisted) + "\n"

		AboutText += "\n"
		self["TunerHeader"] = StaticText(_("Detected NIMs:"))
		#AboutText += _("Detected NIMs:") + "\n"

		nims = nimmanager.nimList()
		for count in range(len(nims)):
			if count < 4:
				self["Tuner" + str(count)] = StaticText(nims[count])
			else:
				self["Tuner" + str(count)] = StaticText("")
			AboutText += nims[count] + "\n"

		self["HDDHeader"] = StaticText(_("Detected HDD:"))

		AboutText += "\n"
		#AboutText +=  _("Detected HDD:") + "\n"
		hddlist = harddiskmanager.HDDList()
		hddinfo = ""
		if hddlist:
			formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s:(%s, %.1f %sB %s)"
			for count in range(len(hddlist)):
				if hddinfo:
					hddinfo += "\n"
				hdd = hddlist[count][1]
				if int(hdd.free()) > 1024:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free()/1024.0, "G", _("free"))
				else:
					hddinfo += formatstring % (hdd.model(), hdd.capacity(), hdd.free(), "M", _("free"))
		else:
			hddinfo = _("none")
		self["hddA"] = StaticText(hddinfo)
		AboutText += hddinfo 
		
		#AboutText += "\n\n" + _("Network Info") 
		#for x in about.GetIPsFromNetworkInterfaces():
		#	AboutText += "\n" + iNetwork.getFriendlyAdapterDescription(x[0]) + " :" + "/dev/" + x[0] + " " + x[1]

		self["AboutScrollLabel"] = ScrollLabel(AboutText)
		self["key_green"] = Button(_("Translations"))
		self["key_red"] = Button(_("Latest Commits"))
		self["key_yellow"] = Button(_("Troubleshoot"))
		self["key_blue"] = Button(_("Memory Info"))
		self["key_info"] = StaticText(_("Contact Info"))
		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"red": self.showCommits,
				"green": self.showTranslationInfo,
				"blue": self.showMemoryInfo,
				"info": self.showContactInfo,
				"yellow": self.showTroubleshoot,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
Esempio n. 48
0
    def __init__(self,
                 session,
                 job,
                 parent=None,
                 cancelable=True,
                 backgroundable=True,
                 afterEventChangeable=True):
        Screen.__init__(self, session, parent)
        InfoBarNotifications.__init__(self)
        ConfigListScreen.__init__(self, [])
        self.parent = parent
        self.job = job
        self.setTitle(_("Job overview"))

        self["job_name"] = StaticText(job.name)
        self["job_progress"] = Progress()
        self["job_task"] = StaticText()
        self["summary_job_name"] = StaticText(job.name)
        self["summary_job_progress"] = Progress()
        self["summary_job_task"] = StaticText()
        self["job_status"] = StaticText()

        self.cancelable = cancelable
        self.backgroundable = backgroundable

        self["key_green"] = StaticText("")

        if self.cancelable:
            self["key_red"] = StaticText(_("Cancel"))
        else:
            self["key_red"] = StaticText("")

        if self.backgroundable:
            self["key_blue"] = StaticText(_("Background"))
        else:
            self["key_blue"] = StaticText("")

        self.onShow.append(self.windowShow)
        self.onHide.append(self.windowHide)

        self["setupActions"] = ActionMap(
            ["ColorActions", "SetupActions"], {
                "green": self.ok,
                "red": self.abort,
                "blue": self.background,
                "cancel": self.abort,
                "ok": self.ok,
            }, -2)

        self.settings = ConfigSubsection()
        if SystemInfo["DeepstandbySupport"]:
            shutdownString = _("go to deep standby")
        else:
            shutdownString = _("shut down")
        self.settings.afterEvent = ConfigSelection(choices=[
            ("nothing", _("do nothing")), ("close", _("Close")),
            ("standby", _("go to standby")), ("deepstandby", shutdownString)
        ],
                                                   default=self.job.afterEvent
                                                   or "nothing")
        self.job.afterEvent = self.settings.afterEvent.getValue()
        self.afterEventChangeable = afterEventChangeable
        self.setupList()
        self.state_changed()
Esempio n. 49
0
	def __init__(self, session, tlist, menuTitle):
		Screen.__init__(self, session)
		self.skinName = 'Animmain'
		self.tlist = tlist
		ipage = 1
		list = []
		nopic = len(tlist)
		self.pos = []
		self.index = 0
		title = menuTitle
		self['title'] = Button(title)
		list = []
		tlist = []
		self['label1'] = StaticText()
		self['label2'] = StaticText()
		self['label3'] = StaticText()
		self['label4'] = StaticText()
		self['label5'] = StaticText()
		self['red'] = Button(_('Exit'))
		self['green'] = Button(_('Select'))
		self['yellow'] = Button(_('Config'))
		self['actions'] = NumberActionMap(['OkCancelActions',
		 'MenuActions',
		 'DirectionActions',
		 'NumberActions',
		 'ColorActions'], {'ok': self.okbuttonClick,
		 'cancel': self.closeNonRecursive,
		 'left': self.key_left,
		 'right': self.key_right,
		 'up': self.key_up,
		 'down': self.key_down,
		 'red': self.cancel,
		 'green': self.okbuttonClick,
		 'yellow': self.key_menu,
		 'menu': self.closeRecursive,
		 '1': self.keyNumberGlobal,
		 '2': self.keyNumberGlobal,
		 '3': self.keyNumberGlobal,
		 '4': self.keyNumberGlobal,
		 '5': self.keyNumberGlobal,
		 '6': self.keyNumberGlobal,
		 '7': self.keyNumberGlobal,
		 '8': self.keyNumberGlobal,
		 '9': self.keyNumberGlobal})
		nop = len(self.tlist)
		self.nop = nop
		nh = 1
		if nop == 1:
			nh = 1
		elif nop == 2:
			nh = 2
		elif nop == 3:
			nh = 2
		elif nop == 4:
			nh = 3
		elif nop == 5:
			nh = 3
		else:
			nh = int(float(nop) / 2)
		self.index = nh
		i = 0
		self.onShown.append(self.openTest)
Esempio n. 50
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self["actions"] = ActionMap(["SetupActions"],{"cancel": self.close,"ok": self.close})
		self.setTitle(_("Contact info"))
		self["manufacturerinfo"] = StaticText(self.getManufacturerinfo())
Esempio n. 51
0
def main():
    score1 = 0
    score2 = 0
    start_time = time.time()

    bus = smbus.SMBus(1)
    
    ## Graphics class
    screen = Screen(constants.WIDTH, constants.HEIGHT)

    player1 = Paddle(screen, 3, constants.HEIGHT/2-1, constants.BLACK)
    player2 = Paddle(screen, constants.WIDTH-4, constants.HEIGHT/2-1, constants.BLACK)

    net = Net(screen, constants.BLACK)

    ball = Ball(screen, 5, 20, constants.BALL_COLOUR)

    # Dummy values
    ball.velocity = [10.0,10.0] #Roughly 10 seconds to cross screen?
    ball._served = True

    while (True):
        end_time = time.time()
        frame_time = end_time - start_time
        start_time = end_time

        bus.write_byte( I2CADDR, 0x10 )
	tmp1 = bus.read_word_data( I2CADDR, 0x00 )
	tmp1 = ((tmp1 & 0xff00) >> 8) | ((tmp1 & 0x00ff) << 8)
	tmp1 = tmp1 & 0x0fff
	value1 = tmp1>>2

	bus.write_byte( I2CADDR, 0x80 )
	tmp2 = bus.read_word_data( I2CADDR, 0x00 )
	tmp2 = ((tmp2 & 0xff00) >> 8) | ((tmp2 & 0x00ff) << 8)
	tmp2 = tmp2 & 0x0fff
	value2 = tmp2>>2

	if (ball.x >= screen.width):
                score1 += 1
	if (ball.x <= 0):
                score2 += 1
	if (score1 > 9):
		score1 = 0
	if (score2 > 9):
		score2 = 0

	
	player1.move(value1)
	player2.move(value2)

        player1.update(frame_time)
        player2.update(frame_time)

        if (int(round(ball.x)) == int(round(player1.x))+1):
            if (int(round(ball.y)) >= int(round(player1.y)) and int(round(ball.y)) <= int(round(player1.y)) + 2):
                ball.velocity[0] *= -1

        if (int(round(ball.x)) == int(round(player2.x))-1):
            if (int(round(ball.y)) >= int(round(player2.y)) and int(round(ball.y)) <= int(round(player2.y)) + 2):
                ball.velocity[0] *= -1
        ball.update(frame_time)
    
        player1.draw()
        player2.draw()
        ball.draw()
	'''
        net.draw()
	
        screen.draw_num(constants.SCORE1[0], constants.SCORE1[1], score1, constants.SCORE_COLOUR)
        screen.draw_num(constants.SCORE2[0], constants.SCORE2[1], score2, constants.SCORE_COLOUR)
	'''

	time.sleep(0.01)
Esempio n. 52
0
	def __init__(self, session, tlist, menuTitle):
		Screen.__init__(self, session)
		self.skinName = 'Iconmain'
		self.tlist = tlist
		ipage = 1
		list = []
		nopic = len(self.tlist)
		self.pos = []
		self.ipage = 1
		self.index = 0
		title = menuTitle
		self['title'] = Button(title)
		self.icons = []
		self.indx = []
		n1 = len(tlist)
		self.picnum = n1
		list = []
		tlist = []
		self['label1'] = StaticText()
		self['label2'] = StaticText()
		self['label3'] = StaticText()
		self['label4'] = StaticText()
		self['label5'] = StaticText()
		self['label6'] = StaticText()
		self['label1s'] = StaticText()
		self['label2s'] = StaticText()
		self['label3s'] = StaticText()
		self['label4s'] = StaticText()
		self['label5s'] = StaticText()
		self['label6s'] = StaticText()
		self['pointer'] = Pixmap()
		self['pixmap1'] = Pixmap()
		self['pixmap2'] = Pixmap()
		self['pixmap3'] = Pixmap()
		self['pixmap4'] = Pixmap()
		self['pixmap5'] = Pixmap()
		self['pixmap6'] = Pixmap()
		self['red'] = Button(_('Exit'))
		self['green'] = Button(_('Select'))
		self['yellow'] = Button(_('Config'))
		self['actions'] = NumberActionMap(['OkCancelActions',
		 'MenuActions',
		 'DirectionActions',
		 'NumberActions',
		 'ColorActions'], {'ok': self.okbuttonClick,
		 'cancel': self.closeNonRecursive,
		 'left': self.key_left,
		 'right': self.key_right,
		 'up': self.key_up,
		 'down': self.key_down,
		 'red': self.cancel,
		 'green': self.okbuttonClick,
		 'yellow': self.key_menu,
		 'menu': self.closeRecursive,
		 '1': self.keyNumberGlobal,
		 '2': self.keyNumberGlobal,
		 '3': self.keyNumberGlobal,
		 '4': self.keyNumberGlobal,
		 '5': self.keyNumberGlobal,
		 '6': self.keyNumberGlobal,
		 '7': self.keyNumberGlobal,
		 '8': self.keyNumberGlobal,
		 '9': self.keyNumberGlobal})
		self.index = 0
		i = 0
		self.maxentry = 29
		self.istart = 0
		i = 0
		self.onShown.append(self.openTest)
Esempio n. 53
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.setTitle(_("About"))
        hddsplit = skin.parameters.get("AboutHddSplit", 0)

        procmodel = getBoxProc()

        AboutText = _("Hardware: ") + about.getHardwareTypeString() + "\n"
        if procmodel != about.getHardwareTypeString():
            AboutText += _("Proc model: ") + procmodel + "\n"
        if fileExists("/proc/stb/info/sn"):
            hwserial = open("/proc/stb/info/sn", "r").read().strip()
            AboutText += _("Hardware serial: ") + hwserial + "\n"

        AboutText += _("Brand: ") + about.getHardwareBrand() + "\n"

        cpu = about.getCPUInfoString()
        AboutText += _("CPU: ") + cpu + "\n"
        AboutText += _("CPU brand: ") + about.getCPUBrand() + "\n"
        AboutText += _("CPU architecture: ") + about.getCPUArch() + "\n"
        if boxbranding.getImageFPU() != "":
            AboutText += _("FPU: ") + boxbranding.getImageFPU() + "\n"
        AboutText += _(
            "Image architecture: ") + boxbranding.getImageArch() + "\n"

        if boxbranding.getImageArch() == "aarch64":
            if boxbranding.getHaveMultiLib() == "True":
                AboutText += _("MultiLib: ") + _("Yes") + "\n"
            else:
                AboutText += _("MultiLib: ") + _("No") + "\n"

        AboutText += _("Flash type: ") + about.getFlashType() + "\n"

        AboutText += "\n" + _("Image: ") + about.getImageTypeString() + "\n"
        AboutText += _("Feed URL: ") + boxbranding.getFeedsUrl() + "\n"

        AboutText += _(
            "Open Vision version: ") + about.getVisionVersion() + "\n"
        AboutText += _(
            "Open Vision revision: ") + about.getVisionRevision() + "\n"
        AboutText += _("Open Vision module: ") + about.getVisionModule() + "\n"

        AboutText += _("Build date: ") + about.getBuildDateString() + "\n"
        AboutText += _("Last update: ") + about.getUpdateDateString() + "\n"

        # [WanWizard] Removed until we find a reliable way to determine the installation date
        # AboutText += _("Installed: ") + about.getFlashDateString() + "\n"

        EnigmaVersion = about.getEnigmaVersionString()
        EnigmaVersion = EnigmaVersion.rsplit("-", EnigmaVersion.count("-") - 2)
        if len(EnigmaVersion) == 3:
            EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[
                2] + "-" + EnigmaVersion[1] + ")"
        else:
            EnigmaVersion = EnigmaVersion[0] + " (" + EnigmaVersion[1] + ")"
        EnigmaVersion = _("Enigma version: ") + EnigmaVersion
        self["EnigmaVersion"] = StaticText(EnigmaVersion)
        AboutText += "\n" + EnigmaVersion + "\n"
        AboutText += _(
            "Enigma (re)starts: %d\n") % config.misc.startCounter.value
        AboutText += _("Enigma debug level: %d\n") % eGetEnigmaDebugLvl()

        AboutText += "\n" + _(
            "Kernel version: ") + about.getKernelVersionString() + "\n"

        AboutText += _(
            "DVB driver version: ") + about.getDriverInstalledDate() + "\n"
        AboutText += _("DVB API: ") + about.getDVBAPI() + "\n"
        if fileExists("/usr/bin/dvb-fe-tool"):
            import time
            try:
                cmd = 'dvb-fe-tool > /tmp/dvbfetool.txt'
                res = Console().ePopen(cmd)
                time.sleep(0.1)
            except:
                pass
        if fileExists("/tmp/dvbfetool.txt"):
            if fileHas("/tmp/dvbfetool.txt", "DVBC") or fileHas(
                    "/tmp/dvbfetool.txt", "DVB-C"):
                AboutText += _("DVB-C: ") + _("Yes") + "\n"
            else:
                AboutText += _("DVB-C: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "DVBS") or fileHas(
                    "/tmp/dvbfetool.txt", "DVB-S"):
                AboutText += _("DVB-S: ") + _("Yes") + "\n"
            else:
                AboutText += _("DVB-S: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "DVBT") or fileHas(
                    "/tmp/dvbfetool.txt", "DVB-T"):
                AboutText += _("DVB-T: ") + _("Yes") + "\n"
            else:
                AboutText += _("DVB-T: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "MULTISTREAM"):
                AboutText += _("Multistream: ") + _("Yes") + "\n"
            else:
                AboutText += _("Multistream: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "ANNEX_A") or fileHas(
                    "/tmp/dvbfetool.txt", "ANNEX-A"):
                AboutText += _("ANNEX-A: ") + _("Yes") + "\n"
            else:
                AboutText += _("ANNEX-A: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "ANNEX_B") or fileHas(
                    "/tmp/dvbfetool.txt", "ANNEX-B"):
                AboutText += _("ANNEX-B: ") + _("Yes") + "\n"
            else:
                AboutText += _("ANNEX-B: ") + _("No") + "\n"
            if fileHas("/tmp/dvbfetool.txt", "ANNEX_C") or fileHas(
                    "/tmp/dvbfetool.txt", "ANNEX-C"):
                AboutText += _("ANNEX-C: ") + _("Yes") + "\n"
            else:
                AboutText += _("ANNEX-C: ") + _("No") + "\n"

        GStreamerVersion = _("GStreamer version: "
                             ) + about.getGStreamerVersionString(cpu).replace(
                                 "GStreamer", "")
        self["GStreamerVersion"] = StaticText(GStreamerVersion)
        AboutText += "\n" + GStreamerVersion + "\n"

        FFmpegVersion = _("FFmpeg version: ") + about.getFFmpegVersionString()
        self["FFmpegVersion"] = StaticText(FFmpegVersion)
        AboutText += FFmpegVersion + "\n"

        AboutText += _(
            "Python version: ") + about.getPythonVersionString() + "\n"

        fp_version = getFPVersion()
        if fp_version is None:
            fp_version = ""
        else:
            fp_version = _("Frontprocessor version: %s") % fp_version
            AboutText += fp_version + "\n"

        self["FPVersion"] = StaticText(fp_version)

        if boxbranding.getHaveTranscoding() != "":
            AboutText += _("Transcoding: ") + _("Yes") + "\n"
        else:
            AboutText += _("Transcoding: ") + _("No") + "\n"

        if boxbranding.getHaveMultiTranscoding() != "":
            AboutText += _("MultiTranscoding: ") + _("Yes") + "\n"
        else:
            AboutText += _("MultiTranscoding: ") + _("No") + "\n"

        AboutText += _('Skin & Resolution: %s (%sx%s)\n') % (
            config.skin.primary_skin.value.split('/')[0],
            getDesktop(0).size().width(), getDesktop(0).size().height())

        self["TunerHeader"] = StaticText(_("Detected NIMs:"))
        AboutText += "\n" + _("Detected NIMs:") + "\n"

        nims = nimmanager.nimListCompressed()
        for count in range(len(nims)):
            if count < 4:
                self["Tuner" + str(count)] = StaticText(nims[count])
            else:
                self["Tuner" + str(count)] = StaticText("")
            AboutText += nims[count] + "\n"

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        AboutText += "\n" + _("Detected HDD:") + "\n"

        hddlist = harddiskmanager.HDDList()
        hddinfo = ""
        if hddlist:
            formatstring = hddsplit and "%s:%s, %.1f %sB %s" or "%s\n(%s, %.1f %sB %s)"
            for count in range(len(hddlist)):
                if hddinfo:
                    hddinfo += "\n"
                hdd = hddlist[count][1]
                if int(hdd.free()) > 1024:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free() / 1024.0, "G",
                                               _("free"))
                else:
                    hddinfo += formatstring % (hdd.model(), hdd.capacity(),
                                               hdd.free(), "M", _("free"))
        else:
            hddinfo = _("none")
        self["hddA"] = StaticText(hddinfo)
        AboutText += hddinfo + "\n\n" + _("Network Info:")
        for x in about.GetIPsFromNetworkInterfaces():
            AboutText += "\n" + x[0] + ": " + x[1]

        self["AboutScrollLabel"] = ScrollLabel(AboutText)
        self["key_green"] = Button(_("Translations"))
        self["key_red"] = Button(_("Latest Commits"))
        self["key_yellow"] = Button(_("Troubleshoot"))
        self["key_blue"] = Button(_("Memory Info"))

        self["actions"] = ActionMap(
            ["ColorActions", "SetupActions", "DirectionActions"], {
                "cancel": self.close,
                "ok": self.close,
                "red": self.showCommits,
                "green": self.showTranslationInfo,
                "blue": self.showMemoryInfo,
                "yellow": self.showTroubleshoot,
                "up": self["AboutScrollLabel"].pageUp,
                "down": self["AboutScrollLabel"].pageDown
            })
Esempio n. 54
0
	def __init__(self, session, parent):
		self.parentmenu = parent
		Screen.__init__(self, session)
		self["key_blue"] = StaticText("")
		self["menu"] = List([])
		self["menu"].enableWrapAround = True
		self.showNumericHelp = False
		self.createMenuList()

		# for the skin: first try a menu_<menuID>, then Menu
		self.skinName = [ ]
		if self.menuID is not None:
			if config.usage.menutype.value == 'horzanim' and skin.domScreens.has_key("Animmain"):
				self.skinName.append('Animmain')
			elif config.usage.menutype.value == 'horzicon' and skin.domScreens.has_key("Iconmain"):
				self.skinName.append('Iconmain')
			else:
				self.skinName.append('menu_' + self.menuID)
		self.skinName.append("Menu")
		ProtectedScreen.__init__(self)
		self["actions"] = NumberActionMap(["OkCancelActions", "MenuActions", "NumberActions", "HelpActions", "ColorActions"],
			{
				"ok": self.okbuttonClick,
				"cancel": self.closeNonRecursive,
				"menu": self.closeRecursive,
				"0": self.keyNumberGlobal,
				"1": self.keyNumberGlobal,
				"2": self.keyNumberGlobal,
				"3": self.keyNumberGlobal,
				"4": self.keyNumberGlobal,
				"5": self.keyNumberGlobal,
				"6": self.keyNumberGlobal,
				"7": self.keyNumberGlobal,
				"8": self.keyNumberGlobal,
				"9": self.keyNumberGlobal,
				"displayHelp": self.showHelp,
				"blue": self.keyBlue,
			})
		title = parent.get("title", "").encode("UTF-8") or None
		title = title and _(title) or _(parent.get("text", "").encode("UTF-8"))
		title = self.__class__.__name__ == "MenuSort" and _("Menusort (%s)") % title or title
		if title is None:
			title = _(parent.get('text', '').encode('UTF-8'))
		else:
			t_history.reset()
		self["title"] = StaticText(title)
		self.setScreenPathMode(True)
		self.setTitle(title)
		self.menu_title = title
		self['thistory'] = StaticText(t_history.thistory)
		history_len = len(t_history.thistory)
		self['title0'] = StaticText('')
		self['title1'] = StaticText('')
		self['title2'] = StaticText('')
		if history_len < 13:
			self['title0'] = StaticText(title)
		elif history_len < 21:
			self['title0'] = StaticText('')
			self['title1'] = StaticText(title)
		else:
			self['title0'] = StaticText('')
			self['title1'] = StaticText('')
			self['title2'] = StaticText(title)
		if t_history.thistory == '':
			t_history.thistory = str(title) + ' > '
		else:
			t_history.thistory = t_history.thistory + str(title) + ' > '
		if config.usage.menutype.value == 'horzanim' and skin.domScreens.has_key("Animmain"):
			self['label1'] = StaticText()
			self['label2'] = StaticText()
			self['label3'] = StaticText()
			self['label4'] = StaticText()
			self['label5'] = StaticText()
			self.onShown.append(self.openTestA)
		elif config.usage.menutype.value == 'horzicon' and skin.domScreens.has_key("Iconmain"):
			self['label1'] = StaticText()
			self['label2'] = StaticText()
			self['label3'] = StaticText()
			self['label4'] = StaticText()
			self['label5'] = StaticText()
			self['label6'] = StaticText()
			self['label1s'] = StaticText()
			self['label2s'] = StaticText()
			self['label3s'] = StaticText()
			self['label4s'] = StaticText()
			self['label5s'] = StaticText()
			self['label6s'] = StaticText()
			self['pointer'] = Pixmap()
			self['pixmap1'] = Pixmap()
			self['pixmap2'] = Pixmap()
			self['pixmap3'] = Pixmap()
			self['pixmap4'] = Pixmap()
			self['pixmap5'] = Pixmap()
			self['pixmap6'] = Pixmap()
			self.onShown.append(self.openTestB)

		self.number = 0
		self.nextNumberTimer = eTimer()
		self.nextNumberTimer.callback.append(self.okbuttonClick)
		if len(self.list) == 1:
			self.onExecBegin.append(self.__onExecBegin)
Esempio n. 55
0
File: dy.py Progetto: elona2011/dy
class Task():
    def __init__(self, id):
        self.screen = Screen(id)
        self.android = self.screen.AndroidBase
        self.width = self.android.width

    def chat(self):
        self.screen.clickTalking()
        self.screen.sendChinese('求关注,必回关!求关注,必回关!求关注,必回关!')
        self.screen.clickTalkingSend()

    def checkNoFollow(self):
        rr = self.screen.findYiGuanZu()
        if rr:
            self.screen.click(200)
            rr = self.screen.findSiXing()
            if rr:
                self.screen.click()
                self.screen.clickTalking()
                self.screen.sendChinese('宝宝,我关注你了,你也要关注我一下哦')
                self.screen.clickSiXingSend()
                self.android.ClickReturn()

    def followHost(self):
        self.screen.followHost()

    def followFans(self):
        self.screen.clickFanNum()
        m = round(uniform(1.0, 4.0), 1)
        time.sleep(m)
        self.screen.followFan()
        self.screen.followFan()
        self.screen.followFan()
        self.screen.followFan()
        self.screen.followFan()
        self.android.ClickReturn()
        m = round(uniform(3.0, 10.0), 1)
        time.sleep(m)
        self.android.RollingUpLittle()

    def screenShot(self):
        self.android.PullScreenShot()

    def doubleClick(self):
        self.android.OneClick(200, 800)
        self.android.OneClick(200, 800)
Esempio n. 56
0
 def __init__(self, session, parent):
     Screen.__init__(self, session, parent=parent)
     self['selected'] = StaticText('ItalySat:' + getImageVersion())
     AboutText = getAboutText()[1]
     self['AboutText'] = StaticText(AboutText)
Esempio n. 57
0
    def __init__(self,
                 session,
                 showSteps=True,
                 showStepSlider=True,
                 showList=True,
                 showConfig=True):
        Screen.__init__(self, session)

        self.isLastWizard = False  # can be used to skip a "goodbye"-screen in a wizard

        self.stepHistory = []

        self.wizard = {}
        parser = make_parser()
        if not isinstance(self.xmlfile, list):
            self.xmlfile = [self.xmlfile]
        print "Reading ", self.xmlfile
        wizardHandler = self.parseWizard(self.wizard)
        parser.setContentHandler(wizardHandler)
        for xmlfile in self.xmlfile:
            if xmlfile[0] != '/':
                parser.parse(eEnv.resolve('${datadir}/enigma2/') + xmlfile)
            else:
                parser.parse(xmlfile)

        self.showSteps = showSteps
        self.showStepSlider = showStepSlider
        self.showList = showList
        self.showConfig = showConfig

        self.numSteps = len(self.wizard)
        self.currStep = self.getStepWithID("start") + 1

        self.timeoutTimer = eTimer()
        self.timeoutTimer.callback.append(self.timeoutCounterFired)

        self["text"] = Label()

        if showConfig:
            self["config"] = ConfigList([], session=session)

        if self.showSteps:
            self["step"] = Label()

        if self.showStepSlider:
            self["stepslider"] = Slider(1, self.numSteps)

        if self.showList:
            self.list = []
            self["list"] = List(self.list, enableWrapAround=True)
            self["list"].onSelectionChanged.append(self.selChanged)
            #self["list"] = MenuList(self.list, enableWrapAround = True)

        self.onShown.append(self.updateValues)

        self.configInstance = None
        self.currentConfigIndex = None

        Wizard.instance = self

        self.lcdCallbacks = []

        self.disableKeys = False

        self["actions"] = NumberActionMap(
            [
                "WizardActions", "NumberActions", "ColorActions",
                "SetupActions", "InputAsciiActions", "KeyboardInputActions"
            ], {
                "gotAsciiCode": self.keyGotAscii,
                "ok": self.ok,
                "back": self.back,
                "left": self.left,
                "right": self.right,
                "up": self.up,
                "down": self.down,
                "red": self.red,
                "green": self.green,
                "yellow": self.yellow,
                "blue": self.blue,
                "deleteBackward": self.deleteBackward,
                "deleteForward": self.deleteForward,
                "1": self.keyNumberGlobal,
                "2": self.keyNumberGlobal,
                "3": self.keyNumberGlobal,
                "4": self.keyNumberGlobal,
                "5": self.keyNumberGlobal,
                "6": self.keyNumberGlobal,
                "7": self.keyNumberGlobal,
                "8": self.keyNumberGlobal,
                "9": self.keyNumberGlobal,
                "0": self.keyNumberGlobal
            }, -1)

        self["VirtualKB"] = NumberActionMap(
            ["VirtualKeyboardActions"], {
                "showVirtualKeyboard": self.KeyText,
            }, -2)

        self["VirtualKB"].setEnabled(False)
Esempio n. 58
0
File: dy.py Progetto: elona2011/dy
 def __init__(self, id):
     self.screen = Screen(id)
     self.android = self.screen.AndroidBase
     self.width = self.android.width
Esempio n. 59
0
 def __init__(self, session, parent):
     Screen.__init__(self, session, parent)
     self["text"] = StaticText("")
     self.onShow.append(self.setCallback)
 def __init__(self, session, Event, Ref, callback=None, similarEPGCB=None):
     Screen.__init__(self, session)
     self.skinName = "EventView"
     EventViewBase.__init__(self, Event, Ref, callback, similarEPGCB)