<widget name="menu" position="10,10" size="440,310" />
</screen>
<!-- Nim selection -->
- <screen name="NimSelection" position="center,center" size="400,330" title="Choose Tuner">
- <widget source="nimlist" render="Listbox" position="0,0" size="380,360" scrollbarMode="showOnDemand">
+ <screen name="NimSelection" position="center,center" size="490,330" title="Choose Tuner">
+ <widget source="nimlist" render="Listbox" position="0,0" size="460,360" scrollbarMode="showOnDemand">
<convert type="TemplatedMultiContent">
{"template": [
- MultiContentEntryText(pos = (10, 5), size = (360, 30), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the nim name,
- MultiContentEntryText(pos = (50, 30), size = (320, 50), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is a description of the nim settings,
+ MultiContentEntryText(pos = (10, 5), size = (440, 30), flags = RT_HALIGN_LEFT, text = 1), # index 1 is the nim name,
+ MultiContentEntryText(pos = (50, 30), size = (400, 50), font = 1, flags = RT_HALIGN_LEFT, text = 2), # index 2 is a description of the nim settings,
],
"fonts": [gFont("Regular", 20), gFont("Regular", 15)],
"itemHeight": 80
</code>
</step>
<step id="parentalsetup">
- <text value="You need to set a pin code and hide it from your children.\n\nDo you want to set the pin now?" />
+ <text value="You need to set a PIN code and hide it from your children.\n\nDo you want to set the pin now?" />
<list>
<listentry caption="Yes" step="finishparentalsetup" />
- <listentry caption="No" step="finishparentalsetup" />
+ <listentry caption="No" step="warnpin" />
</list>
<code pos="after">
from ParentalControlSetup import ParentalControlChangePin
self.session.open(ParentalControlChangePin, config.ParentalControl.servicepin[0], _("parental control pin"))
</code>
</step>
+ <step id="warnpin">
+ <text value="Please be aware, that anyone can disable the parental control, if you have not set a PIN." />
+ </step>
<step id="finishparentalsetup">
<code>
-config.ParentalControl.setuppinactive.value = True
+if config.ParentalControl.setuppin.value == "aaaa":
+ config.ParentalControl.setuppinactive.value = False
+else:
+ config.ParentalControl.setuppinactive.value = True
config.ParentalControl.setuppinactive.save()
config.ParentalControl.servicepinactive.value = True
config.ParentalControl.servicepinactive.save()
PyErr_SetString(PyExc_StandardError, "eDVBResourceManager::setFrontendSlotInformations argument should be a python list");
return NULL;
}
- if ((unsigned int)PyList_Size(list) != m_frontend.size())
+ unsigned int assigned=0;
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
{
+ int pos=0;
+ while (pos < PyList_Size(list)) {
+ ePyObject obj = PyList_GET_ITEM(list, pos++);
+ if (!i->m_frontend->setSlotInfo(obj))
+ continue;
+ ++assigned;
+ break;
+ }
+ }
+ if (assigned != m_frontend.size()) {
char blasel[256];
- sprintf(blasel, "eDVBResourceManager::setFrontendSlotInformations list size incorrect %d frontends avail, but %d entries in slotlist",
- m_frontend.size(), PyList_Size(list));
+ sprintf(blasel, "eDVBResourceManager::setFrontendSlotInformations .. assigned %d socket informations, but %d registered frontends!",
+ m_frontend.size(), assigned);
PyErr_SetString(PyExc_StandardError, blasel);
return NULL;
}
- int pos=0;
- for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
- {
- ePyObject obj = PyList_GET_ITEM(list, pos++);
- if (!i->m_frontend->setSlotInfo(obj))
- return NULL;
- }
- pos=0;
for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_simulate_frontend.begin()); i != m_simulate_frontend.end(); ++i)
{
- ePyObject obj = PyList_GET_ITEM(list, pos++);
- if (!i->m_frontend->setSlotInfo(obj))
- return NULL;
+ int pos=0;
+ while (pos < PyList_Size(list)) {
+ ePyObject obj = PyList_GET_ITEM(list, pos++);
+ if (!i->m_frontend->setSlotInfo(obj))
+ continue;
+ break;
+ }
}
Py_RETURN_NONE;
}
float fval1 = SDS_SNRE / 268435456.0,
fval2, fval3, fval4;
- if (parm_u_qpsk_fec_inner <= FEC_S2_QPSK_9_10) // DVB-S2 QPSK
+ if (oparm.sat.modulation == eDVBFrontendParametersSatellite::Modulation_QPSK)
{
fval2 = 6.76;
fval3 = 4.35;
bool eDVBFrontend::setSlotInfo(ePyObject obj)
{
- ePyObject Id, Descr, Enabled, IsDVBS2;
- if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 4)
+ ePyObject Id, Descr, Enabled, IsDVBS2, frontendId;
+ if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 5)
goto arg_error;
Id = PyTuple_GET_ITEM(obj, 0);
Descr = PyTuple_GET_ITEM(obj, 1);
Enabled = PyTuple_GET_ITEM(obj, 2);
IsDVBS2 = PyTuple_GET_ITEM(obj, 3);
- if (!PyInt_Check(Id) || !PyString_Check(Descr) || !PyBool_Check(Enabled) || !PyBool_Check(IsDVBS2))
+ frontendId = PyTuple_GET_ITEM(obj, 4);
+ m_slotid = PyInt_AsLong(Id);
+ if (!PyInt_Check(Id) || !PyString_Check(Descr) || !PyBool_Check(Enabled) || !PyBool_Check(IsDVBS2) || !PyInt_Check(frontendId))
goto arg_error;
strcpy(m_description, PyString_AS_STRING(Descr));
- m_slotid = PyInt_AsLong(Id);
+ if (PyInt_AsLong(frontendId) == -1 || PyInt_AsLong(frontendId) != m_dvbid) {
+// eDebugNoSimulate("skip slotinfo for slotid %d, descr %s",
+// m_slotid, m_description);
+ return false;
+ }
m_enabled = Enabled == Py_True;
// HACK.. the rotor workaround is neede for all NIMs with LNBP21 voltage regulator...
m_need_rotor_workaround = !!strstr(m_description, "Alps BSBE1") ||
//reset some tuner configuration
for (eSmartPtrList<eDVBRegisteredFrontend>::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it)
{
- long tmp;
- char c;
- if (sscanf(it->m_frontend->getDescription(), "BCM450%c (internal)", &c) == 1 && !it->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp) && tmp != -1)
- {
- FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w");
- if (!f || fwrite("B", 1, 1, f) != 1)
- eDebug("set /proc/stb/tsmux/lnb_b_input to B failed!! (%m)");
- else
- {
- eDebug("set /proc/stb/tsmux/lnb_b_input to B OK");
- fclose(f);
- }
- }
it->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, -1);
it->m_frontend->setData(eDVBFrontend::LINKED_PREV_PTR, -1);
it->m_frontend->setData(eDVBFrontend::LINKED_NEXT_PTR, -1);
char c;
p1->m_frontend->setData(eDVBFrontend::LINKED_PREV_PTR, (long)p2);
p2->m_frontend->setData(eDVBFrontend::LINKED_NEXT_PTR, (long)p1);
- if (!strcmp(p1->m_frontend->getDescription(), p2->m_frontend->getDescription()) && sscanf(p1->m_frontend->getDescription(), "BCM450%c (internal)", &c) == 1)
- {
- FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w");
- if (!f || fwrite("A", 1, 1, f) != 1)
- eDebug("set /proc/stb/tsmux/lnb_b_input to A failed!! (%m)");
- else
- {
- eDebug("set /proc/stb/tsmux/lnb_b_input to A OK");
- fclose(f);
- }
- }
}
p1=p2=NULL;
def setSatposDepends(self, sec, nim1, nim2):
print "tuner", nim1, "depends on satpos of", nim2
sec.setTunerDepends(nim1, nim2)
+
+ def linkInternally(self, slotid):
+ nim = self.NimManager.getNim(slotid)
+ if nim.internallyConnectableTo is not None:
+ nim.setInternalLink()
def linkNIMs(self, sec, nim1, nim2):
print "link tuner", nim1, "to tuner", nim2
+ if nim2 == (nim1 - 1):
+ self.linkInternally(nim1)
sec.setTunerLinked(nim1, nim2)
def getRoot(self, slotid, connto):
def update(self):
sec = secClass.getInstance()
self.configuredSatellites = set()
+ for slotid in self.NimManager.getNimListOfType("DVB-S"):
+ if self.NimManager.nimInternallyConnectableTo(slotid) is not None:
+ self.NimManager.nimRemoveInternalLink(slotid)
sec.clear() ## this do unlinking NIMs too !!
print "sec config cleared"
for slot in nim_slots:
if slot.type is not None:
- used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False, slot.isCompatible("DVB-S2")))
+ used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False, slot.isCompatible("DVB-S2"), slot.frontend_id is None and -1 or slot.frontend_id))
eDVBResourceManager.getInstance().setFrontendSlotInformations(used_nim_slots)
for slot in nim_slots:
self.update()
class NIM(object):
- def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}):
+ def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}, frontend_id = None, i2c = None, is_empty = False):
self.slot = slot
if type not in ("DVB-S", "DVB-C", "DVB-T", "DVB-S2", None):
self.has_outputs = has_outputs
self.internally_connectable = internally_connectable
self.multi_type = multi_type
+ self.i2c = i2c
+ self.frontend_id = frontend_id
+ self.__is_empty = is_empty
def isCompatible(self, what):
+ if not self.isSupported():
+ return False
compatible = {
None: (None,),
"DVB-S": ("DVB-S", None),
def getSlotID(self):
return chr(ord('A') + self.slot)
+ def getI2C(self):
+ return self.i2c
+
def hasOutputs(self):
return self.has_outputs
def internallyConnectableTo(self):
return self.internally_connectable
+ def setInternalLink(self):
+ if self.internally_connectable is not None:
+ print "setting internal link on frontend id", self.frontend_id
+ open("/proc/stb/frontend/%d/rf_switch" % self.frontend_id, "w").write("internal")
+
+ def removeInternalLink(self):
+ if self.internally_connectable is not None:
+ print "removing internal link on frontend id", self.frontend_id
+ open("/proc/stb/frontend/%d/rf_switch" % self.frontend_id, "w").write("external")
+
def isMultiType(self):
return (len(self.multi_type) > 0)
+ def isEmpty(self):
+ return self.__is_empty
+
+ # empty tuners are supported!
+ def isSupported(self):
+ return (self.frontend_id is not None) or self.__is_empty
+
# returns dict {<slotid>: <type>}
def getMultiTypeList(self):
return self.multi_type
if self.empty:
nim_text += _("(empty)")
+ elif not self.isSupported():
+ nim_text += self.description + " (" + _("not supported") + ")"
else:
- nim_text += self.description + " (" + self.friendly_type + ")"
+ nim_text += self.description + " (" + self.friendly_type + ")"
return nim_text
entries[current_slot] = {}
elif line.strip().startswith("Type:"):
entries[current_slot]["type"] = str(line.strip()[6:])
+ entries[current_slot]["isempty"] = False
elif line.strip().startswith("Name:"):
entries[current_slot]["name"] = str(line.strip()[6:])
+ entries[current_slot]["isempty"] = False
elif line.strip().startswith("Has_Outputs:"):
input = str(line.strip()[len("Has_Outputs:") + 1:])
entries[current_slot]["has_outputs"] = (input == "yes")
elif line.strip().startswith("Internally_Connectable:"):
input = int(line.strip()[len("Internally_Connectable:") + 1:])
entries[current_slot]["internally_connectable"] = input
+ elif line.strip().startswith("Frontend_Device:"):
+ input = int(line.strip()[len("Frontend_Device:") + 1:])
+ entries[current_slot]["frontend_device"] = input
elif line.strip().startswith("Mode"):
# "Mode 0: DVB-T" -> ["Mode 0", " DVB-T"]
split = line.strip().split(":")
modes = entries[current_slot].get("multi_type", {})
modes[split2[1]] = split[1].strip()
entries[current_slot]["multi_type"] = modes
+ elif line.strip().startswith("I2C_Device:"):
+ input = int(line.strip()[len("I2C_Device:") + 1:])
+ entries[current_slot]["i2c"] = input
elif line.strip().startswith("empty"):
entries[current_slot]["type"] = None
entries[current_slot]["name"] = _("N/A")
+ entries[current_slot]["isempty"] = True
nimfile.close()
+ from os import path
+
for id, entry in entries.items():
if not (entry.has_key("name") and entry.has_key("type")):
entry["name"] = _("N/A")
entry["type"] = None
+ if not (entry.has_key("i2c")):
+ entry["i2c"] = None
if not (entry.has_key("has_outputs")):
entry["has_outputs"] = True
- if not (entry.has_key("internally_connectable")):
- entry["internally_connectable"] = None
+ if entry.has_key("frontend_device"): # check if internally connectable
+ if path.exists("/proc/stb/frontend/%d/rf_switch" % entry["frontend_device"]):
+ entry["internally_connectable"] = entry["frontend_device"] - 1
+ else:
+ entry["internally_connectable"] = None
+ else:
+ entry["frontend_device"] = entry["internally_connectable"] = None
if not (entry.has_key("multi_type")):
entry["multi_type"] = {}
- self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"]))
+ self.nim_slots.append(NIM(slot = id, description = entry["name"], type = entry["type"], has_outputs = entry["has_outputs"], internally_connectable = entry["internally_connectable"], multi_type = entry["multi_type"], frontend_id = entry["frontend_device"], i2c = entry["i2c"], is_empty = entry["isempty"]))
def hasNimType(self, chktype):
for slot in self.nim_slots:
def getNimName(self, slotid):
return self.nim_slots[slotid].description
+
+ def getNim(self, slotid):
+ return self.nim_slots[slotid]
+
+ def getI2CDevice(self, slotid):
+ return self.nim_slots[slotid].getI2C()
def getNimListOfType(self, type, exception = -1):
# returns a list of indexes for NIMs compatible to the given type, except for 'exception'
def hasOutputs(self, slotid):
return self.nim_slots[slotid].hasOutputs()
+ def nimInternallyConnectableTo(self, slotid):
+ return self.nim_slots[slotid].internallyConnectableTo()
+
+ def nimRemoveInternalLink(self, slotid):
+ self.nim_slots[slotid].removeInternalLink()
+
def canConnectTo(self, slotid):
slots = []
if self.nim_slots[slotid].internallyConnectableTo() is not None:
self.relevantAudioPIDs = [ ]
self.getRelevantAudioPIDs(title)
self.generated_files = [ ]
+ self.mplex_audiofiles = { }
+ self.mplex_videofile = ""
self.mplex_streamfiles = [ ]
if len(self.cutlist) > 1:
self.args += [ "-cut", self.cutfile ]
def haveNewFile(self, file):
print "[DemuxTask] produced file:", file, self.currentPID
self.generated_files.append(file)
- if self.currentPID in self.relevantAudioPIDs or file.endswith("m2v"):
- self.mplex_streamfiles.append(file)
+ if self.currentPID in self.relevantAudioPIDs:
+ self.mplex_audiofiles[self.currentPID] = file
+ elif file.endswith("m2v"):
+ self.mplex_videofile = file
def haveProgress(self, progress):
#print "PROGRESS [%s]" % progress
f.close()
def cleanup(self, failed):
+ print "[DemuxTask::cleanup]"
+ self.mplex_streamfiles = [ self.mplex_videofile ]
+ for pid in self.relevantAudioPIDs:
+ self.mplex_streamfiles.append(self.mplex_audiofiles[pid])
+ print self.mplex_streamfiles
+
if failed:
import os
for file in self.generated_files:
pid = str(i.getPID())
if description == "MPEG":
description = "MP2"
- print "[audiotrack] pid:", pid, "description:", description, "language:", DVB_lang
+ print "[audiotrack] pid:", pid, "description:", description, "language:", DVB_lang, "count:", x, "active:", (x < 8)
self.t.properties.audiotracks.append(ConfigSubsection())
- self.t.properties.audiotracks[-1].active = ConfigYesNo(default = True)
+ self.t.properties.audiotracks[-1].active = ConfigYesNo(default = (x < 8))
self.t.properties.audiotracks[-1].format = ConfigFixedText(description)
self.t.properties.audiotracks[-1].language = ConfigSelection(choices = languageChoices.choices, default=languageChoices.getLanguage(DVB_lang))
self.t.properties.audiotracks[-1].pid = ConfigFixedText(pid)
import sha
from time import time
+rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', '#', '&', '\xce', '\xb3', '\xfe', '\xda', '\xc9', 'U', '`', '\xd8', '\x8c', 's', 'o', '\x90', '\x9b', '\\', 'b', '\xc0', '\x89', '\xd1', '\x8c', '\x9e', 'J', 'T', '\xc5', 'X', '\xa1', '\xb8', '\x13', '5', 'E', '\x02', '\xc9', '\xb2', '\xe6', 't', '\x89', '\xde', '\xcd', '\x9d', '\x11', '\xdd', '\xc7', '\xf4', '\xe4', '\xe4', '\xbc', '\xdb', '\x9c', '\xea', '}', '\xad', '\xda', 't', 'r', '\x9b', '\xdc', '\xbc', '\x18', '3', '\xe7', '\xaf', '|', '\xae', '\x0c', '\xe3', '\xb5', '\x84', '\x8d', '\r', '\x8d', '\x9d', '2', '\xd0', '\xce', '\xd5', 'q', '\t', '\x84', 'c', '\xa8', ')', '\x99', '\xdc', '<', '"', 'x', '\xe8', '\x87', '\x8f', '\x02', ';', 'S', 'm', '\xd5', '\xf0', '\xa3', '_', '\xb7', 'T', '\t', '\xde', '\xa7', '\xf1', '\xc9', '\xae', '\x8a', '\xd7', '\xd2', '\xcf', '\xb2', '.', '\x13', '\xfb', '\xac', 'j', '\xdf', '\xb1', '\x1d', ':', '?']
def bin2long(s):
return reduce( lambda x,y:(x<<8L)+y, map(ord, s))
def checkNetworkCB(self,data):
if data is not None:
if data <= 2:
- SoftwareTools.NetworkConnectionAvailable = True
+ self.NetworkConnectionAvailable = True
self.getUpdates()
else:
- SoftwareTools.NetworkConnectionAvailable = False
+ self.NetworkConnectionAvailable = False
self.getUpdates()
def getUpdates(self, callback = None):
- if SoftwareTools.lastDownloadDate is None:
+ if self.lastDownloadDate is None:
if self.hardware_info.device_name != "dm7025":
- rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', '#', '&', '\xce', '\xb3', '\xfe', '\xda', '\xc9', 'U', '`', '\xd8', '\x8c', 's', 'o', '\x90', '\x9b', '\\', 'b', '\xc0', '\x89', '\xd1', '\x8c', '\x9e', 'J', 'T', '\xc5', 'X', '\xa1', '\xb8', '\x13', '5', 'E', '\x02', '\xc9', '\xb2', '\xe6', 't', '\x89', '\xde', '\xcd', '\x9d', '\x11', '\xdd', '\xc7', '\xf4', '\xe4', '\xe4', '\xbc', '\xdb', '\x9c', '\xea', '}', '\xad', '\xda', 't', 'r', '\x9b', '\xdc', '\xbc', '\x18', '3', '\xe7', '\xaf', '|', '\xae', '\x0c', '\xe3', '\xb5', '\x84', '\x8d', '\r', '\x8d', '\x9d', '2', '\xd0', '\xce', '\xd5', 'q', '\t', '\x84', 'c', '\xa8', ')', '\x99', '\xdc', '<', '"', 'x', '\xe8', '\x87', '\x8f', '\x02', ';', 'S', 'm', '\xd5', '\xf0', '\xa3', '_', '\xb7', 'T', '\t', '\xde', '\xa7', '\xf1', '\xc9', '\xae', '\x8a', '\xd7', '\xd2', '\xcf', '\xb2', '.', '\x13', '\xfb', '\xac', 'j', '\xdf', '\xb1', '\x1d', ':', '?']
etpm = eTPM()
l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
if l2cert is None:
return
l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
if l3cert is None:
- print "please run the genuine dreambox plugin"
return
l3key = validate_cert(l3cert, l2key)
if l3key is None:
val = etpm.challenge(rnd)
result = decrypt_block(val, l3key)
if self.hardware_info.device_name == "dm7025" or result[80:88] == rnd:
- if SoftwareTools.NetworkConnectionAvailable == True:
- SoftwareTools.lastDownloadDate = time()
- if SoftwareTools.list_updating is False and callback is None:
- SoftwareTools.list_updating = True
+ if self.NetworkConnectionAvailable == True:
+ self.lastDownloadDate = time()
+ if self.list_updating is False and callback is None:
+ self.list_updating = True
self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
- elif SoftwareTools.list_updating is False and callback is not None:
- SoftwareTools.list_updating = True
+ elif self.list_updating is False and callback is not None:
+ self.list_updating = True
self.NotifierCallback = callback
self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
- elif SoftwareTools.list_updating is True and callback is not None:
+ elif self.list_updating is True and callback is not None:
self.NotifierCallback = callback
else:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if callback is not None:
callback(False)
elif self.NotifierCallback is not None:
self.NotifierCallback(False)
else:
- SoftwareTools.NetworkConnectionAvailable = False
- SoftwareTools.list_updating = False
+ self.NetworkConnectionAvailable = False
+ self.list_updating = False
if callback is not None:
callback(False)
elif self.NotifierCallback is not None:
self.NotifierCallback(False)
else:
- if SoftwareTools.NetworkConnectionAvailable == True:
- SoftwareTools.lastDownloadDate = time()
- if SoftwareTools.list_updating is False and callback is None:
- SoftwareTools.list_updating = True
+ if self.NetworkConnectionAvailable == True:
+ self.lastDownloadDate = time()
+ if self.list_updating is False and callback is None:
+ self.list_updating = True
self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
- elif SoftwareTools.list_updating is False and callback is not None:
- SoftwareTools.list_updating = True
+ elif self.list_updating is False and callback is not None:
+ self.list_updating = True
self.NotifierCallback = callback
self.ipkg.startCmd(IpkgComponent.CMD_UPDATE)
- elif SoftwareTools.list_updating is True and callback is not None:
+ elif self.list_updating is True and callback is not None:
self.NotifierCallback = callback
else:
- SoftwareTools.list_updating = False
- if callback is not None:
- callback(False)
- elif self.NotifierCallback is not None:
- self.NotifierCallback(False)
+ if self.list_updating and callback is not None:
+ if self.hardware_info.device_name != "dm7025":
+ etpm = eTPM()
+ l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT)
+ if l2cert is None:
+ return
+ l2key = validate_cert(l2cert, rootkey)
+ if l2key is None:
+ return
+ l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT)
+ if l3cert is None:
+ return
+ l3key = validate_cert(l3cert, l2key)
+ if l3key is None:
+ return
+ rnd = read_random()
+ if rnd is None:
+ return
+ val = etpm.challenge(rnd)
+ result = decrypt_block(val, l3key)
+ if self.hardware_info.device_name == "dm7025" or result[80:88] == rnd:
+ self.NotifierCallback = callback
+ self.startIpkgListAvailable()
+ else:
+ self.list_updating = False
+ if callback is not None:
+ callback(False)
+ elif self.NotifierCallback is not None:
+ self.NotifierCallback(False)
def ipkgCallback(self, event, param):
if event == IpkgComponent.EVENT_ERROR:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.NotifierCallback is not None:
self.NotifierCallback(False)
elif event == IpkgComponent.EVENT_DONE:
- if SoftwareTools.list_updating:
+ if self.list_updating:
self.startIpkgListAvailable()
#print event, "-", param
pass
def startIpkgListAvailable(self, callback = None):
if callback is not None:
- SoftwareTools.list_updating = True
- if SoftwareTools.list_updating:
+ self.list_updating = True
+ if self.list_updating:
if not self.UpdateConsole:
self.UpdateConsole = Console()
cmd = "ipkg list"
def IpkgListAvailableCB(self, result, retval, extra_args = None):
(callback) = extra_args
if result:
- if SoftwareTools.list_updating:
- SoftwareTools.available_packetlist = []
+ if self.list_updating:
+ self.available_packetlist = []
for x in result.splitlines():
tokens = x.split(' - ')
name = tokens[0].strip()
l = len(tokens)
version = l > 1 and tokens[1].strip() or ""
descr = l > 2 and tokens[2].strip() or ""
- SoftwareTools.available_packetlist.append([name, version, descr])
+ self.available_packetlist.append([name, version, descr])
if callback is None:
self.startInstallMetaPackage()
else:
if len(self.UpdateConsole.appContainers) == 0:
callback(True)
else:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.UpdateConsole:
if len(self.UpdateConsole.appContainers) == 0:
if callback is not None:
def startInstallMetaPackage(self, callback = None):
if callback is not None:
- SoftwareTools.list_updating = True
- if SoftwareTools.list_updating:
- if not self.UpdateConsole:
- self.UpdateConsole = Console()
- cmd = "ipkg install enigma2-meta enigma2-plugins-meta enigma2-skins-meta"
- self.UpdateConsole.ePopen(cmd, self.InstallMetaPackageCB, callback)
+ self.list_updating = True
+ if self.list_updating:
+ if self.NetworkConnectionAvailable == True:
+ if not self.UpdateConsole:
+ self.UpdateConsole = Console()
+ cmd = "ipkg install enigma2-meta enigma2-plugins-meta enigma2-skins-meta"
+ self.UpdateConsole.ePopen(cmd, self.InstallMetaPackageCB, callback)
+ else:
+ self.InstallMetaPackageCB(True)
- def InstallMetaPackageCB(self, result, retval, extra_args = None):
+ def InstallMetaPackageCB(self, result, retval = None, extra_args = None):
(callback) = extra_args
if result:
self.fillPackagesIndexList()
if len(self.UpdateConsole.appContainers) == 0:
callback(True)
else:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.UpdateConsole:
if len(self.UpdateConsole.appContainers) == 0:
if callback is not None:
callback(False)
def startIpkgListInstalled(self, callback = None):
+ print "STARTIPKGLISTINSTALLED"
if callback is not None:
- SoftwareTools.list_updating = True
- if SoftwareTools.list_updating:
+ self.list_updating = True
+ if self.list_updating:
if not self.UpdateConsole:
self.UpdateConsole = Console()
cmd = "ipkg list_installed"
def IpkgListInstalledCB(self, result, retval, extra_args = None):
(callback) = extra_args
if result:
- SoftwareTools.installed_packetlist = {}
+ self.installed_packetlist = {}
for x in result.splitlines():
tokens = x.split(' - ')
name = tokens[0].strip()
if not any(name.endswith(x) for x in self.unwanted_extensions):
l = len(tokens)
version = l > 1 and tokens[1].strip() or ""
- SoftwareTools.installed_packetlist[name] = version
+ self.installed_packetlist[name] = version
for package in self.packagesIndexlist[:]:
if not self.verifyPrerequisites(package[0]["prerequisites"]):
self.packagesIndexlist.remove(package)
if len(self.UpdateConsole.appContainers) == 0:
callback(True)
else:
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.UpdateConsole:
if len(self.UpdateConsole.appContainers) == 0:
if callback is not None:
callback(False)
def countUpdates(self, callback = None):
- SoftwareTools.available_updates = 0
- SoftwareTools.available_updatelist = []
+ self.available_updates = 0
+ self.available_updatelist = []
for package in self.packagesIndexlist[:]:
attributes = package[0]["attributes"]
packagename = attributes["packagename"]
- for x in SoftwareTools.available_packetlist:
+ for x in self.available_packetlist:
if x[0] == packagename:
- if SoftwareTools.installed_packetlist.has_key(packagename):
- if SoftwareTools.installed_packetlist[packagename] != x[1]:
- SoftwareTools.available_updates +=1
- SoftwareTools.available_updatelist.append([packagename])
+ if self.installed_packetlist.has_key(packagename):
+ if self.installed_packetlist[packagename] != x[1]:
+ self.available_updates +=1
+ self.available_updatelist.append([packagename])
- SoftwareTools.list_updating = False
+ self.list_updating = False
if self.UpdateConsole:
if len(self.UpdateConsole.appContainers) == 0:
if callback is not None:
statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/upgrade.png"))
self.statuslist.append(( _("Package list update"), '', _("Searching for new installed or removed packages. Please wait..." ),'', '', statuspng, divpng, None, '' ))
elif status == 'error':
+ self["key_green"].setText(_("Continue"))
statuspng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/remove.png"))
self.statuslist.append(( _("Error"), '', _("There was an error downloading the packetlist. Please try again." ),'', '', statuspng, divpng, None, '' ))
self["list"].style = "default"
def getUpdateInfos(self):
- self.setState('update')
- iSoftwareTools.startSoftwareTools(self.getUpdateInfosCB)
+ if (iSoftwareTools.lastDownloadDate is not None and iSoftwareTools.NetworkConnectionAvailable is False):
+ self.rebuildList()
+ else:
+ self.setState('update')
+ iSoftwareTools.startSoftwareTools(self.getUpdateInfosCB)
def getUpdateInfosCB(self, retval = None):
if retval is not None:
self["status"].setText(_("There are no updates available."))
self.rebuildList()
elif retval is False:
- self.setState('error')
- if iSoftwareTools.NetworkConnectionAvailable:
- self["status"].setText(_("Updatefeed not available."))
+ if iSoftwareTools.lastDownloadDate is None:
+ self.setState('error')
+ if iSoftwareTools.NetworkConnectionAvailable:
+ self["status"].setText(_("Updatefeed not available."))
+ else:
+ self["status"].setText(_("No network connection available."))
else:
- self["status"].setText(_("No network connection available."))
+ iSoftwareTools.lastDownloadDate = time()
+ iSoftwareTools.list_updating = True
+ self.setState('update')
+ iSoftwareTools.getUpdates(self.getUpdateInfosCB)
def rebuildList(self, retval = None):
if self.currentSelectedTag is None:
self["key_green"].setText(_("Uninstall"))
elif current[4] == 'installable':
self["key_green"].setText(_("Install"))
+ if iSoftwareTools.NetworkConnectionAvailable is False:
+ self["key_green"].setText("")
elif current[4] == 'remove':
self["key_green"].setText(_("Undo uninstall"))
elif current[4] == 'install':
self["key_green"].setText(_("Undo install"))
+ if iSoftwareTools.NetworkConnectionAvailable is False:
+ self["key_green"].setText("")
self["key_yellow"].setText(_("View details"))
self["key_blue"].setText("")
if len(self.selectedFiles) == 0 and iSoftwareTools.available_updates is not 0:
if entry[0] == detailsFile:
alreadyinList = True
if not alreadyinList:
- self.selectedFiles.append((detailsFile,current[4],current[3]))
- self.currentSelectedPackage = ((detailsFile,current[4],current[3]))
+ if (iSoftwareTools.NetworkConnectionAvailable is False and current[4] in ('installable','install')):
+ pass
+ else:
+ self.selectedFiles.append((detailsFile,current[4],current[3]))
+ self.currentSelectedPackage = ((detailsFile,current[4],current[3]))
if current[4] == 'installed':
self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'remove', True)
elif current[4] == 'installable':
- self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'install', True)
+ if iSoftwareTools.NetworkConnectionAvailable:
+ self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'install', True)
elif current[4] == 'remove':
self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'installed', False)
elif current[4] == 'install':
- self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'installable',False)
+ if iSoftwareTools.NetworkConnectionAvailable:
+ self.list[idx] = self.buildEntryComponent(current[0], current[1], current[2], current[3], 'installable',False)
self["list"].setList(self.list)
self["list"].setIndex(idx)
self["list"].updateList(self.list)
self.selectionChanged()
-
+ elif self.currList == "status":
+ iSoftwareTools.lastDownloadDate = time()
+ iSoftwareTools.list_updating = True
+ self.setState('update')
+ iSoftwareTools.getUpdates(self.getUpdateInfosCB)
+
def handleSelected(self):
current = self["list"].getCurrent()
if current:
self["author"].setText(_("Author: ") + self.author)
self["detailtext"].setText(_(self.description))
if self.pluginstate in ('installable', 'install'):
- self["key_green"].setText(_("Install"))
+ if iSoftwareTools.NetworkConnectionAvailable:
+ self["key_green"].setText(_("Install"))
+ else:
+ self["key_green"].setText("")
else:
self["key_green"].setText(_("Remove"))
if thumbnailUrl is not None:
self.thumbnail = "/tmp/" + thumbnailUrl.split('/')[-1]
print "[PluginDetails] downloading screenshot " + thumbnailUrl + " to " + self.thumbnail
- client.downloadPage(thumbnailUrl,self.thumbnail).addCallback(self.setThumbnail).addErrback(self.fetchFailed)
+ if iSoftwareTools.NetworkConnectionAvailable:
+ client.downloadPage(thumbnailUrl,self.thumbnail).addCallback(self.setThumbnail).addErrback(self.fetchFailed)
+ else:
+ self.setThumbnail(noScreenshot = True)
else:
self.setThumbnail(noScreenshot = True)
if len(self.cmdList):
self.session.openWithCallback(self.runRemove, MessageBox, _("Do you want to remove the package:\n") + self.pluginname + "\n" + self.oktext)
else:
- if self.packagefiles:
- for package in self.packagefiles[:]:
- self.cmdList.append((IpkgComponent.CMD_INSTALL, { "package": package["name"] }))
- if len(self.cmdList):
- self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to install the package:\n") + self.pluginname + "\n" + self.oktext)
+ if iSoftwareTools.NetworkConnectionAvailable:
+ if self.packagefiles:
+ for package in self.packagefiles[:]:
+ self.cmdList.append((IpkgComponent.CMD_INSTALL, { "package": package["name"] }))
+ if len(self.cmdList):
+ self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to install the package:\n") + self.pluginname + "\n" + self.oktext)
def runUpgrade(self, result):
if result:
<widget name="activityslider" position="0,0" size="550,5" />
<widget name="slider" position="0,150" size="550,30" />
<widget source="package" render="Label" position="10,30" size="540,20" font="Regular;18" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
- <widget source="status" render="Label" position="10,60" size="540,45" font="Regular;20" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
+ <widget source="status" render="Label" position="10,180" size="540,100" font="Regular;20" halign="center" valign="center" backgroundColor="#25062748" transparent="1" />
</screen>"""
def __init__(self, session, args = None):
self.activityTimer.stop()
self.activityslider.setValue(0)
- self.package.setText("")
- self.status.setText(_("Done - Installed or upgraded %d packages") % self.packages + "\n\n" + self.oktext)
+ self.package.setText(_("Done - Installed or upgraded %d packages") % self.packages)
+ self.status.setText(self.oktext)
else:
self.activityTimer.stop()
self.activityslider.setValue(0)
#self.list.append(getConfigListEntry(_("Configuration mode"), config.ParentalControl.mode))
self.list.append(getConfigListEntry(_("Protect setup"), config.ParentalControl.setuppinactive))
if config.ParentalControl.setuppinactive.value:
- self.changeSetupPin = getConfigListEntry(_("Change setup pin"), NoSave(ConfigNothing()))
+ self.changeSetupPin = getConfigListEntry(_("Change setup PIN"), NoSave(ConfigNothing()))
self.list.append(self.changeSetupPin)
self.list.append(getConfigListEntry(_("Protect services"), config.ParentalControl.servicepinactive))
if config.ParentalControl.servicepinactive.value:
self.list.append(getConfigListEntry(_("Parental control type"), config.ParentalControl.type))
if config.ParentalControl.mode.value == "complex":
- self.changePin = getConfigListEntry(_("Change service pins"), NoSave(ConfigNothing()))
+ self.changePin = getConfigListEntry(_("Change service PINs"), NoSave(ConfigNothing()))
self.list.append(self.changePin)
elif config.ParentalControl.mode.value == "simple":
- self.changePin = getConfigListEntry(_("Change service pin"), NoSave(ConfigNothing()))
+ self.changePin = getConfigListEntry(_("Change service PIN"), NoSave(ConfigNothing()))
self.list.append(self.changePin)
#Added Option to remember the service pin
- self.list.append(getConfigListEntry(_("Remember service pin"), config.ParentalControl.storeservicepin))
+ self.list.append(getConfigListEntry(_("Remember service PIN"), config.ParentalControl.storeservicepin))
#Added Option to remember the cancellation of service pin entry
- self.list.append(getConfigListEntry(_("Remember service pin cancel"), config.ParentalControl.storeservicepincancel))
+ self.list.append(getConfigListEntry(_("Remember service PIN cancel"), config.ParentalControl.storeservicepincancel))
self.editListEntry = getConfigListEntry(_("Edit services list"), NoSave(ConfigNothing()))
self.list.append(self.editListEntry)
#New funtion: Possibility to add Bouquets to whitelist / blacklist
if config.ParentalControl.mode.value == "complex":
pass
else:
- self.session.open(ParentalControlChangePin, config.ParentalControl.servicepin[0], _("service pin"))
+ self.session.open(ParentalControlChangePin, config.ParentalControl.servicepin[0], _("service PIN"))
elif self["config"].l.getCurrentSelection() == self.changeSetupPin:
- self.session.open(ParentalControlChangePin, config.ParentalControl.setuppin, _("setup pin"))
+ self.session.open(ParentalControlChangePin, config.ParentalControl.setuppin, _("setup PIN"))
elif self["config"].l.getCurrentSelection() == self.reloadLists:
parentalControl.open()
else:
def SetupPinMessageCallback(self, value):
if value:
- self.session.openWithCallback(self.cancelCB, ParentalControlChangePin, config.ParentalControl.setuppin, _("setup pin"))
+ self.session.openWithCallback(self.cancelCB, ParentalControlChangePin, config.ParentalControl.setuppin, _("setup PIN"))
else:
config.ParentalControl.setuppinactive.value = False
self.keyCancel()
def ServicePinMessageCallback(self, value):
if value:
- self.session.openWithCallback(self.cancelCB, ParentalControlChangePin, config.ParentalControl.servicepin[0], _("service pin"))
+ self.session.openWithCallback(self.cancelCB, ParentalControlChangePin, config.ParentalControl.servicepin[0], _("service PIN"))
else:
config.ParentalControl.servicepinactive.value = False
self.keyCancel()
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)))
+ 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.keyOK()
def getPinText(self):
- return _("Please enter the old pin code")
+ return _("Please enter the old PIN code")
def isProtected(self):
return (self.pin.value != "aaaa")
if self.pin1.value == self.pin2.value:
self.pin.value = self.pin1.value
self.pin.save()
- self.session.openWithCallback(self.close, MessageBox, _("The pin code has been changed successfully."), MessageBox.TYPE_INFO)
+ self.session.openWithCallback(self.close, MessageBox, _("The PIN code has been changed successfully."), MessageBox.TYPE_INFO)
else:
- self.session.open(MessageBox, _("The pin codes you entered are different."), MessageBox.TYPE_ERROR)
+ self.session.open(MessageBox, _("The PIN codes you entered are different."), MessageBox.TYPE_ERROR)
def cancel(self):
self.close(None)
def okbuttonClick(self):
nim = self["nimlist"].getCurrent()
nim = nim and nim[3]
- if nim is not None and not nim.empty:
+ if nim is not None and not nim.empty and nim.isSupported():
self.session.openWithCallback(self.updateList, self.resultclass, nim.slot)
def showNim(self, nim):
text = _("enabled")
if x.isMultiType():
text = _("Switchable tuner types:") + "(" + ','.join(x.getMultiTypeList().values()) + ")" + "\n" + text
+ if not x.isSupported():
+ text = _("tuner is not supported")
self.list.append((slotid, x.friendly_full_description, text, x))
self["nimlist"].setList(self.list)
self.cable_search_container.dataAvail.append(self.getCableTransponderData)
cableConfig = config.Nims[nim_idx].cable
tunername = nimmanager.getNimName(nim_idx)
+ bus = nimmanager.getI2CDevice(nim_idx)
+ if bus is None:
+ print "ERROR: could not get I2C device for nim", nim_idx, "for cable transponder search"
+ bus = 2
+
if tunername == "CXD1981":
- cmd = "cxd1978 --init --scan --verbose --wakeup --inv 2 --bus "
- else:
- cmd = "tda1002x --init --scan --verbose --wakeup --inv 2 --bus "
- #FIXMEEEEEE hardcoded i2c devices for dm7025 and dm8000
- if nim_idx < 2:
- if HardwareInfo().get_device_name() == "dm500hd":
- cmd += "2"
- else:
- cmd += str(nim_idx)
+ cmd = "cxd1978 --init --scan --verbose --wakeup --inv 2 --bus %d" % bus
else:
- if nim_idx == 2:
- cmd += "2" # first nim socket on DM8000 use /dev/i2c/2
- else:
- cmd += "4" # second nim socket on DM8000 use /dev/i2c/4
+ cmd = "tda1002x --init --scan --verbose --wakeup --inv 2 --bus %d" % bus
+
if cableConfig.scan_type.value == "bands":
cmd += " --scan-bands "
bands = 0