timersanitycheck = TimerSanityCheck(NavigationInstance.instance.RecordTimer.timer_list, dummyentry)
if not timersanitycheck.check():
simulTimerList = timersanitycheck.getSimulTimerList()
- new_end = simulTimerList[1].begin
- del simulTimerList
- new_end -= 30 # 30 Sekunden Prepare-Zeit lassen
- del dummyentry
+ if simulTimerList is not None and len(simulTimerList) > 1:
+ new_end = simulTimerList[1].begin
+ new_end -= 30 # 30 Sekunden Prepare-Zeit lassen
if new_end <= time():
return False
self.end = new_end
return True
-
-
+
def sendStandbyNotification(self, answer):
if answer:
Notifications.AddNotification(Screens.Standby.Standby)
<item level="2" text="Load Length of Movies in Movielist">config.usage.load_length_of_movies_in_moviellist</item>
<item level="1" text="Show positioner movement">config.usage.showdish</item>
<item level="1" text="Enable multiple bouquets">config.usage.multibouquet</item>
+ <item level="1" text="Multi-EPG bouquet selection">config.usage.multiepg_ask_bouquet</item>
<item level="1" text="Change bouquets in quickzap">config.usage.quickzap_bouquet_change</item>
<item level="1" text="Alternative radio mode">config.usage.e1like_radio_mode</item>
<item level="1" text="Action on long powerbutton press">config.usage.on_long_powerpress</item>
int ret = -1;
Py_ssize_t argc = PyTuple_Size(args);
if (argc > 1)
- ret = PyArg_ParseTuple(args, "si", &data, &len);
+ ret = !PyArg_ParseTuple(args, "si", &data, &len);
else if (argc == 1)
{
PyObject *ob;
col);
return 0;
#endif
-#if 0 // def BCM_ACCEL
- bcm_accel_fill(
- dst->data_phys, dst->x, dst->y, dst->stride,
- area.left(), area.top(), area.width(), area.height(),
- col);
- return 0;
+#ifdef BCM_ACCEL
+ if (!m_bcm_accel_state) {
+ bcm_accel_fill(
+ dst->data_phys, dst->x, dst->y, dst->stride,
+ area.left(), area.top(), area.width(), area.height(),
+ col);
+ return 0;
+ }
#endif
return -1;
}
int x, int y, int width, int height,
unsigned long color)
{
-// printf("unimplemented bcm_accel_fill\n");
+ C(0x43); // reset source
+ C(0x53); // reset dest
+ C(0x5b); // reset pattern
+ C(0x67); // reset blend
+ C(0x75); // reset output
+
+ // clear dest surface
+ P(0x0, 0);
+ P(0x1, 0);
+ P(0x2, 0);
+ P(0x3, 0);
+ P(0x4, 0);
+ C(0x45);
+
+ // clear src surface
+ P(0x0, 0);
+ P(0x1, 0);
+ P(0x2, 0);
+ P(0x3, 0);
+ P(0x4, 0);
+ C(0x5);
+
+ P(0x2d, color);
+
+ P(0x2e, x); // prepare output rect
+ P(0x2f, y);
+ P(0x30, width);
+ P(0x31, height);
+ C(0x6e); // set this rect as output rect
+
+ P(0x0, dst_addr); // prepare output surface
+ P(0x1, dst_stride);
+ P(0x2, dst_width);
+ P(0x3, dst_height);
+ P(0x4, 0x7e48888);
+ C(0x69); // set output surface
+
+ P(0x6f, 0);
+ P(0x70, 0);
+ P(0x71, 2);
+ P(0x72, 2);
+ C(0x73); // select color keying
+
+ C(0x77); // do it
+
+ exec_list();
}
def IPaddrFinished(self, result, retval, extra_args):
(iface, callback ) = extra_args
- data = { 'up': False, 'dhcp': False, 'preup' : False, 'postdown' : False }
+ data = { 'up': False, 'dhcp': False, 'preup' : False, 'predown' : False }
globalIPpattern = re_compile("scope global")
ipRegexp = '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
netRegexp = '[0-9]{1,2}'
if iface.has_key('gateway'):
fp.write(" gateway %d.%d.%d.%d\n" % tuple(iface['gateway']))
if iface.has_key("configStrings"):
- fp.write("\n" + iface["configStrings"] + "\n")
+ fp.write(iface["configStrings"])
if iface["preup"] is not False and not iface.has_key("configStrings"):
fp.write(iface["preup"])
- fp.write(iface["postdown"])
- fp.write("\n")
+ if iface["predown"] is not False and not iface.has_key("configStrings"):
+ fp.write(iface["predown"])
+ fp.write("\n")
fp.close()
self.writeNameserverConfig()
if (split[0] == "pre-up"):
if self.ifaces[currif].has_key("preup"):
self.ifaces[currif]["preup"] = i
- if (split[0] == "post-down"):
- if self.ifaces[currif].has_key("postdown"):
- self.ifaces[currif]["postdown"] = i
+ if (split[0] in ("pre-down","post-down")):
+ if self.ifaces[currif].has_key("predown"):
+ self.ifaces[currif]["predown"] = i
for ifacename, iface in ifaces.items():
if self.ifaces.has_key(ifacename):
for x in where:
res.extend(self.plugins.get(x, [ ]))
-
- return res
+ res.sort(key=lambda x:x.weight)
+ return res
def getPluginsForMenu(self, menuid):
res = [ ]
config.usage = ConfigSubsection();
config.usage.showdish = ConfigYesNo(default = True)
config.usage.multibouquet = ConfigYesNo(default = False)
+ config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False)
+
config.usage.quickzap_bouquet_change = ConfigYesNo(default = False)
config.usage.e1like_radio_mode = ConfigYesNo(default = False)
config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [
title = job.project.titles[job.i]
self.global_preconditions.append(DiskspacePrecondition(title.estimatedDiskspace))
self.setTool("projectx")
- self.args += [inputfile, "-demux", "-out", self.job.workspace ]
+ self.args += [inputfile, "-demux", "-set", "ExportPanel.Streamtype.Subpicture=0", "-set", "ExportPanel.Streamtype.Teletext=0", "-out", self.job.workspace ]
self.end = 300
self.prog_state = 0
self.weighting = 1000
from Plugins.Plugin import PluginDescriptor
from GraphMultiEpg import GraphMultiEPG
-from Screens.ChannelSelection import BouquetSelector
+from Screens.ChannelSelection import BouquetSelector, SilentBouquetSelector
from enigma import eServiceCenter, eServiceReference
from ServiceReference import ServiceReference
+from Components.config import config
Session = None
Servicelist = None
epg_bouquet = bouquet
epg.setServices(services)
+def openAskBouquet(Session, bouquets, cnt):
+ if cnt > 1: # show bouquet list
+ global bouquetSel
+ bouquetSel = Session.openWithCallback(closed, BouquetSelector, bouquets, openBouquetEPG, enableWrapAround=True)
+ dlg_stack.append(bouquetSel)
+ elif cnt == 1:
+ if not openBouquetEPG(bouquets[0][1]):
+ cleanup()
+
+def openSilent(Servicelist, bouquets, cnt):
+ root = Servicelist.getRoot()
+ if cnt > 1: # create bouquet list
+ global bouquetSel
+ current = 0
+ rootstr = root.toCompareString()
+ for bouquet in bouquets:
+ if bouquet[1].toCompareString() == rootstr:
+ break
+ current += 1
+ if current >= cnt:
+ current = 0
+ bouquetSel = SilentBouquetSelector(bouquets, True, current)
+ if cnt >= 1: # open current bouquet
+ if not openBouquetEPG(root):
+ cleanup()
+
def main(session, servicelist, **kwargs):
global Session
Session = session
cnt = 0
else:
cnt = len(bouquets)
- if cnt > 1: # show bouquet list
- global bouquetSel
- bouquetSel = Session.openWithCallback(closed, BouquetSelector, bouquets, openBouquetEPG, enableWrapAround=True)
- dlg_stack.append(bouquetSel)
- elif cnt == 1:
- if not openBouquetEPG(bouquets[0][1]):
- cleanup()
+ if config.usage.multiepg_ask_bouquet.value:
+ openAskBouquet(session, bouquets, cnt)
+ else:
+ openSilent(servicelist, bouquets, cnt)
def Plugins(**kwargs):
name = _("Graphical Multi EPG")
WHERE_SOFTWAREMANAGER = 14
- def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None, wakeupfnc = None, needsRestart = None, internal = False):
+ def __init__(self, name = "Plugin", where = [ ], description = "", icon = None, fnc = None, wakeupfnc = None, needsRestart = None, internal = False, weight = 0):
self.name = name
self.internal = internal
self.needsRestart = needsRestart
else:
self.icon = icon
+ self.weight = weight
+
self.wakeupfnc = wakeupfnc
self.__call__ = fnc
fp.write('\tssid="'+essid+'"\n')
fp.write('\tscan_ssid=0\n')
if encrypted:
- if encryption == 'WPA' or encryption == 'WPA2' or encryption == 'WPA/WPA2' :
+ if encryption in ('WPA', 'WPA2', 'WPA/WPA2'):
fp.write('\tkey_mgmt=WPA-PSK\n')
-
+
if encryption == 'WPA':
fp.write('\tproto=WPA\n')
fp.write('\tpairwise=TKIP\n')
fp.write('\tgroup=TKIP\n')
elif encryption == 'WPA2':
+ fp.write('\tproto=RSN\n')
+ fp.write('\tpairwise=CCMP\n')
+ fp.write('\tgroup=CCMP\n')
+ else:
fp.write('\tproto=WPA RSN\n')
fp.write('\tpairwise=CCMP TKIP\n')
- fp.write('\tgroup=CCMP TKIP\n')
- else:
- fp.write('\tproto=WPA WPA2\n')
- fp.write('\tpairwise=CCMP\n')
- fp.write('\tgroup=TKIP\n')
+ fp.write('\tgroup=CCMP TKIP\n')
fp.write('\tpsk="'+psk+'"\n')
-
elif encryption == 'WEP':
fp.write('\tkey_mgmt=NONE\n')
if wepkeytype == 'ASCII':
elif split[0] == 'proto':
config.plugins.wlan.encryption.enabled.value = True
- if split[1] == "WPA" :
+ if split[1] == 'WPA' :
mode = 'WPA'
- if split[1] == "WPA WPA2" :
- mode = 'WPA/WPA2'
- if split[1] == "WPA RSN" :
+ if split[1] == 'RSN':
mode = 'WPA2'
+ if split[1] in ('WPA RSN', 'WPA WPA2'):
+ mode = 'WPA/WPA2'
+
config.plugins.wlan.encryption.type.value = mode
print "[Wlan.py] Got Encryption: "+mode
- #currently unused !
- #elif split[0] == 'key_mgmt':
- # print "split[1]",split[1]
- # if split[1] == "WPA-PSK" :
- # config.plugins.wlan.encryption.enabled.value = True
- # config.plugins.wlan.encryption.type.value = "WPA/WPA2"
- # print "[Wlan.py] Got Encryption: "+ config.plugins.wlan.encryption.type.value
-
elif split[0] == 'wep_key0':
config.plugins.wlan.encryption.enabled.value = True
config.plugins.wlan.encryption.type.value = 'WEP'
print "[Wlan.py] WS-CONFIG-->",wsconfig
return wsconfig
-
- def restart(self, iface):
- system("start-stop-daemon -K -x /usr/sbin/wpa_supplicant")
- system("start-stop-daemon -S -x /usr/sbin/wpa_supplicant -- -B -i"+iface+" -c/etc/wpa_supplicant.conf")
class Status:
def __init__(self):
def stopWlanConsole(self):
if self.WlanConsole is not None:
print "killing self.WlanConsole"
+ self.WlanConsole.killAll()
self.WlanConsole = None
def getDataForInterface(self, iface, callback = None):
driver = iNetwork.detectWlanModule(iface)
else:
driver = 'dreambox'
- if driver in ('ralink', 'zydas'):
- return " pre-up /usr/sbin/wpa_supplicant -i"+iface+" -c/etc/wpa_supplicant.conf -B -D"+driver+"\n post-down wpa_cli terminate"
- else:
- if config.plugins.wlan.essid.value == "hidden...":
- return ' pre-up iwconfig '+iface+' essid "'+config.plugins.wlan.hiddenessid.value+'"\n pre-up /usr/sbin/wpa_supplicant -i'+iface+' -c/etc/wpa_supplicant.conf -B -dd -D'+driver+'\n post-down wpa_cli terminate'
- else:
- return ' pre-up iwconfig '+iface+' essid "'+config.plugins.wlan.essid.value+'"\n pre-up /usr/sbin/wpa_supplicant -i'+iface+' -c/etc/wpa_supplicant.conf -B -dd -D'+driver+'\n post-down wpa_cli terminate'
+ ret = ""
+ if driver == 'madwifi' and config.plugins.wlan.essid.value == "hidden...":
+ ret += "\tpre-up iwconfig " + iface + " essid \"" + config.plugins.wlan.hiddenessid.value + "\" || true\n"
+ ret += "\tpre-up wpa_supplicant -i" + iface + " -c/etc/wpa_supplicant.conf -B -dd -D" + driver + " || true\n"
+ ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
+ return ret
def Plugins(**kwargs):
return PluginDescriptor(name=_("Wireless LAN"), description=_("Connect to a Wireless Network"), where = PluginDescriptor.WHERE_NETWORKSETUP, needsRestart = False, fnc={"ifaceSupported": callFunction, "configStrings": configStrings, "WlanPluginEntry": lambda x: "Wireless Network Configuartion..."})
def cancelClick(self):
self.close(False)
+class SilentBouquetSelector:
+ def __init__(self, bouquets, enableWrapAround=False, current=0):
+ self.bouquets = [b[1] for b in bouquets]
+ self.pos = current
+ self.count = len(bouquets)
+ self.enableWrapAround = enableWrapAround
+
+ def up(self):
+ if self.pos > 0 or self.enableWrapAround:
+ self.pos = (self.pos - 1) % self.count
+
+ def down(self):
+ if self.pos < (self.count - 1) or self.enableWrapAround:
+ self.pos = (self.pos + 1) % self.count
+
+ def getCurrent(self):
+ return self.bouquets[self.pos]
+
# csel.bouquet_mark_edit values
OFF = 0
EDIT_BOUQUET = 1
-from ChannelSelection import ChannelSelection, BouquetSelector
+from ChannelSelection import ChannelSelection, BouquetSelector, SilentBouquetSelector
from Components.ActionMap import ActionMap, HelpableActionMap
from Components.ActionMap import NumberActionMap
cnt = 0
else:
cnt = len(bouquets)
+ if config.usage.multiepg_ask_bouquet.value:
+ self.openMultiServiceEPGAskBouquet(bouquets, cnt, withCallback)
+ else:
+ self.openMultiServiceEPGSilent(bouquets, cnt, withCallback)
+
+ def openMultiServiceEPGAskBouquet(self, bouquets, cnt, withCallback):
if cnt > 1: # show bouquet list
if withCallback:
self.bouquetSel = self.session.openWithCallback(self.closed, BouquetSelector, bouquets, self.openBouquetEPG, enableWrapAround=True)
elif cnt == 1:
self.openBouquetEPG(bouquets[0][1], withCallback)
+ def openMultiServiceEPGSilent(self, bouquets, cnt, withCallback):
+ root = self.servicelist.getRoot()
+ rootstr = root.toCompareString()
+ current = 0
+ for bouquet in bouquets:
+ if bouquet[1].toCompareString() == rootstr:
+ break
+ current += 1
+ if current >= cnt:
+ current = 0
+ if cnt > 1: # create bouquet list for bouq+/-
+ self.bouquetSel = SilentBouquetSelector(bouquets, True, self.servicelist.getBouquetNumOffset(root))
+ if cnt >= 1:
+ self.openBouquetEPG(root, withCallback)
+
def changeServiceCB(self, direction, epg):
if self.serviceSel:
if direction > 0:
answer[1][1]()
from Tools.BoundFunction import boundFunction
+import inspect
# depends on InfoBarExtensions
return name
def getPluginList(self):
- list = [((boundFunction(self.getPluginName, p.name), boundFunction(self.runPlugin, p), lambda: True), None, p.name) for p in plugins.getPlugins(where = PluginDescriptor.WHERE_EXTENSIONSMENU)]
- list.sort(key = lambda e: e[2]) # sort by name
- return list
+ l = []
+ for p in plugins.getPlugins(where = PluginDescriptor.WHERE_EXTENSIONSMENU):
+ args = inspect.getargspec(p.__call__)[0]
+ if len(args) == 1 or len(args) == 2 and isinstance(self, InfoBarChannelSelection):
+ l.append(((boundFunction(self.getPluginName, p.name), boundFunction(self.runPlugin, p), lambda: True), None, p.name))
+ l.sort(key = lambda e: e[2]) # sort by name
+ return l
def runPlugin(self, plugin):
if isinstance(self, InfoBarChannelSelection):
recording = RecordTimerEntry(serviceref, begin, end, name, description, eventid, dirname = preferredInstantRecordPath())
recording.dontSave = True
-
+
if event is None or limitEvent == False:
recording.autoincrease = True
- if recording.setAutoincreaseEnd():
- self.session.nav.RecordTimer.record(recording)
- self.recording.append(recording)
+ recording.setAutoincreaseEnd()
+
+ simulTimerList = self.session.nav.RecordTimer.record(recording)
+
+ if simulTimerList is None: # no conflict
+ self.recording.append(recording)
else:
- simulTimerList = self.session.nav.RecordTimer.record(recording)
- if simulTimerList is not None: # conflict with other recording
- name = simulTimerList[1].name
- name_date = ' '.join((name, strftime('%c', localtime(simulTimerList[1].begin))))
- print "[TIMER] conflicts with", name_date
- recording.autoincrease = True # start with max available length, then increment
- if recording.setAutoincreaseEnd():
- self.session.nav.RecordTimer.record(recording)
- self.recording.append(recording)
- self.session.open(MessageBox, _("Record time limited due to conflicting timer %s") % name_date, MessageBox.TYPE_INFO)
- else:
- self.session.open(MessageBox, _("Couldn't record due to conflicting timer %s") % name, MessageBox.TYPE_INFO)
- recording.autoincrease = False
- else:
+ if len(simulTimerList) > 1: # with other recording
+ name = simulTimerList[1].name
+ name_date = ' '.join((name, strftime('%c', localtime(simulTimerList[1].begin))))
+ print "[TIMER] conflicts with", name_date
+ recording.autoincrease = True # start with max available length, then increment
+ if recording.setAutoincreaseEnd():
+ self.session.nav.RecordTimer.record(recording)
self.recording.append(recording)
+ self.session.open(MessageBox, _("Record time limited due to conflicting timer %s") % name_date, MessageBox.TYPE_INFO)
+ else:
+ self.session.open(MessageBox, _("Couldn't record due to conflicting timer %s") % name, MessageBox.TYPE_INFO)
+ else:
+ self.session.open(MessageBox, _("Couldn't record due to invalid service %s") % serviceref, MessageBox.TYPE_INFO)
+ recording.autoincrease = False
def isInstantRecordRunning(self):
print "self.recording:", self.recording
if not timersanitycheck.check():
t.disable()
print "Sanity check failed"
- self.session.openWithCallback(self.finishedEdit, TimerSanityConflict, timersanitycheck.getSimulTimerList())
+ simulTimerList = timersanitycheck.getSimulTimerList()
+ if simulTimerList is not None:
+ self.session.openWithCallback(self.finishedEdit, TimerSanityConflict, simulTimerList)
else:
print "Sanity check passed"
if timersanitycheck.doubleCheck():