diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2008-12-08 16:08:50 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2008-12-08 16:08:50 +0100 |
| commit | 6df771b5f7e744c650b73f8548ab41152c0185eb (patch) | |
| tree | 2c6ba8d941652209b355b868f91e1bdd339e172f /lib/python | |
| parent | 5b37109a8002420247a5abf46841c95365e88036 (diff) | |
| parent | f1b8049d3735b3f6544e84817e9c7d3bca474d5e (diff) | |
| download | enigma2-6df771b5f7e744c650b73f8548ab41152c0185eb.tar.gz enigma2-6df771b5f7e744c650b73f8548ab41152c0185eb.zip | |
Merge branch 'master' into dvd_scale_test
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Components/Task.py | 14 | ||||
| -rwxr-xr-x | lib/python/Components/config.py | 25 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py | 2 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/MediaPlayer/plugin.py | 10 | ||||
| -rw-r--r-- | lib/python/Plugins/Extensions/MediaPlayer/settings.py | 22 | ||||
| -rw-r--r-- | lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py | 14 | ||||
| -rw-r--r-- | lib/python/Tools/NumericalTextInput.py | 59 |
7 files changed, 81 insertions, 65 deletions
diff --git a/lib/python/Components/Task.py b/lib/python/Components/Task.py index 9a768425..04e5c938 100644 --- a/lib/python/Components/Task.py +++ b/lib/python/Components/Task.py @@ -127,6 +127,7 @@ class Task(object): self.cmd = None self.cwd = "/tmp" self.args = [ ] + self.cmdline = None self.task_progress_changed = None self.output_line = "" job.addTask(self) @@ -141,6 +142,9 @@ class Task(object): self.global_preconditions.append(ToolExistsPrecondition()) self.postconditions.append(ReturncodePostcondition()) + def setCmdline(self, cmdline): + self.cmdline = cmdline + def checkPreconditions(self, immediate = False): not_met = [ ] if immediate: @@ -166,13 +170,15 @@ class Task(object): self.container.stdoutAvail.append(self.processStdout) self.container.stderrAvail.append(self.processStderr) - assert self.cmd is not None - assert len(self.args) >= 1 - if self.cwd is not None: self.container.setCWD(self.cwd) - print "execute:", self.container.execute(self.cmd, *self.args), self.cmd, self.args + if not self.cmd and self.cmdline: + print "execute:", self.container.execute(self.cmdline), self.cmdline + else: + assert self.cmd is not None + assert len(self.args) >= 1 + print "execute:", self.container.execute(self.cmd, *self.args), ' '.join(self.args) if self.initial_input: self.writeInput(self.initial_input) diff --git a/lib/python/Components/config.py b/lib/python/Components/config.py index d79337ba..cfa4318c 100755 --- a/lib/python/Components/config.py +++ b/lib/python/Components/config.py @@ -926,6 +926,31 @@ class ConfigNumber(ConfigText): self.marked_pos = 0 self.offset = 0 +class ConfigSearchText(ConfigText): + def __init__(self, default = "", fixed_size = False, visible_width = False): + ConfigText.__init__(self, default = default, fixed_size = fixed_size, visible_width = visible_width) + NumericalTextInput.__init__(self, nextFunc = self.nextFunc, handleTimeout = False, search = True) + +class ConfigDirectory(ConfigText): + def __init__(self, default="", visible_width=60): + ConfigText.__init__(self, default, fixed_size = True, visible_width = visible_width) + def handleKey(self, key): + pass + def getValue(self): + if self.text == "": + return None + else: + return ConfigText.getValue(self) + def setValue(self, val): + if val == None: + val = "" + ConfigText.setValue(self, val) + def getMulti(self, selected): + if self.text == "": + return ("mtext"[1-selected:], _("List of Storage Devices"), range(0)) + else: + return ConfigText.getMulti(self, selected) + # a slider. class ConfigSlider(ConfigElement): def __init__(self, default = 0, increment = 1, limits = (0, 100)): diff --git a/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py b/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py index 85d81706..7407263d 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py +++ b/lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py @@ -104,7 +104,7 @@ class ProjectSettings(Screen,ConfigListScreen): self["key_yellow"] = StaticText(_("Load")) self["key_blue"] = StaticText(_("Save")) - infotext = _("Available format variables") + ":\n$i=" + _("Track") + ", $t=" + _("Title") + ", $d=" + _("Description") + ", $l=" + _("length") + ", $c=" + _("chapters") + ",\n" + _("Record") + " $T=" + _("Begin time") + ", $Y=" + _("year") + ", $M=" + _("month") + ", $D=" + _("day") + ",\n$A=" + _("audio tracks") + ", $C=" + _("Channel") + ", $f=" + _("filename") + infotext = _("Available format variables") + ":\n$i=" + _("Track") + ", $t=" + _("Title") + ", $d=" + _("Description") + ", $l=" + _("length") + ", $c=" + _("chapters") + ",\n" + _("Record") + " $T=" + _("Begin time") + ", $Y=" + _("Year") + ", $M=" + _("month") + ", $D=" + _("day") + ",\n$A=" + _("audio tracks") + ", $C=" + _("Channel") + ", $f=" + _("filename") self["info"] = StaticText(infotext) self.settings = project.settings diff --git a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py index 9ab23e5f..485dfe32 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/plugin.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/plugin.py @@ -123,15 +123,15 @@ class MediaPlayer(Screen, InfoBarBase, InfoBarSeek, InfoBarAudioSelection, InfoB self["currenttext"] = Label("") - self["artisttext"] = Label(_("Artist:")) + self["artisttext"] = Label(_("Artist")+':') self["artist"] = Label("") - self["titletext"] = Label(_("Title:")) + self["titletext"] = Label(_("Title")+':') self["title"] = Label("") - self["albumtext"] = Label(_("Album:")) + self["albumtext"] = Label(_("Album")+':') self["album"] = Label("") - self["yeartext"] = Label(_("Year:")) + self["yeartext"] = Label(_("Year")+':') self["year"] = Label("") - self["genretext"] = Label(_("Genre:")) + self["genretext"] = Label(_("Genre")+':') self["genre"] = Label("") self["coverArt"] = MediaPixmap() self["repeat"] = MultiPixmap() diff --git a/lib/python/Plugins/Extensions/MediaPlayer/settings.py b/lib/python/Plugins/Extensions/MediaPlayer/settings.py index c6d274bd..416ab2ee 100644 --- a/lib/python/Plugins/Extensions/MediaPlayer/settings.py +++ b/lib/python/Plugins/Extensions/MediaPlayer/settings.py @@ -3,30 +3,10 @@ from Screens.HelpMenu import HelpableScreen from Components.Label import Label from Components.FileList import FileList from Components.MediaPlayer import PlayList -from Components.config import config, getConfigListEntry, ConfigSubsection, configfile, ConfigText, ConfigYesNo +from Components.config import config, getConfigListEntry, ConfigSubsection, configfile, ConfigText, ConfigYesNo, ConfigDirectory from Components.ConfigList import ConfigListScreen from Components.ActionMap import ActionMap -class ConfigDirectory(ConfigText): - def __init__(self, default="", visible_width=60): - ConfigText.__init__(self, default, fixed_size = True, visible_width = visible_width) - def handleKey(self, key): - pass - def getValue(self): - if self.text == "": - return None - else: - return ConfigText.getValue(self) - def setValue(self, val): - if val == None: - val = "" - ConfigText.setValue(self, val) - def getMulti(self, selected): - if self.text == "": - return ("mtext"[1-selected:], _("List of Storage Devices"), range(0)) - else: - return ConfigText.getMulti(self, selected) - config.mediaplayer = ConfigSubsection() config.mediaplayer.repeat = ConfigYesNo(default=False) config.mediaplayer.savePlaylistOnExit = ConfigYesNo(default=True) diff --git a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py index d67a97cb..c8aa2718 100644 --- a/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py +++ b/lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py @@ -28,16 +28,13 @@ class PositionerSetup(Screen): <widget name="blue" position="420,155" size="140,80" backgroundColor="blue" halign="center" valign="center" font="Regular;21" /> <widget name="snr" text="SNR:" position="0,245" size="60,22" font="Regular;21" /> - <widget name="agc" text="AGC:" position="0,270" size="60,22" font="Regular;21" /> - <widget name="ber" text="BER:" position="0,295" size="60,22" font="Regular;21" /> + <widget name="ber" text="BER:" position="0,270" size="60,22" font="Regular;21" /> <widget name="lock" text="Lock:" position="0,320" size="60,22" font="Regular;21" /> <widget name="snr_percentage" position="220,245" size="60,22" font="Regular;21" /> - <widget name="agc_percentage" position="220,270" size="60,22" font="Regular;21" /> - <widget name="ber_value" position="220,295" size="60,22" font="Regular;21" /> + <widget name="ber_value" position="220,270" size="60,22" font="Regular;21" /> <widget name="lock_state" position="60,320" size="150,22" font="Regular;21" /> <widget name="snr_bar" position="60,245" size="150,22" /> - <widget name="agc_bar" position="60,270" size="150,22" /> - <widget name="ber_bar" position="60,295" size="150,22" /> + <widget name="ber_bar" position="60,270" size="150,22" /> <widget name="frequency" text="Frequency:" position="300,245" size="120,22" font="Regular;21" /> <widget name="symbolrate" text="Symbolrate:" position="300,270" size="120,22" font="Regular;21" /> @@ -87,14 +84,11 @@ class PositionerSetup(Screen): self.createSetup() self["snr"] = Label() - self["agc"] = Label() self["ber"] = Label() self["lock"] = Label() self["snr_percentage"] = TunerInfo(TunerInfo.SNR_PERCENTAGE, statusDict = self.frontendStatus) - self["agc_percentage"] = TunerInfo(TunerInfo.AGC_PERCENTAGE, statusDict = self.frontendStatus) self["ber_value"] = TunerInfo(TunerInfo.BER_VALUE, statusDict = self.frontendStatus) self["snr_bar"] = TunerInfo(TunerInfo.SNR_BAR, statusDict = self.frontendStatus) - self["agc_bar"] = TunerInfo(TunerInfo.AGC_BAR, statusDict = self.frontendStatus) self["ber_bar"] = TunerInfo(TunerInfo.BER_BAR, statusDict = self.frontendStatus) self["lock_state"] = TunerInfo(TunerInfo.LOCK_STATE, statusDict = self.frontendStatus) @@ -330,10 +324,8 @@ class PositionerSetup(Screen): if self.frontend: self.frontend.getFrontendStatus(self.frontendStatus) self["snr_percentage"].update() - self["agc_percentage"].update() self["ber_value"].update() self["snr_bar"].update() - self["agc_bar"].update() self["ber_bar"].update() self["lock_state"].update() transponderdata = self.tuner.getTransponderData() diff --git a/lib/python/Tools/NumericalTextInput.py b/lib/python/Tools/NumericalTextInput.py index 5954c9c3..c5576405 100644 --- a/lib/python/Tools/NumericalTextInput.py +++ b/lib/python/Tools/NumericalTextInput.py @@ -1,44 +1,65 @@ -# -*- coding: iso-8859-1 -*- +# -*- coding: utf-8 -*- from enigma import eTimer from Components.Language import language class NumericalTextInput: - def __init__(self, nextFunc=None, handleTimeout = True): + def __init__(self, nextFunc=None, handleTimeout = True, search = False): self.mapping = [] self.lang = language.getLanguage() self.useableChars=None self.nextFunction=nextFunc - + + if handleTimeout: + self.timer = eTimer() + self.timer.callback.append(self.timeout) + else: + self.timer = None + self.lastKey = -1 + self.pos = -1 + + if search: + self.mapping.append (u"%_0") # 0 + self.mapping.append (u" 1") # 1 + self.mapping.append (u"abc2") # 2 + self.mapping.append (u"def3") # 3 + self.mapping.append (u"ghi4") # 4 + self.mapping.append (u"jkl5") # 5 + self.mapping.append (u"mno6") # 6 + self.mapping.append (u"pqrs7") # 7 + self.mapping.append (u"tuv8") # 8 + self.mapping.append (u"wxyz9") # 9 + return + if self.lang == 'de_DE': self.mapping.append (u".,?'+\"0-()@/:_$!") # 0 self.mapping.append (u" 1") # 1 - self.mapping.append (u"abc2ABC") # 2 + self.mapping.append (u"aäbc2AÄBC") # 2 self.mapping.append (u"def3DEF") # 3 self.mapping.append (u"ghi4GHI") # 4 self.mapping.append (u"jkl5JKL") # 5 - self.mapping.append (u"mno6MNO") # 6 - self.mapping.append (u"pqrs7PQRS") # 7 - self.mapping.append (u"tuv8TUV") # 8 + self.mapping.append (u"mnoö6MNOÖ") # 6 + self.mapping.append (u"pqrsß7PQRSß") # 7 + self.mapping.append (u"tuüv8TUÜV") # 8 self.mapping.append (u"wxyz9WXYZ") # 9 elif self.lang == 'es_ES': self.mapping.append (u".,?'+\"0-()@/:_$!") # 0 self.mapping.append (u" 1") # 1 - self.mapping.append (u"abc2ABC") # 2 - self.mapping.append (u"def3DEF") # 3 - self.mapping.append (u"ghi4GHI") # 4 + self.mapping.append (u"abcáà2ABCÁÀ") # 2 + self.mapping.append (u"deéèf3DEFÉÈ") # 3 + self.mapping.append (u"ghiíì4GHIÍÌ") # 4 self.mapping.append (u"jkl5JKL") # 5 - self.mapping.append (u"mno6MNO") # 6 + self.mapping.append (u"mnñoóò6MNÑOÓÒ") # 6 self.mapping.append (u"pqrs7PQRS") # 7 - self.mapping.append (u"tuv8TUV") # 8 + self.mapping.append (u"tuvúù8TUVÚÙ") # 8 self.mapping.append (u"wxyz9WXYZ") # 9 if self.lang in ['sv_SE', 'fi_FI']: self.mapping.append (u".,?'+\"0-()@/:_$!") # 0 self.mapping.append (u" 1") # 1 - self.mapping.append (u"abc2ABC") # 2 - self.mapping.append (u"def3DEF") # 3 + self.mapping.append (u"abcåä2ABCÅÄ") # 2 + self.mapping.append (u"defé3DEFÉ") # 3 self.mapping.append (u"ghi4GHI") # 4 self.mapping.append (u"jkl5JKL") # 5 - self.mapping.append (u"mno6MNO") # 6 + self.mapping.append (u"mnoö6MNOÖ") # 6 self.mapping.append (u"pqrs7PQRS") # 7 self.mapping.append (u"tuv8TUV") # 8 self.mapping.append (u"wxyz9WXYZ") # 9 @@ -54,14 +75,6 @@ class NumericalTextInput: self.mapping.append (u"tuv8TUV") # 8 self.mapping.append (u"wxyz9WXYZ") # 9 - if handleTimeout: - self.timer = eTimer() - self.timer.callback.append(self.timeout) - else: - self.timer = None - self.lastKey = -1 - self.pos = -1 - def setUseableChars(self, useable): self.useableChars = useable |
