Permalink
Browse files

Merge remote-tracking branch 'e2/master'

  • Loading branch information...
2 parents 21d1d5f + f558b0f commit b5e0fa0f0888d87d2981fa8ca97d2dcadde369a4 @andyblac andyblac committed May 8, 2013
View
2 Makefile.am
@@ -1,6 +1,7 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = \
+ advhdmi \
aihdcontroler \
antiscrollbar \
aspectratioswitch \
@@ -34,7 +35,6 @@ SUBDIRS = \
ftpbrowser \
googlemaps \
growlee \
- httpproxy \
imdb \
infobartunerstate \
internetradio \
View
2 advhdmi/CONTROL/control
@@ -0,0 +1,2 @@
+Description: Configure when HDMI-Cec is enabled
+Depends: enigma2, enigma2-plugin-systemplugins-hdmicec
View
1 advhdmi/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = src po meta
View
3 advhdmi/meta/Makefile.am
@@ -0,0 +1,3 @@
+installdir = $(datadir)/meta/
+
+dist_install_DATA = plugin_advhdmi.xml
View
16 advhdmi/meta/plugin_advhdmi.xml
@@ -0,0 +1,16 @@
+<default>
+ <prerequisites>
+ <tag type="System" />
+ </prerequisites>
+ <info>
+ <author>joe128</author>
+ <name>AdvancedHDMICec</name>
+ <packagename>enigma2-plugin-systemplugins-advhdmi</packagename>
+ <shortdescription>Configure when HDMI-Cec is enabled</shortdescription>
+ <description>Several setting options when HDMI-Cec is active</description>
+ </info>
+
+ <files type="package"> <!-- without version, without .ipk -->
+ <file type="package" name="enigma2-plugin-systemplugins-advhdmi" />
+ </files>
+</default>
View
4 advhdmi/po/Makefile.am
@@ -0,0 +1,4 @@
+PLUGIN = AdvHdmi
+CATEGORY = SystemPlugins
+LANGS = de
+include $(top_srcdir)/Rules-po.mak
View
174 advhdmi/po/de.po
@@ -0,0 +1,174 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: AdvancedHDMICec 1.0\n"
+"POT-Creation-Date: 2013-04-24 02:35+Westeuropäische Sommerzeit\n"
+"PO-Revision-Date: 2013-04-24 03:09+0100\n"
+"Last-Translator: Joe128 <johnny.u@gmx.at>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.5\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
+"X-Poedit-Basepath: .\\\"AdvHdmi\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+
+#: plugin.py:41 plugin.py:50
+msgid "Monday"
+msgstr "Montag"
+
+#: plugin.py:42 plugin.py:51
+msgid "Tuesday"
+msgstr "Dienstag"
+
+#: plugin.py:43 plugin.py:52
+msgid "Wednesday"
+msgstr "Mittwoch"
+
+#: plugin.py:44 plugin.py:53
+msgid "Thursday"
+msgstr "Donnerstag"
+
+#: plugin.py:45 plugin.py:54
+msgid "Friday"
+msgstr "Freitag"
+
+#: plugin.py:46 plugin.py:55
+msgid "Saturday"
+msgstr "Samstag"
+
+#: plugin.py:47 plugin.py:56
+msgid "Sunday"
+msgstr "Sonntag"
+
+#: plugin.py:64
+msgid "systemmenue"
+msgstr "Systemmenü"
+
+#: plugin.py:65
+msgid "pluginmenue"
+msgstr "Pluginmenü"
+
+#: plugin.py:66
+msgid "extensions"
+msgstr "Erweiterungsmenü"
+
+#: plugin.py:83
+msgid "Advanced HDMI-Cec Setup"
+msgstr "Erweiterte HDMI-Cec Einstellungen"
+
+#: plugin.py:89
+msgid "Cancel"
+msgstr "Abbrechen"
+
+#: plugin.py:90
+msgid "Save"
+msgstr "Speichern"
+
+#: plugin.py:123
+msgid ""
+"Partially disabel HDMI-Cec?\n"
+"It can be prevented only the signals that are sent from the Dreambox. "
+"Signals received by the Dreambox will not be prevented."
+msgstr ""
+"Soll HDMI-Cec teilweise abgedreht werden?\n"
+"Es werden nur die Signale die von der Dreambox gesendet werden unterbunden. "
+"Signale die die Dreambox erhält werden nicht unterbunden."
+
+#: plugin.py:123
+msgid "partially disabel HdmiCec"
+msgstr "HdmiCec teilweise deaktivieren"
+
+#: plugin.py:125
+msgid "Should HDMI-Cec be disabled when GUI service startup?"
+msgstr ""
+"Soll HDMI-Cec deaktiviert werden, wenn die Befehle vom Webinterface gesendet "
+"werden?"
+
+#: plugin.py:125
+msgid "disable at GUI-start"
+msgstr "deaktivieren bei GUI-Start"
+
+#: plugin.py:126
+msgid ""
+"Should HDMI-Cec be disabled when the commands are sent from the web "
+"interface?"
+msgstr ""
+"Soll HDMI-Cec deaktiviert werden, wenn die Befehle vom Webinterface gesendet "
+"werden?"
+
+#: plugin.py:126
+msgid "disable from webinterface"
+msgstr "deaktivieren von Webinterface"
+
+#: plugin.py:127
+msgid "Should HDMI-Cec be disabled at certain times?"
+msgstr "Soll HDMI-Cec zu gewissen Zeiten deaktiviert werden?"
+
+#: plugin.py:127
+msgid "disable chronologically"
+msgstr "zeitlich deaktivieren"
+
+#: plugin.py:129
+msgid "From which day of the week, HDMI-Cec should be disabled?"
+msgstr "Von welchem Wochentag an, soll HDMI-Cec deaktiviert werden?"
+
+#: plugin.py:129
+msgid "from weekday"
+msgstr "von Wochentag"
+
+#: plugin.py:130
+msgid "To what day of the week, HDMI-Cec should be disabled?"
+msgstr "Bis zu welchem Wochentag, soll HDMI-Cec deaktiviert werden?"
+
+#: plugin.py:130
+msgid "to weekday"
+msgstr "bis Wochentag"
+
+#: plugin.py:131
+msgid "At which time, HDMI-Cec should be disabled?"
+msgstr "Ab welcher Uhrzeit, soll HDMI-Cec deaktiviert werden?"
+
+#: plugin.py:131 plugin.py:135
+msgid "from (HH:MI)"
+msgstr "von (HH:MI)"
+
+#: plugin.py:132
+msgid "Until the time at which, HDMI-Cec should be disabled?"
+msgstr "Bis zu welcher Uhrzeit, soll HDMI-Cec deaktiviert werden?"
+
+#: plugin.py:132 plugin.py:136
+msgid "to (HH:MI)"
+msgstr "bis (HH:MI)"
+
+#: plugin.py:133
+msgid "Do you want a further period of time to be used?"
+msgstr "Soll eine weitere Zeitspanne benutzt werden?"
+
+#: plugin.py:133
+msgid "use second timespan"
+msgstr "Zweite Zeitspanne benutzen"
+
+#: plugin.py:135
+msgid "Second timespan from"
+msgstr "Zweite Zeitspanne ab"
+
+#: plugin.py:136
+msgid "Second timespan to"
+msgstr "Zweite Zeitspanne bis"
+
+#: plugin.py:137
+msgid "Where should this setup be displayed?"
+msgstr "Wo soll dieses Setup angezeigt werden?"
+
+#: plugin.py:137
+msgid "show in"
+msgstr "anzeigen in"
+
+#: plugin.py:196
+msgid "Advanced HDMI Cec Setup"
+msgstr "Erweiterte HDMI-Cec Einstellungen"
+
+#: plugin.py:217 plugin.py:224 plugin.py:232
+msgid "manage when HDMI Cec is enabled"
+msgstr "Verwalte wann HDMI Cec aktiv ist"
View
12 advhdmi/src/LICENSE
@@ -0,0 +1,12 @@
+All Files of this Software are licensed under the Creative Commons
+Attribution-NonCommercial-ShareAlike 3.0 Unported
+License if not stated otherwise in a Files Head. To view a copy of this license, visit
+http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative
+Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
+
+Alternatively, this plugin may be distributed and executed on hardware which
+is licensed by Dream Multimedia GmbH.
+
+This plugin is NOT free software. It is open source, you are allowed to
+modify it (if you keep the license), but it may not be commercially
+distributed other than under the conditions noted above.
View
3 advhdmi/src/Makefile.am
@@ -0,0 +1,3 @@
+installdir = $(libdir)/enigma2/python/Plugins/SystemPlugins/AdvHdmi
+install_PYTHON = *.py
+install_DATA = maintainer.info LICENSE *.xml
View
22 advhdmi/src/__init__.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+
+from Components.Language import language
+from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
+import os,gettext
+
+PluginLanguageDomain = "AdvHdmi"
+PluginLanguagePath = "SystemPlugins/AdvHdmi/locale"
+
+def localeInit():
+ lang = language.getLanguage()[:2] # getLanguage returns e.g. "fi_FI" for "language_country"
+ os.environ["LANGUAGE"] = lang # Enigma doesn't set this (or LC_ALL, LC_MESSAGES, LANG). gettext needs it!
+ gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))
+
+def _(txt):
+ t = gettext.dgettext(PluginLanguageDomain, txt)
+ if t == txt:
+ t = gettext.gettext(txt)
+ return t
+
+localeInit()
+language.addCallback(localeInit)
View
8 advhdmi/src/keymap.xml
@@ -0,0 +1,8 @@
+<keymap>
+ <map context="AdvHdmiConfigActions">
+ <key id="KEY_BLUE" mapto="blueshort" flags="b" />
+ <key id="KEY_BLUE" mapto="bluelong" flags="l" />
+ <key id="KEY_CHANNELUP" mapto="nextBouquet" flags="m" />
+ <key id="KEY_CHANNELDOWN" mapto="prevBouquet" flags="m" />
+ </map>
+</keymap>
View
2 advhdmi/src/maintainer.info
@@ -0,0 +1,2 @@
+johnny.u@gmx.at
+AdvancedHDMICec
View
315 advhdmi/src/plugin.py
@@ -0,0 +1,315 @@
+# -*- coding: utf-8 -*-
+
+# Screens
+from Screens.Screen import Screen
+from Components.Label import Label
+from Components.ActionMap import ActionMap
+from Components.Sources.StaticText import StaticText
+from Screens.Setup import SetupSummary
+
+# for localized messages
+from . import _
+
+# Plugin
+from Plugins.Plugin import PluginDescriptor
+from Components.config import config, ConfigYesNo, ConfigSelection, ConfigSubsection, ConfigClock, getConfigListEntry
+from Components.ConfigList import ConfigListScreen
+
+# for function
+from time import localtime, mktime
+from Components.HdmiCec import hdmi_cec
+# overwrite functions
+from Plugins.SystemPlugins.HdmiCec.plugin import Cec
+from Plugins.Extensions.WebInterface.WebComponents.Sources.RemoteControl import RemoteControl
+from Plugins.Extensions.WebInterface.WebComponents.Sources.PowerState import PowerState
+
+global g_AdvHdmi_sessionstared
+global g_AdvHdmi_fromwebif
+
+now = localtime()
+begin1 = mktime((now.tm_year, now.tm_mon, now.tm_mday, 1, 00, 0, now.tm_wday, now.tm_yday, now.tm_isdst))
+end1 = mktime((now.tm_year, now.tm_mon, now.tm_mday, 6, 00, 0, now.tm_wday, now.tm_yday, now.tm_isdst))
+begin2 = mktime((now.tm_year, now.tm_mon, now.tm_mday, 8, 00, 0, now.tm_wday, now.tm_yday, now.tm_isdst))
+end2 = mktime((now.tm_year, now.tm_mon, now.tm_mday, 16, 00, 0, now.tm_wday, now.tm_yday, now.tm_isdst))
+
+config.plugins.AdvHdmiCec = ConfigSubsection()
+config.plugins.AdvHdmiCec.enable = ConfigYesNo(default = False)
+config.plugins.AdvHdmiCec.disable_after_enigmastart = ConfigYesNo(default = False)
+config.plugins.AdvHdmiCec.disable_from_webif = ConfigYesNo(default = False)
+config.plugins.AdvHdmiCec.time_enable = ConfigYesNo(default = False)
+config.plugins.AdvHdmiCec.fromWD = ConfigSelection(choices=[
+ ("0", _("Monday")),
+ ("1", _("Tuesday")),
+ ("2", _("Wednesday")),
+ ("3", _("Thursday")),
+ ("4", _("Friday")),
+ ("5", _("Saturday")),
+ ("6", _("Sunday")),
+ ], default = "0")
+config.plugins.AdvHdmiCec.toWD = ConfigSelection(choices=[
+ ("0", _("Monday")),
+ ("1", _("Tuesday")),
+ ("2", _("Wednesday")),
+ ("3", _("Thursday")),
+ ("4", _("Friday")),
+ ("5", _("Saturday")),
+ ("6", _("Sunday")),
+ ], default = "6")
+config.plugins.AdvHdmiCec.begin1 = ConfigClock(default = int(begin1))
+config.plugins.AdvHdmiCec.end1 = ConfigClock(default = int(end1))
+config.plugins.AdvHdmiCec.timespan2_enable = ConfigYesNo(default = False)
+config.plugins.AdvHdmiCec.begin2 = ConfigClock(default = int(begin2))
+config.plugins.AdvHdmiCec.end2 = ConfigClock(default = int(end2))
+config.plugins.AdvHdmiCec.show_in = ConfigSelection(choices=[
+ ("system", _("systemmenue")),
+ ("plugin", _("pluginmenue")),
+ ("extension", _("extensions")),
+ ], default = "system")
+
+class AdvHdmiCecSetup(Screen, ConfigListScreen):
+ skin = """
+ <screen name="menu_system" position="center,center" size="550,480" title="Advanced HDMI-Cec Setup" >
+ <widget name="config" position="10,0" size="530,310" scrollbarMode="showOnDemand" enableWrapAround="1" />
+ <ePixmap pixmap="skin_default/div-h.png" position="0,310" zPosition="1" size="550,2" />
+ <widget source="help" render="Label" position="5,320" size="550,120" font="Regular;21" />
+ <ePixmap pixmap="skin_default/buttons/red.png" position="10,430" size="140,40" transparent="1" alphatest="on" />
+ <widget render="Label" source="key_red" position="10,430" size="140,40" transparent="1" halign="center" valign="center" zPosition="2" foregroundColor="white" font="Regular;18" />
+ <ePixmap pixmap="skin_default/buttons/green.png" position="180,430" size="140,40" transparent="1" alphatest="on" />
+ <widget render="Label" source="key_green" position="180,430" size="140,40" transparent="1" halign="center" valign="center" zPosition="2" foregroundColor="white" font="Regular;18" />
+ </screen>"""
+
+ def __init__(self, session):
+ Screen.__init__(self, session)
+ self.setup_title = _("Advanced HDMI-Cec Setup")
+ self.onChangedEntry = []
+
+ self.list = []
+ ConfigListScreen.__init__(self, self.list, session = session, on_change = self.changed)
+
+ self["key_red"] = StaticText(_("Cancel"))
+ self["key_green"] = StaticText(_("Save"))
+ self["help"] = StaticText()
+
+ self.getConfig()
+
+ def selectionChanged():
+ current = self["config"].getCurrent()
+ if self["config"].current != current:
+ if self["config"].current:
+ self["config"].current[1].onDeselect(self.session)
+ if current:
+ current[1].onSelect(self.session)
+ self["config"].current = current
+ for x in self["config"].onSelectionChanged:
+ x()
+
+ self["config"].selectionChanged = selectionChanged
+ self["config"].onSelectionChanged.append(self.updateHelp)
+
+ # Actions
+ self["actions"] = ActionMap(["SetupActions", "AdvHdmiConfigActions"],
+ {
+ "cancel": self.keyCancel,
+ "save": self.keySave,
+ "nextBouquet":self.bouquetPlus,
+ "prevBouquet":self.bouquetMinus,
+ }
+ )
+
+ # Trigger change
+ self.changed()
+
+ def getConfig(self):
+ self.list = [ getConfigListEntry(_("partially disabel HdmiCec"), config.plugins.AdvHdmiCec.enable, _("Partially disabel HDMI-Cec?\nIt can be prevented only the signals that are sent from the Dreambox. Signals received by the Dreambox will not be prevented.")) ]
+ if config.plugins.AdvHdmiCec.enable.value:
+ self.list.append(getConfigListEntry(_("disable at GUI-start"), config.plugins.AdvHdmiCec.disable_after_enigmastart, _("Should HDMI-Cec be disabled when GUI service startup?")))
+ self.list.append(getConfigListEntry(_("disable from webinterface"), config.plugins.AdvHdmiCec.disable_from_webif, _("Should HDMI-Cec be disabled when the commands are sent from the web interface?")))
+ self.list.append(getConfigListEntry(_("disable chronologically"), config.plugins.AdvHdmiCec.time_enable, _("Should HDMI-Cec be disabled at certain times?")))
+ if config.plugins.AdvHdmiCec.time_enable.value:
+ self.list.append(getConfigListEntry(_("from weekday"), config.plugins.AdvHdmiCec.fromWD, _("From which day of the week, HDMI-Cec should be disabled?")))
+ self.list.append(getConfigListEntry(_("to weekday"), config.plugins.AdvHdmiCec.toWD, _("To what day of the week, HDMI-Cec should be disabled?")))
+ self.list.append(getConfigListEntry(_("from (HH:MI)"), config.plugins.AdvHdmiCec.begin1, _("At which time, HDMI-Cec should be disabled?")))
+ self.list.append(getConfigListEntry(_("to (HH:MI)"), config.plugins.AdvHdmiCec.end1, _("Until the time at which, HDMI-Cec should be disabled?")))
+ self.list.append(getConfigListEntry(_("use second timespan"), config.plugins.AdvHdmiCec.timespan2_enable, _("Do you want a further period of time to be used?")))
+ if config.plugins.AdvHdmiCec.timespan2_enable.value:
+ self.list.append(getConfigListEntry(_("from (HH:MI)"), config.plugins.AdvHdmiCec.begin2, _("Second timespan from")))
+ self.list.append(getConfigListEntry(_("to (HH:MI)"), config.plugins.AdvHdmiCec.end2, _("Second timespan to")))
+ self.list.append(getConfigListEntry(_("show in"), config.plugins.AdvHdmiCec.show_in, _("Where should this setup be displayed?")))
+
+ self["config"].list = self.list
+ self["config"].setList(self.list)
+
+ def keyLeft(self):
+ ConfigListScreen.keyLeft(self)
+ self.getConfig()
+
+ def keyRight(self):
+ ConfigListScreen.keyRight(self)
+ self.getConfig()
+
+ def bouquetPlus(self):
+ self["config"].instance.moveSelection(self["config"].instance.pageUp)
+
+ def bouquetMinus(self):
+ self["config"].instance.moveSelection(self["config"].instance.pageDown)
+
+ def updateHelp(self):
+ cur = self["config"].getCurrent()
+ if cur:
+ self["help"].text = cur[2]
+
+ def keySave(self):
+ for x in self["config"].list:
+ x[1].save()
+
+ self.close(self.session)
+
+ def changed(self):
+ for x in self.onChangedEntry:
+ try:
+ x()
+ except Exception:
+ pass
+
+def sessionstart(reason, **kwargs):
+ global g_AdvHdmi_sessionstared
+ if reason == 0:
+ g_AdvHdmi_sessionstared = True
+
+def autostart(reason, **kwargs):
+ if reason == 0:
+ g_AdvHdmi_sessionstared = True
+
+def main(session, **kwargs):
+ session.open(AdvHdmiCecSetup)
+
+def showinSetup(menuid):
+ if menuid != "system":
+ return []
+ return [(_("Advanced HDMI Cec Setup"), main, "", 46)]
+
+def Plugins(**kwargs):
+ global g_AdvHdmi_sessionstared
+ global g_AdvHdmi_fromwebif
+ g_AdvHdmi_sessionstared = False
+ g_AdvHdmi_fromwebif = False
+
+ list = [
+ PluginDescriptor(
+ where = PluginDescriptor.WHERE_SESSIONSTART,
+ fnc = sessionstart),
+ PluginDescriptor(
+ where = PluginDescriptor.WHERE_AUTOSTART,
+ fnc = autostart)
+ ]
+ if config.plugins.AdvHdmiCec.show_in.value == "system":
+ list.append (PluginDescriptor(
+ name="Advanced HDMI Cec Control",
+ description=_("manage when HDMI Cec is enabled"),
+ where = PluginDescriptor.WHERE_MENU,
+ fnc=showinSetup)
+ )
+ if config.plugins.AdvHdmiCec.show_in.value == "plugin":
+ list.append (PluginDescriptor(
+ name = "Advanced HDMI Cec Control",
+ description = _("manage when HDMI Cec is enabled"),
+ where = PluginDescriptor.WHERE_PLUGINMENU,
+ fnc = main,
+ needsRestart = False)
+ )
+ if config.plugins.AdvHdmiCec.show_in.value == "extension":
+ list.append (PluginDescriptor(
+ name = "Advanced HDMI Cec Control",
+ description = _("manage when HDMI Cec is enabled"),
+ where = PluginDescriptor.WHERE_EXTENSIONSMENU,
+ fnc = main,
+ needsRestart = False)
+ )
+
+ return list
+
+def checkTimespan(lt, begin, end):
+ # Check if we span a day
+ if begin[0] > end[0] or (begin[0] == end[0] and begin[1] >= end[1]):
+ # Check if begin of event is later than our timespan starts
+ if lt.tm_hour > begin[0] or (lt.tm_hour == begin[0] and lt.tm_min >= begin[1]):
+ # If so, event is in our timespan
+ return True
+ # Check if begin of event is earlier than our timespan end
+ if lt.tm_hour < end[0] or (lt.tm_hour == end[0] and lt.tm_min <= end[1]):
+ # If so, event is in our timespan
+ return True
+ return False
+ else:
+ # Check if event begins earlier than our timespan starts
+ if lt.tm_hour < begin[0] or (lt.tm_hour == begin[0] and lt.tm_min < begin[1]):
+ # Its out of our timespan then
+ return False
+ # Check if event begins later than our timespan ends
+ if lt.tm_hour > end[0] or (lt.tm_hour == end[0] and lt.tm_min > end[1]):
+ # Its out of our timespan then
+ return False
+ return True
+
+def AdvHdiCecDOIT():
+ global g_AdvHdmi_sessionstared
+ global g_AdvHdmi_fromwebif
+ ret_val = True
+ if config.plugins.AdvHdmiCec.enable.value:
+ if g_AdvHdmi_sessionstared and config.plugins.AdvHdmiCec.disable_after_enigmastart.value:
+ print "[AdvHdmiCec] prevent sending HDMICec, because of enigmastart"
+ ret_val = False
+
+ if ret_val and g_AdvHdmi_fromwebif and config.plugins.AdvHdmiCec.disable_from_webif.value:
+ print "[AdvHdmiCec] prevent sending HDMICec, because it was from webif"
+ ret_val = False
+
+ if ret_val and config.plugins.AdvHdmiCec.time_enable.value:
+ lt = localtime()
+ if int(lt[6]) < int(config.plugins.AdvHdmiCec.fromWD.getValue()) \
+ or int(lt[6]) > int(config.plugins.AdvHdmiCec.toWD.getValue()):
+ print "[AdvHdmiCec] do sending HDMICec, because of weekday"
+ else:
+ if checkTimespan(lt, config.plugins.AdvHdmiCec.begin1.getValue(), config.plugins.AdvHdmiCec.end1.getValue()):
+ print "[AdvHdmiCec] prevent sending HDMICec, because of timespan 1"
+ ret_val = False
+
+ if ret_val and config.plugins.AdvHdmiCec.timespan2_enable.getValue() \
+ and checkTimespan(lt, config.plugins.AdvHdmiCec.begin2.getValue(), config.plugins.AdvHdmiCec.end2.getValue()):
+ print "[AdvHdmiCec] prevent sending HDMICec, because of timespan 2"
+ ret_val = False
+ g_AdvHdmi_sessionstared = False
+ g_AdvHdmi_fromwebif = False
+
+ return ret_val
+
+# Overwrite CEC-Base
+def Cec_powerOn(self):
+ if config.plugins.cec.sendpower.value and AdvHdiCecDOIT():
+ print "[AdvHdmiCec] power on"
+ hdmi_cec.otp_source_enable()
+
+def Cec_powerOff(self):
+ if config.plugins.cec.sendpower.value and AdvHdiCecDOIT():
+ print "[AdvHdmiCec] power off"
+ hdmi_cec.ss_standby()
+
+# Overwrite WebIf
+def RemoteControl_handleCommand(self, cmd):
+ global g_AdvHdmi_fromwebif
+ g_AdvHdmi_fromwebif = True
+ self.cmd = cmd
+ self.res = self.sendEvent()
+
+def PowerState_handleCommand(self, cmd):
+ global g_AdvHdmi_fromwebif
+ g_AdvHdmi_fromwebif = True
+ self.cmd = cmd
+
+if config.plugins.AdvHdmiCec.enable.value:
+ cec = Cec()
+ print "[AdvHdmiCec] enabled"
+ Cec.powerOn = Cec_powerOn
+ Cec.powerOff = Cec_powerOff
+ RemoteControl.handleCommand = RemoteControl_handleCommand
+ PowerState.handleCommand = PowerState_handleCommand
View
8 bonjour/src/Bonjour.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from enigma import eConsoleAppContainer, eTimer
from xml.etree.cElementTree import parse as cet_parse
+from xml.etree.ElementTree import ParseError
from os import path, listdir
from os import remove as os_remove
@@ -78,7 +79,10 @@ def __deleteService(self, protocol):
def __parse(self, file):
print "[Bonjour.__parse] parsing %s%s" %(self.AVAHI_SERVICES_DIR, file)
- config = cet_parse(self.AVAHI_SERVICES_DIR + file).getroot()
+ try:
+ config = cet_parse(self.AVAHI_SERVICES_DIR + file).getroot()
+ except ParseError: #parsing failed, skip the file
+ return
name = config.find('name').text
@@ -90,7 +94,7 @@ def __parse(self, file):
if text != None:
for txt in text:
textList.append(txt.text)
- print textList
+
service = self.buildServiceFull(file, name, type, port, textList)
self.registerService(service)
View
5 configure.ac
@@ -117,6 +117,11 @@ advancedmovieselection/src/Source/Makefile
advancedmovieselection/src/Source/MovieDB/Makefile
advancedmovieselection/src/Source/Remote/Makefile
+advhdmi/Makefile
+advhdmi/meta/Makefile
+advhdmi/po/Makefile
+advhdmi/src/Makefile
+
aihdcontroler/Makefile
aihdcontroler/meta/Makefile
aihdcontroler/src/Makefile
View
2 fancontrol2/src/globals.py
@@ -1,5 +1,5 @@
from __init__ import _
-Version = "V2.8r0"
+Version = "V2.8r1"
# globale Variablen
ZielRPM = 0
AktVLT = 0
View
7 fancontrol2/src/plugin.py
@@ -1122,7 +1122,12 @@ def queryRun(self):
AktRPMtmp = GetFanRPM()
if RPMread>0 and RPMread<3:
FClog("Reread")
- self.timer.start(400, True)
+ if FC2doThread == True:
+ if Briefkasten.qsize()<=2:
+ time.sleep(0.4)
+ Briefkasten.put(1)
+ else:
+ self.timer.start(400, True)
return
RPMread = 0
if AktRPMtmp > 6000:
View
123 ncidclient/src/plugin.py
@@ -134,26 +134,27 @@ def handleMountpoint(loc):
def initAvon():
avonFileName = resolveFilename(SCOPE_PLUGINS, "Extensions/NcidClient/avon.dat")
if os.path.exists(avonFileName):
- for line in open(avonFileName):
- line = line.decode("iso-8859-1").encode('utf-8')
- if line[0] == '#':
- continue
- parts = line.split(':')
- if len(parts) == 2:
- avon[parts[0].replace('-', '').replace('*', '').replace('/', '')] = parts[1]
+ with open(avonFileName) as file:
+ for line in file:
+ line = line.decode("iso-8859-1").encode('utf-8')
+ if line[0] == '#':
+ continue
+ parts = line.split(':')
+ if len(parts) == 2:
+ avon[parts[0].replace('-', '').replace('*', '').replace('/', '')] = parts[1]
def resolveNumberWithAvon(number, countrycode):
if not number or number[0] != '0':
return ""
-
+
countrycode = countrycode.replace('00', '+')
if number[:2] == '00':
normNumber = '+' + number[2:]
elif number[:1] == '0':
normNumber = countrycode + number[1:]
else: # this should can not happen, but safety first
return ""
-
+
# debug('normNumer: ' + normNumber)
for i in reversed(range(min(10, len(number)))):
if avon.has_key(normNumber[:i]):
@@ -316,15 +317,15 @@ def search(self, number):
# debug("[NcidClientPhonebook] search: result: %s" %name)
else:
prefix = ""
-
+
if not name and self.phonebook.has_key(number):
name = self.phonebook[number]
-
+
return name.replace(", ", "\n").strip()
def add(self, number, name):
'''
-
+
@param number: number of entry
@param name: name of entry, has to be in utf-8
'''
@@ -343,7 +344,7 @@ def add(self, number, name):
f.close()
debug("[NcidClientPhonebook] added %s with %s to Phonebook.txt" % (number, name.strip()))
return True
-
+
except IOError:
return False
@@ -370,13 +371,13 @@ def remove(self, number):
os.rename(phonebookFilename + str(os.getpid()), phonebookFilename)
debug("[NcidClientPhonebook] removed %s from Phonebook.txt" % number)
return True
-
+
except (IOError, OSError):
debug("[NcidClientPhonebook] error removing %s from %s" % (number, phonebookFilename))
return False
class NcidDisplayPhonebook(Screen, NumericalTextInput):
-
+
def __init__(self, session):
self.entriesWidth = DESKTOP_WIDTH * scaleH(75, 85) / 100
self.height = DESKTOP_HEIGHT * 0.75
@@ -410,7 +411,7 @@ def __init__(self, session):
<widget name="key_yellow" position="%d,%d" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;%d" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
<widget name="key_blue" position="%d,%d" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;%d" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
</screen>""" % (
- # scaleH(90, 75), scaleV(100, 73), # position
+ # scaleH(90, 75), scaleV(100, 73), # position
self.entriesWidth, self.height, # size
self.entriesWidth, # eLabel width
scaleH(40, 5), scaleV(20, 5), # entries position
@@ -430,12 +431,12 @@ def __init__(self, session):
3 * buttonGap + 2 * 140, self.height - 40, scaleV(22, 21), # widget yellow
4 * buttonGap + 3 * 140, self.height - 40, scaleV(22, 21), # widget blue
)
-
+
# debug("[NcidDisplayCalls] skin: " + self.skin)
Screen.__init__(self, session)
NumericalTextInput.__init__(self)
HelpableScreen.__init__(self)
-
+
# TRANSLATORS: keep it short, this is a button
self["key_red"] = Button(_("Delete"))
# TRANSLATORS: keep it short, this is a button
@@ -444,7 +445,7 @@ def __init__(self, session):
self["key_yellow"] = Button(_("Edit"))
# TRANSLATORS: keep it short, this is a button
self["key_blue"] = Button(_("Search"))
-
+
self["setupActions"] = ActionMap(["OkCancelActions", "ColorActions"],
{
"red": self.delete,
@@ -453,7 +454,7 @@ def __init__(self, session):
"blue": self.search,
"cancel": self.exit,
"ok": self.showEntry, }, -2)
-
+
self["entries"] = List([])
debug("[NcidClientPhonebook] displayPhonebook init")
self.help_window = None
@@ -499,30 +500,30 @@ def display(self, filterNumber=""):
name = name.encode("utf-8", "replace")
shortname = shortname.encode('utf-8', 'replace')
self.sortlist.append((name, shortname, number))
-
+
self["entries"].setList(self.sortlist)
-
+
def showEntry(self):
cur = self["entries"].getCurrent()
if cur:
debug("[NcidClientPhonebook] displayPhonebook/showEntry %s" % (repr(cur)))
number = cur[2]
name = cur[0]
self.session.open(NcidOfferAction, self, number, name)
-
+
def delete(self):
cur = self["entries"].getCurrent()
if cur:
debug("[NcidClientPhonebook] displayPhonebook/delete %s" % (repr(cur)))
self.session.openWithCallback(
self.deleteConfirmed,
MessageBox,
- _("Do you really want to delete entry for\n\n%(number)s\n\n%(name)s?")
+ _("Do you really want to delete entry for\n\n%(number)s\n\n%(name)s?")
% { 'number':str(cur[2]), 'name':str(cur[0]).replace(", ", "\n") }
)
else:
self.session.open(MessageBox, _("No entry selected"), MessageBox.TYPE_INFO)
-
+
def deleteConfirmed(self, ret):
debug("[NcidClientPhonebook] displayPhonebook/deleteConfirmed")
#
@@ -539,15 +540,15 @@ def deleteConfirmed(self, ret):
# self.session.open(MessageBox, _("Not deleted."), MessageBox.TYPE_INFO)
else:
self.session.open(MessageBox, _("No entry selected"), MessageBox.TYPE_INFO)
-
+
def add(self, parent=None, number="", name=""):
class AddScreen(Screen, ConfigListScreen):
'''ConfiglistScreen with two ConfigTexts for Name and Number'''
-
+
def __init__(self, session, parent, number="", name=""):
#
# setup screen with two ConfigText and OK and ABORT button
- #
+ #
noButtons = 2
width = max(scaleH(-1, 570), noButtons * 140)
height = scaleV(-1, 100) # = 5 + 126 + 40 + 5; 6 lines of text possible
@@ -582,7 +583,7 @@ def __init__(self, session, parent, number="", name=""):
"green": self.add,
"ok": self.add,
}, -2)
-
+
self.list = [ ]
ConfigListScreen.__init__(self, self.list, session=session)
self.name = name
@@ -594,7 +595,7 @@ def __init__(self, session, parent, number="", name=""):
self["config"].list = self.list
self["config"].l.setList(self.list)
self.onLayoutFinish.append(self.setWindowTitle)
-
+
def setWindowTitle(self):
# TRANSLATORS: this is a window title.
self.setTitle(_("Add entry to phonebook"))
@@ -611,36 +612,36 @@ def add(self):
phonebook.add(self.number, self.name)
self.close()
self.parent.display()
-
+
def overwriteConfirmed(self, ret):
if ret:
phonebook.remove(self.number)
phonebook.add(self.number, self.name)
self.parent.display()
-
+
def cancel(self):
self.close()
-
+
debug("[NcidClientPhonebook] displayPhonebook/add")
if not parent:
parent = self
self.session.open(AddScreen, parent, number, name)
-
+
def edit(self):
debug("[NcidClientPhonebook] displayPhonebook/edit")
cur = self["entries"].getCurrent()
if cur is None:
self.session.open(MessageBox, _("No entry selected"), MessageBox.TYPE_INFO)
else:
self.add(self, cur[2], cur[0])
-
+
def search(self):
debug("[NcidClientPhonebook] displayPhonebook/search")
self.help_window = self.session.instantiateDialog(NumericalTextInputHelpDialog, self)
self.help_window.show()
# VirtualKeyboard instead of InputBox?
self.session.openWithCallback(self.doSearch, InputBox, _("Enter Search Terms"), _("Search phonebook"))
-
+
def doSearch(self, searchTerms):
if not searchTerms:
searchTerms = ""
@@ -649,7 +650,7 @@ def doSearch(self, searchTerms):
self.session.deleteDialog(self.help_window)
self.help_window = None
self.display(searchTerms)
-
+
def exit(self):
self.close()
@@ -672,9 +673,9 @@ def __init__(self, session, args=None): #@UnusedVariable # pylint: disable=W0613
<widget name="key_red" position="%d,%d" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;%d" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
<widget name="key_green" position="%d,%d" zPosition="5" size="140,40" valign="center" halign="center" font="Regular;%d" transparent="1" foregroundColor="white" shadowColor="black" shadowOffset="-1,-1" />
</screen>""" % (
- # (DESKTOP_WIDTH-width)/2, scaleV(100, 73), # position
+ # (DESKTOP_WIDTH-width)/2, scaleV(100, 73), # position
width, scaleV(560, 430), # size
- width, # eLabel width
+ width, # eLabel width
scaleV(40, 50), # eLabel position vertical
width, # eLabel width
scaleH(40, 5), scaleV(60, 57), # config position
@@ -802,7 +803,7 @@ def displayPhonebook(self):
class NcidCallList:
def __init__(self):
self.callList = [ ]
-
+
def add(self, date, number, caller):
debug("[NcidCallList] add: %s %s" % (number, caller))
if len(self.callList) > 10:
@@ -811,7 +812,7 @@ def add(self, date, number, caller):
del self.callList[1]
self.callList.append((number, date, caller))
-
+
def display(self):
debug("[NcidCallList] display")
global standbyMode
@@ -821,19 +822,19 @@ def display(self):
text = "\n"
if not self.callList:
- text = _("no calls")
+ text = _("no calls")
else:
if self.callList[0] == "Start":
text = text + _("Last 10 calls:\n")
del self.callList[0]
-
+
for call in self.callList:
(number, date, caller) = call
-
+
# should not happen, for safety reasons
if not caller:
caller = _("UNKNOWN")
-
+
# if we have an unknown number, show the number
if caller == _("UNKNOWN") and number != "":
caller = number
@@ -843,15 +844,15 @@ def display(self):
if nl != -1:
caller = caller[:nl]
elif caller[0] == '[' and caller[-1] == ']':
- # that means, we've got an unknown number with a city added from avon.dat
+ # that means, we've got an unknown number with a city added from avon.dat
if (len(number) + 1 + len(caller)) <= 40:
caller = number + ' ' + caller
else:
caller = number
-
- while (len(caller)) > 40:
+
+ while (len(caller)) > 40:
caller = caller[:-1]
-
+
text = text + "%s - %s\n" % (date, caller)
debug("[NcidCallList] display: '%s - %s'" % (date, caller))
@@ -900,8 +901,8 @@ def notifyCall(date, number, caller):
class NcidReverseLookupAndNotify:
def __init__(self, number, caller, date):
'''
-
- Initiate a reverse lookup for the given number in the configured country
+
+ Initiate a reverse lookup for the given number in the configured country
@param number: number to be looked up
@param caller: caller including name and address
@param date: date of call
@@ -919,9 +920,9 @@ def __init__(self, number, caller, date):
def notifyAndReset(self, number, caller):
'''
-
+
this gets called with the result of the reverse lookup
-
+
@param number: number
@param caller: name and address of remote. it comes in with name, address and city separated by commas
'''
@@ -966,19 +967,19 @@ def lineReceived(self, line):
#CIDLOG: *DATE*21102010*TIME*1456*LINE**NMBR*089999999999*MESG*NONE*NAME*NO NAME*
#CID: *DATE*22102010*TIME*1502*LINE**NMBR*089999999999*MESG*NONE*NAME*NO NAME*
-#Callog entries begin with CIDLOG, "current" events begin with CID
+#Callog entries begin with CIDLOG, "current" events begin with CID
#we don't want to do anything with log-entries
if line.startswith("CID:"):
line = line[6:]
debug("[NcidLineReceiver.lineReceived] filtered Line: %s" % line)
else:
return
-
+
items = line.split('*')
for i in range(0, len(items)):
item = items[i]
-
+
if item == 'DATE':
self.date = items[i + 1]
elif item == 'TIME':
@@ -997,14 +998,14 @@ def lineReceived(self, line):
try:
date = datetime.strptime("%s - %s" % (self.date, self.time), "%d%m%Y - %H%M")
except:
- date = datetime.strptime("%s - %s" % (self.date, self.time), "%m%d%Y - %H%M")
-
+ date = datetime.strptime("%s - %s" % (self.date, self.time), "%m%d%Y - %H%M")
+
self.date = date.strftime("%d.%m.%Y - %H:%M")
if not self.number:
debug("[NcidLineReceiver] lineReceived: no number")
self.number = _("number suppressed")
- self.caller = self.myName
+ self.caller = self.myName
else:
if config.plugins.NcidClient.internal.value and len(self.number) > 3 and self.number[0] == "0":
debug("[NcidLineReceiver] lineReceived: strip leading 0")
@@ -1024,7 +1025,7 @@ def lineReceived(self, line):
NcidReverseLookupAndNotify(self.number, self.caller, self.date)
return # reverselookup is supposed to handle the message itself
else:
- self.caller = self.myName
+ self.caller = self.myName
self.notifyAndReset()
@@ -1063,7 +1064,7 @@ def clientConnectionFailed(self, connector, reason):
ReconnectingClientFactory.clientConnectionFailed(self, connector, reason)
# config.plugins.NcidClient.enable.value = False
ncidsrv = None
-
+
class NcidClient:
def __init__(self):
self.dialog = None

0 comments on commit b5e0fa0

Please sign in to comment.