rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
self.updating = True self.package.setText(_("Package list update")) self.ipkg.startCmd(IpkgComponent.CMD_UPDATE) | self.updating = False | def __init__(self, session, args = None): Screen.__init__(self, session) |
rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', ' | device = HardwareInfo().get_device_name() if device != "dm7025": rootkey = ['\x9f', '|', '\xe4', 'G', '\xc9', '\xb4', '\xf4', ' etpm = eTPM() l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT) if l2cert is None: print "l2cert not found" return | def main(session, **kwargs): 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', '\xb... |
etpm = eTPM() l2cert = etpm.getCert(eTPM.TPMD_DT_LEVEL2_CERT) if l2cert is None: print "l2cert not found" return l2key = validate_cert(l2cert, rootkey) if l2key is None: print "l2cert invalid" return l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT) if l3cert is None: print "l3cert not found (can be fixed by running th... | l2key = validate_cert(l2cert, rootkey) if l2key is None: print "l2cert invalid" return l3cert = etpm.getCert(eTPM.TPMD_DT_LEVEL3_CERT) if l3cert is None: print "l3cert not found (can be fixed by running the genuine dreambox plugin and running the offered update)" return l3key = validate_cert(l3cert, l2key) if l3key i... | def main(session, **kwargs): 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', '\xb... |
self.ask_time=ret[1] | tmp = ret[1] % 900 self.ask_time = ret[1] - tmp | def onDateTimeInputClosed(self, ret): if len(ret) > 1: if ret[0]: self.ask_time=ret[1] l = self["list"] l.resetOffset() l.fillMultiEPG(self.services, ret[1]) self.moveTimeLines(True) |
l.fillMultiEPG(self.services, ret[1]) | l.fillMultiEPG(self.services, self.ask_time) | def onDateTimeInputClosed(self, ret): if len(ret) > 1: if ret[0]: self.ask_time=ret[1] l = self["list"] l.resetOffset() l.fillMultiEPG(self.services, ret[1]) self.moveTimeLines(True) |
self.setTimeout() | def __init__(self, session, scanList): Screen.__init__(self, session) self.scanList = scanList self.session.nav.stopService() self["scan_progress"] = ProgressBar() self["scan_state"] = Label(_("scan state")) self["network"] = Label() self["transponder"] = Label() | |
self.bflag = 1 self.eflag = -1 | self.bflag = -1 self.eflag = 1 | def __init__(self, timerlist, newtimer=None): print "sanitycheck" self.localtimediff = 25*3600 - mktime(gmtime(25*3600)) self.timerlist = timerlist self.newtimer = newtimer self.simultimer = [] self.rep_eventlist = [] self.nrep_eventlist = [] self.bflag = 1 self.eflag = -1 |
cmd = "/bin/umount" | cmd = "umount" | def unmount(self): try: mounts = open("/proc/mounts") except IOError: return -1 |
cmd = 'printf "0,\n;\n;\n;\ny\n" | /sbin/sfdisk -f ' + self.disk_path | cmd = 'printf "0,\n;\n;\n;\ny\n" | sfdisk -f ' + self.disk_path | def createPartition(self): cmd = 'printf "0,\n;\n;\n;\ny\n" | /sbin/sfdisk -f ' + self.disk_path res = system(cmd) return (res >> 8) |
cmd = "/sbin/mkfs.ext3 " | cmd = "mkfs.ext3 " | def mkfs(self): cmd = "/sbin/mkfs.ext3 " if self.diskSize() > 4 * 1024: cmd += "-T largefile " cmd += "-m0 -O dir_index " + self.partitionPath("1") res = system(cmd) return (res >> 8) |
cmd = "/bin/mount -t ext3 " + parts[0] | cmd = "mount -t ext3 " + parts[0] | def mount(self): try: fstab = open("/etc/fstab") except IOError: return -1 |
cmd = "/sbin/fsck.ext3 -f -p " + self.partitionPath("1") | cmd = "fsck.ext3 -f -p " + self.partitionPath("1") | def fsck(self): # We autocorrect any failures # TODO: we could check if the fs is actually ext3 cmd = "/sbin/fsck.ext3 -f -p " + self.partitionPath("1") res = system(cmd) return (res >> 8) |
cmd = '/bin/dd bs=512 count=3 if=/dev/zero of=' + part | cmd = 'dd bs=512 count=3 if=/dev/zero of=' + part | def killPartition(self, n): part = self.partitionPath(n) |
parentalControl = ParentalControl() | def open(self): self.openListFromFile(LIST_BLACKLIST) self.openListFromFile(LIST_WHITELIST) | |
if len(plugin) == 3: if self.run == 1 and self.type == self.DOWNLOAD: if plugin[0] not in self.installedplugins: self.installedplugins.append(plugin[0]) else: if plugin[0] not in self.installedplugins: plugin.append(plugin[0][15:]) self.pluginlist.append(plugin) | if len(plugin) >= 2: if not plugin[0].endswith('-dev') and not plugin[0].endswith('-dbg'): if self.run == 1 and self.type == self.DOWNLOAD: if plugin[0] not in self.installedplugins: self.installedplugins.append(plugin[0]) else: if plugin[0] not in self.installedplugins: if len(plugin) == 2: plugin.append('') plugin.a... | def dataAvail(self, str): #prepend any remaining data from the previous call str = self.remainingdata + str #split in lines lines = str.split('\n') #'str' should end with '\n', so when splitting, the last line should be empty. If this is not the case, we received an incomplete line if len(lines[-1]): #remember this dat... |
if not x[3].endswith('-dev') and not x[3].endswith('-dbg'): self.plugins[split[0]].append((PluginDescriptor(name = x[3], description = x[2], icon = verticallineIcon), split[1], x[1])) | self.plugins[split[0]].append((PluginDescriptor(name = x[3], description = x[2], icon = verticallineIcon), split[1], x[1])) | def updateList(self): list = [] expandableIcon = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/expandable-plugins.png")) expandedIcon = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/expanded-plugins.png")) verticallineIcon = LoadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, "skin_default/verticalli... |
self["portpic"].instance.setPixmapFromFile(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/" + self.selection + ".png")) | picname = self.selection if picname == "DVI" and HardwareInfo().get_device_name() == "dm500hd": picname = "HDMI" self["portpic"].instance.setPixmapFromFile(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/" + picname + ".png")) | def inputSelectionMoved(self): print "input selection moved:", self.selection self.inputSelect(self.selection) if self["portpic"].instance is not None: self["portpic"].instance.setPixmapFromFile(resolveFilename(SCOPE_PLUGINS, "SystemPlugins/Videomode/" + self.selection + ".png")) |
if task.cmd[0]=='/': realpath = task.cmd else: realpath = task.cwd + '/' + task.cmd self.realpath = realpath return os.access(realpath, os.X_OK) | self.realpath = task.cmd path = os.environ.get('PATH', '').split(os.pathsep) absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file = task.cmd: os.path.join(directory, file), path)) if len(absolutes) > 0: self.realpath = task.cmd[0] return True return False | def check(self, task): import os if task.cmd[0]=='/': realpath = task.cmd else: realpath = task.cwd + '/' + task.cmd self.realpath = realpath return os.access(realpath, os.X_OK) |
self["title_label"].text = _("Please add titles to the compilation") | self["title_label"].text = _("Please add titles to the compilation.") | def updateTitleList(self): list = [ ] for title in self.project.titles: list.append((title, title.properties.menutitle.getValue(), title.properties.menusubtitle.getValue(), title.DVBchannel, title.formatDVDmenuText("$D.$M.$Y, $T", 0), title.formatDVDmenuText("$l", 0))) self["titles"].list = list self.updateSize() if le... |
self["medium_label"].setText(_("exceeds dual layer medium!")) | self["medium_label"].setText(_("Exceeds dual layer medium!")) | def updateSize(self): size = self.project.size/(1024*1024) MAX_DL = self.project.MAX_DL-100 MAX_SL = self.project.MAX_SL-100 print "updateSize:", size, "MAX_DL:", MAX_DL, "MAX_SL:", MAX_SL if size > MAX_DL: percent = 100 * size / float(MAX_DL) self["space_label_dual"].text = "%d MB (%.2f%%)" % (size, percent) self["spa... |
self.session.open(MessageBox,text = _("exceeds dual layer medium!"), type = MessageBox.TYPE_ERROR) | self.session.open(MessageBox,text = _("Exceeds dual layer medium!"), type = MessageBox.TYPE_ERROR) | def updateSize(self): size = self.project.size/(1024*1024) MAX_DL = self.project.MAX_DL-100 MAX_SL = self.project.MAX_SL-100 print "updateSize:", size, "MAX_DL:", MAX_DL, "MAX_SL:", MAX_SL if size > MAX_DL: percent = 100 * size / float(MAX_DL) self["space_label_dual"].text = "%d MB (%.2f%%)" % (size, percent) self["spa... |
self["medium_label"].setText(_("required medium type:") + " " + _("DUAL LAYER DVD") + ", %d MB " % (MAX_DL - size) + _("free")) | self["medium_label"].setText(_("Required medium type:") + " " + _("DUAL LAYER DVD") + ", %d MB " % (MAX_DL - size) + _("free")) | def updateSize(self): size = self.project.size/(1024*1024) MAX_DL = self.project.MAX_DL-100 MAX_SL = self.project.MAX_SL-100 print "updateSize:", size, "MAX_DL:", MAX_DL, "MAX_SL:", MAX_SL if size > MAX_DL: percent = 100 * size / float(MAX_DL) self["space_label_dual"].text = "%d MB (%.2f%%)" % (size, percent) self["spa... |
self["medium_label"].setText(_("required medium type:") + " " + _("SINGLE LAYER DVD") + ", %d MB " % (MAX_SL - size) + _("free")) | self["medium_label"].setText(_("Required medium type:") + " " + _("SINGLE LAYER DVD") + ", %d MB " % (MAX_SL - size) + _("free")) | def updateSize(self): size = self.project.size/(1024*1024) MAX_DL = self.project.MAX_DL-100 MAX_SL = self.project.MAX_SL-100 print "updateSize:", size, "MAX_DL:", MAX_DL, "MAX_SL:", MAX_SL if size > MAX_DL: percent = 100 * size / float(MAX_DL) self["space_label_dual"].text = "%d MB (%.2f%%)" % (size, percent) self["spa... |
self.clearPath() re = compile('.+?;') tmp = re.findall(self.lastroot.value) cnt = 0 for i in tmp: self.servicePath.append(eServiceReference(i[:-1])) cnt += 1 if cnt: path = self.servicePath.pop() self.enterPath(path) else: self.showFavourites() self.saveRoot() | tmp = [x for x in self.lastroot.value.split(';') if x != ''] current = [x.toString() for x in self.servicePath] if tmp != current or self.rootChanged: self.clearPath() cnt = 0 for i in tmp: self.servicePath.append(eServiceReference(i)) cnt += 1 if cnt: path = self.servicePath.pop() self.enterPath(path) else: self.showF... | def restoreRoot(self): self.clearPath() re = compile('.+?;') tmp = re.findall(self.lastroot.value) cnt = 0 for i in tmp: self.servicePath.append(eServiceReference(i[:-1])) cnt += 1 if cnt: path = self.servicePath.pop() self.enterPath(path) else: self.showFavourites() self.saveRoot() |
self.clearPath() re = compile('.+?;') tmp = re.findall(config.radio.lastroot.value) cnt = 0 for i in tmp: self.servicePathRadio.append(eServiceReference(i[:-1])) cnt += 1 if cnt: path = self.servicePathRadio.pop() self.enterPath(path) else: self.showFavourites() self.saveRoot() | tmp = [x for x in self.lastroot.value.split(';') if x != ''] current = [x.toString() for x in self.servicePath] if tmp != current or self.rootChanged: cnt = 0 for i in tmp: self.servicePathRadio.append(eServiceReference(i)) cnt += 1 if cnt: path = self.servicePathRadio.pop() self.enterPath(path) else: self.showFavourit... | def restoreRoot(self): self.clearPath() re = compile('.+?;') tmp = re.findall(config.radio.lastroot.value) cnt = 0 for i in tmp: self.servicePathRadio.append(eServiceReference(i[:-1])) cnt += 1 if cnt: path = self.servicePathRadio.pop() self.enterPath(path) else: self.showFavourites() self.saveRoot() |
self.lastChannelRootTimer = eTimer() self.lastChannelRootTimer.callback.append(self.__onCreate) self.lastChannelRootTimer.start(100,True) | def __init__(self, session): ChannelSelectionBase.__init__(self,session) ChannelSelectionEdit.__init__(self) ChannelSelectionEPG.__init__(self) SelectionEventInfo.__init__(self) | |
manufacturer_name = currLnb.unicableMatrixManufacturer.value manufacturer = currLnb.unicableMatrix[manufacturer_name] product_name = manufacturer.product.value sec.setLNBSatCR(manufacturer.scr[product_name].index) sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000) sec.se... | setupUnicable(currLnb.unicableMatrixManufacturer, currLnb.unicableMatrix) | def updateAdvanced(self, sec, slotid): try: if config.Nims[slotid].advanced.unicableconnected is not None: if config.Nims[slotid].advanced.unicableconnected.value == True: config.Nims[slotid].advanced.unicableconnectedTo.save_forced = True self.linkNIMs(sec, slotid, int(config.Nims[slotid].advanced.unicableconnectedTo.... |
manufacturer_name = currLnb.unicableLnbManufacturer.value manufacturer = currLnb.unicableLnb[manufacturer_name] product_name = manufacturer.product.value sec.setLNBSatCR(manufacturer.scr[product_name].index) sec.setLNBSatCRvco(manufacturer.vco[product_name][manufacturer.scr[product_name].index].value*1000) sec.setLNBSa... | setupUnicable(currLnb.unicableLnbManufacturer, currLnb.unicableLnb) | def updateAdvanced(self, sec, slotid): try: if config.Nims[slotid].advanced.unicableconnected is not None: if config.Nims[slotid].advanced.unicableconnected.value == True: config.Nims[slotid].advanced.unicableconnectedTo.save_forced = True self.linkNIMs(sec, slotid, int(config.Nims[slotid].advanced.unicableconnectedTo.... |
if lnb < 3: section.unicableMatrix = ConfigSubDict() section.unicableMatrixManufacturer = ConfigSelection(choices = UnicableMatrixManufacturers, default = UnicableMatrixManufacturers[0]) for y in unicablematrixproducts: products = unicablematrixproducts[y].keys() products.sort() tmp = ConfigSubsection() tmp.product = C... | def fillUnicableConf(sectionDict, unicableproducts, vco_null_check): for y in unicableproducts: products = unicableproducts[y].keys() | def configLOFChanged(configElement): if configElement.value == "unicable": x = configElement.slot_id lnb = configElement.lnb_id nim = config.Nims[x] lnbs = nim.advanced.lnb section = lnbs[lnb] if isinstance(section.unicable, ConfigNothing): if lnb == 1: section.unicable = ConfigSelection(unicable_choices, unicable_choi... |
vcolist = unicablelnbproducts[y][z] | vcolist = unicableproducts[y][z] | def configLOFChanged(configElement): if configElement.value == "unicable": x = configElement.slot_id lnb = configElement.lnb_id nim = config.Nims[x] lnbs = nim.advanced.lnb section = lnbs[lnb] if isinstance(section.unicable, ConfigNothing): if lnb == 1: section.unicable = ConfigSelection(unicable_choices, unicable_choi... |
scrlist.append(("%d" %cnt,"SCR %d" %cnt)) | def configLOFChanged(configElement): if configElement.value == "unicable": x = configElement.slot_id lnb = configElement.lnb_id nim = config.Nims[x] lnbs = nim.advanced.lnb section = lnbs[lnb] if isinstance(section.unicable, ConfigNothing): if lnb == 1: section.unicable = ConfigSelection(unicable_choices, unicable_choi... | |
tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0]) positions = int(vcolist[len(vcolist)-1][0]) tmp.positions[z] = ConfigSubList() tmp.positions[z].append(ConfigInteger(default=positions, limits = (positions, positions))) lofl = vcolist[len(vcolist)-1][1] tmp.lofl[z] = ConfigSubList() tmp.lofl[z]... | tmp.scr[z] = ConfigSelection(choices = scrlist, default = scrlist[0][0]) positions = int(vcolist[len(vcolist)-1][0]) tmp.positions[z] = ConfigSubList() tmp.positions[z].append(ConfigInteger(default=positions, limits = (positions, positions))) lofl = vcolist[len(vcolist)-1][1] tmp.lofl[z] = ConfigSubList() tmp.lofl[z]... | def configLOFChanged(configElement): if configElement.value == "unicable": x = configElement.slot_id lnb = configElement.lnb_id nim = config.Nims[x] lnbs = nim.advanced.lnb section = lnbs[lnb] if isinstance(section.unicable, ConfigNothing): if lnb == 1: section.unicable = ConfigSelection(unicable_choices, unicable_choi... |
if self.infobar.selected_subtitle == cur[0]: | if self.infobar.selected_subtitle == cur[0][:4]: | def keyOk(self): if self.focus == FOCUS_STREAMS and self["streams"].list: cur = self["streams"].getCurrent() if self.settings.menupage.getValue() == PAGE_AUDIO and cur[0] is not None: self.changeAudio(cur[2]) self.__updatedInfo() if self.settings.menupage.getValue() == PAGE_SUBTITLES and cur[0] is not None: if self.inf... |
self.enableSubtitle(cur[0]) | self.enableSubtitle(cur[0][:4]) | def keyOk(self): if self.focus == FOCUS_STREAMS and self["streams"].list: cur = self["streams"].getCurrent() if self.settings.menupage.getValue() == PAGE_AUDIO and cur[0] is not None: self.changeAudio(cur[2]) self.__updatedInfo() if self.settings.menupage.getValue() == PAGE_SUBTITLES and cur[0] is not None: if self.inf... |
self.realpath = task.cmd path = os.environ.get('PATH', '').split(os.pathsep) absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file = task.cmd: os.path.join(directory, file), path)) if len(absolutes) > 0: self.realpath = task.cmd[0] return True | if task.cmd[0]=='/': self.realpath = task.cmd print "[Task.py][ToolExistsPrecondition] WARNING: usage of absolute paths for tasks should be avoided!" return os.access(self.realpath, os.X_OK) else: self.realpath = task.cmd path = os.environ.get('PATH', '').split(os.pathsep) path.append(task.cwd + '/') absolutes = filter... | def check(self, task): import os self.realpath = task.cmd path = os.environ.get('PATH', '').split(os.pathsep) absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file = task.cmd: os.path.join(directory, file), path)) if len(absolutes) > 0: self.realpath = task.cmd[0] return True return Fals... |
assert isinstance(x, ConfigElement), "entry in ConfigList " + str(x) + " must be a ConfigElement" | assert len(x) < 2 or isinstance(x[1], ConfigElement), "entry in ConfigList " + str(x[1]) + " must be a ConfigElement" | def setList(self, l): self.timer.stop() self.__list = l self.l.setList(self.__list) |
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 = {}, i2c = None): | def __init__(self, slot, type, description, has_outputs = True, internally_connectable = None, multi_type = {}): self.slot = slot |
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"], i2c = entry["i2c"])) | def enumerateNIMs(self): # enum available NIMs. This is currently very dreambox-centric and uses the /proc/bus/nim_sockets interface. # the result will be stored into nim_slots. # the content of /proc/bus/nim_sockets looks like: # NIM Socket 0: # Type: DVB-S # Name: BCM4501 DVB-S2 NIM (internal) # NIM... |
self.opkgAvail = fileExists('/usr/bin/opkg') | def __init__(self, ipkg = '/usr/bin/ipkg'): self.ipkg = ipkg self.cmd = eConsoleAppContainer() self.cache = None self.callbackList = [] self.setCurrentCommand() | |
self.callCallbacks(self.EVENT_UPGRADE, data.split(' ', 1)[1].split(' ')[0]) | if self.opkgAvail: self.callCallbacks(self.EVENT_UPGRADE, data.split(' ', 1)[1].split(' ')[0]) else: self.callCallbacks(self.EVENT_UPGRADE, data.split(' ', 1)[1].split(' ')[0]) | def parseLine(self, data): if self.currentCommand == self.CMD_LIST: item = data.split(' - ', 2) self.fetchedList.append(item) self.callCallbacks(self.EVENT_LISTITEM, item) else: if data.find('Downloading') == 0: self.callCallbacks(self.EVENT_DOWNLOAD, data.split(' ', 5)[1].strip()) elif data.find('Upgrading') == 0: sel... |
Notifications.AddNotificationWithCallback(self.playLastCB, MessageBox, _("Do you want to resume this playback?"), timeout=10) | Notifications.AddNotificationWithCallback(self.playLastCB, MessageBox, _("Do you want to resume this playback?") + "\n" + (_("Resume position at %s") % ("%d:%02d:%02d" % (l/3600, l%3600/60, l%60))), timeout=10) | def __serviceStarted(self): if self.is_closing: return print "new service started! trying to download cuts!" self.downloadCuesheet() |
}, -3) | }, -2) | def __init__(self, session, infobar=None, page=PAGE_AUDIO): Screen.__init__(self, session) |
service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 | def fillList(self, arg=None): streams = [] conflist = [] selectedidx = 0 service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if self.settings.menupage.getValue() == PAGE_AUDIO: self.setTitle(_("Select audio track")) i... | |
types = ("UTF-8 text","SSA / AAS",".SRT file") | types = (_("<unknown>"), "UTF-8 text", "SSA", "AAS", ".SRT file", "VOB", "PGS (unsupported)") | def fillList(self, arg=None): streams = [] conflist = [] selectedidx = 0 service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if self.settings.menupage.getValue() == PAGE_AUDIO: self.setTitle(_("Select audio track")) i... |
print "these plugins are installed but not displayed in the dialog box:", Plugins[1:] | print "plugin(s) installed but not displayed in the dialog box:", Plugins[1:] | def __call__(self, *args, **kwargs): self.fnc(*self.args) |
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)) | used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False, slot.isCompatible("DVB-S2"))) | 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 cleare... |
self.session.openWithCallback(self.DeviceBrowserClosed, DeviceBrowser, None, showDirectories=True, showMountpoints=True, inhibitMounts=["/autofs/sr0/"]) | self.openDeviceBrowser() def openDeviceBrowser(self): self.session.openWithCallback(self.DeviceBrowserClosed, DeviceBrowser, None, showDirectories=True, showMountpoints=True, inhibitMounts=["/autofs/sr0/"]) | def askDestination(self): usbpartition = self.getUSBPartitions() if len(usbpartition) == 1: self.target_dir = usbpartition[0][1] self.ackDestinationDevice(device_description=usbpartition[0][0]) else: self.session.openWithCallback(self.DeviceBrowserClosed, DeviceBrowser, None, showDirectories=True, showMountpoints=True,... |
choices = [(_("Yes"), self.ackedDestination), (_("List of Storage Devices"),self.askDestination), (_("Cancel"),self.keyRed)] | choices = [(_("Yes"), self.ackedDestination), (_("List of Storage Devices"),self.openDeviceBrowser), (_("Cancel"),self.keyRed)] | def ackDestinationDevice(self, device_description=None): if device_description == None: dev = self.target_dir else: dev = device_description message = _("Do you want to download the image to %s ?") % (dev) choices = [(_("Yes"), self.ackedDestination), (_("List of Storage Devices"),self.askDestination), (_("Cancel"),sel... |
print "[ackedDestination]", self.branch, self.target_dir, self.target_dir[8:] | print "[ackedDestination]", self.branch, self.target_dir | def ackedDestination(self): print "[ackedDestination]", self.branch, self.target_dir, self.target_dir[8:] self.container.setCWD("/mnt") if self.target_dir[:8] == "/autofs/": self.target_dir = "/dev/" + self.target_dir[8:-1] |
if self.branch == STICK_WIZARD: job = StickWizardJob(self.target_dir) job.afterEvent = "close" job_manager.AddJob(job) job_manager.failed_jobs = [] self.session.openWithCallback(self.StickWizardCB, JobView, job, afterEventChangeable = False) elif self.branch != STICK_WIZARD: url = self.feedlists[self.branch][self.imag... | if self.branch == STICK_WIZARD: job = StickWizardJob(self.target_dir) job.afterEvent = "close" job_manager.AddJob(job) job_manager.failed_jobs = [] self.session.openWithCallback(self.StickWizardCB, JobView, job, afterEventChangeable = False) elif self.branch != STICK_WIZARD: url = self.feedlists[self.branch][self.imag... | def ackedDestination(self): print "[ackedDestination]", self.branch, self.target_dir, self.target_dir[8:] self.container.setCWD("/mnt") if self.target_dir[:8] == "/autofs/": self.target_dir = "/dev/" + self.target_dir[8:-1] |
job.afterEvent = "close" job_manager.AddJob(job) job_manager.failed_jobs = [] self.session.openWithCallback(self.ImageDownloadCB, JobView, job, afterEventChangeable = False) | else: job = ImageDownloadJob(url, filename, None, self.target_dir) job.afterEvent = "close" job_manager.AddJob(job) job_manager.failed_jobs = [] self.session.openWithCallback(self.ImageDownloadCB, JobView, job, afterEventChangeable = False) | def ackedDestination(self): print "[ackedDestination]", self.branch, self.target_dir, self.target_dir[8:] self.container.setCWD("/mnt") if self.target_dir[:8] == "/autofs/": self.target_dir = "/dev/" + self.target_dir[8:-1] |
self.val = self.path + "/" + self.sel self.session.openWithCallback(self.startRestore, MessageBox, _("Are you sure you want to restore\nfollowing backup:\n") + self.sel + _("\nSystem will restart after the restore!")) | if self.sel: self.val = self.path + "/" + self.sel self.session.openWithCallback(self.startRestore, MessageBox, _("Are you sure you want to restore\nfollowing backup:\n") + self.sel + _("\nSystem will restart after the restore!")) | def KeyOk(self): if (self.exe == False) and (self.entry == True): self.sel = self["filelist"].getCurrent() self.val = self.path + "/" + self.sel self.session.openWithCallback(self.startRestore, MessageBox, _("Are you sure you want to restore\nfollowing backup:\n") + self.sel + _("\nSystem will restart after the restore... |
self.val = self.path + "/" + self.sel self.session.openWithCallback(self.startDelete, MessageBox, _("Are you sure you want to delete\nfollowing backup:\n" + self.sel )) | if self.sel: self.val = self.path + "/" + self.sel self.session.openWithCallback(self.startDelete, MessageBox, _("Are you sure you want to delete\nfollowing backup:\n" + self.sel )) | def deleteFile(self): if (self.exe == False) and (self.entry == True): self.sel = self["filelist"].getCurrent() self.val = self.path + "/" + self.sel self.session.openWithCallback(self.startDelete, MessageBox, _("Are you sure you want to delete\nfollowing backup:\n" + self.sel )) |
if self.execing and self.timeshift_enabled and self.seekstate != self.SEEK_STATE_PLAY: | if self.execing and self.timeshift_enabled: | def _mayShow(self): if self.execing and self.timeshift_enabled and self.seekstate != self.SEEK_STATE_PLAY: self.pvrStateDialog.show() |
for x in parts: if x[1].startswith('/autofs/'): parts.remove(x) | def go(self): current = self["menu"].getCurrent() if current: currentEntry = current[0] if self.menu == 0: if (currentEntry == "software-update"): self.session.openWithCallback(self.runUpgrade, MessageBox, _("Do you want to update your Dreambox?")+"\n"+_("\nAfter pressing OK, please wait!")) elif (currentEntry == "soft... | |
config.plugins.configurationbackup.backupdirs.save() config.plugins.configurationbackup.save() config.save() | def backupfiles_choosen(self, ret): self.backupdirs = ' '.join( config.plugins.configurationbackup.backupdirs.value ) | |
self.createBackupfolders() | newpath = config.plugins.configurationbackup.backuplocation.getValue() if newpath != oldpath: self.createBackupfolders() | def backuplocation_choosen(self, option): if option is not None: config.plugins.configurationbackup.backuplocation.value = str(option[1]) config.plugins.configurationbackup.backuplocation.save() config.plugins.configurationbackup.save() config.save() self.createBackupfolders() |
tool = "mkisofs" | tool = "genisoimage" | def conduct(self): CheckDiskspaceTask(self) if self.project.settings.authormode.getValue().startswith("menu") or self.menupreview: Menus(self) if self.project.settings.titlesetmode.getValue() == "multi": CreateAuthoringXML_multiset(self) else: CreateAuthoringXML_singleset(self) |
tool = "mkisofs" | tool = "genisoimage" | def conduct(self): if self.project.settings.output.getValue() == "iso": CheckDiskspaceTask(self) nr_titles = len(self.project.titles) for self.i in range(nr_titles): title = self.project.titles[self.i] filename = title.inputfile.rstrip("/").rsplit("/",1)[1] link_name = self.workspace + filename LinkTS(self, title.inpu... |
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)) | 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 cleare... |
display_skin_id = 1 | def addSkin(name, scope = SCOPE_SKIN): # read the skin filename = resolveFilename(scope, name) if fileExists(filename): mpath = os.path.dirname(filename) + "/" dom_skins.append((mpath, xml.etree.cElementTree.parse(filename).getroot())) | |
addSkin('skin_display96.xml') | if addSkin('skin_display96.xml'): print "[SKIN] Color OLED" display_skin_id = 2 | def addSkin(name, scope = SCOPE_SKIN): # read the skin filename = resolveFilename(scope, name) if fileExists(filename): mpath = os.path.dirname(filename) + "/" dom_skins.append((mpath, xml.etree.cElementTree.parse(filename).getroot())) |
addSkin(config.skin.primary_skin.value) | if not addSkin(config.skin.primary_skin.value): raise SkinError, "primary skin not found" | def addSkin(name, scope = SCOPE_SKIN): # read the skin filename = resolveFilename(scope, name) if fileExists(filename): mpath = os.path.dirname(filename) + "/" dom_skins.append((mpath, xml.etree.cElementTree.parse(filename).getroot())) |
profile("LoadSkinDefault") | def addSkin(name, scope = SCOPE_SKIN): # read the skin filename = resolveFilename(scope, name) if fileExists(filename): mpath = os.path.dirname(filename) + "/" dom_skins.append((mpath, xml.etree.cElementTree.parse(filename).getroot())) | |
global dom_screens | global dom_screens, display_skin_id | def loadSkin(name, scope = SCOPE_SKIN): # Now a utility for plugins to add skin data to the screens global dom_screens filename = resolveFilename(scope, name) if fileExists(filename): path = os.path.dirname(filename) + "/" for elem in xml.etree.cElementTree.parse(filename).getroot(): if elem.tag == 'screen': name = ele... |
print "Looking for embedded skin" | print "[SKIN] Parsing embedded skin" | def readSkin(screen, skin, names, desktop): if not isinstance(names, list): names = [names] name = "<embedded-in-'%s'>" % screen.__class__.__name__ # try all skins, first existing one have priority global dom_screens for n in names: myscreen, path = dom_screens.get(n, (None,None)) if myscreen is not None: # use this ... |
skin = skin[0] myscreen = screen.parsedSkin = xml.etree.cElementTree.fromstring(skin) | for s in skin: candidate = xml.etree.cElementTree.fromstring(s) if candidate.tag == 'screen': sid = candidate.attrib.get('id', None) if (not sid) or (int(sid) == display_skin_id): myscreen = candidate break; else: print "[SKIN] Hey, no suitable screen!" else: myscreen = xml.etree.cElementTree.fromstring(skin) if myscre... | def readSkin(screen, skin, names, desktop): if not isinstance(names, list): names = [names] name = "<embedded-in-'%s'>" % screen.__class__.__name__ # try all skins, first existing one have priority global dom_screens for n in names: myscreen, path = dom_screens.get(n, (None,None)) if myscreen is not None: # use this ... |
print "No skin to read..." | print "[SKIN] No skin to read..." | def readSkin(screen, skin, names, desktop): if not isinstance(names, list): names = [names] name = "<embedded-in-'%s'>" % screen.__class__.__name__ # try all skins, first existing one have priority global dom_screens for n in names: myscreen, path = dom_screens.get(n, (None,None)) if myscreen is not None: # use this ... |
self.default_dirname.value | preferredPath(self.default_dirname.value) | def ok(self): currentry = self["config"].getCurrent() self.lastvideodirs = config.movielist.videodirs.value self.lasttimeshiftdirs = config.usage.allowed_timeshift_paths.value if config.usage.setup_level.index >= 2: txt = _("Default movie location") else: txt = _("Movie location") if currentry == self.default_entry: se... |
self.timer_dirname.value | preferredPath(self.timer_dirname.value) | def ok(self): currentry = self["config"].getCurrent() self.lastvideodirs = config.movielist.videodirs.value self.lasttimeshiftdirs = config.usage.allowed_timeshift_paths.value if config.usage.setup_level.index >= 2: txt = _("Default movie location") else: txt = _("Movie location") if currentry == self.default_entry: se... |
self.instantrec_dirname.value | preferredPath(self.instantrec_dirname.value) | def ok(self): currentry = self["config"].getCurrent() self.lastvideodirs = config.movielist.videodirs.value self.lasttimeshiftdirs = config.usage.allowed_timeshift_paths.value if config.usage.setup_level.index >= 2: txt = _("Default movie location") else: txt = _("Movie location") if currentry == self.default_entry: se... |
filename += " - " + self.name | def calculateFilename(self): service_name = self.service_ref.getServiceName() begin_date = strftime("%Y%m%d %H%M", localtime(self.begin)) begin_shortdate = strftime("%Y%m%d", localtime(self.begin)) print "begin_date: ", begin_date print "service_name: ", service_name print "name:", self.name print "description: ", sel... | |
filename = begin_date + " - " + service_name + " - " + self.name + " - " + self.description | filename += " - " + self.name + " - " + self.description | def calculateFilename(self): service_name = self.service_ref.getServiceName() begin_date = strftime("%Y%m%d %H%M", localtime(self.begin)) begin_shortdate = strftime("%Y%m%d", localtime(self.begin)) print "begin_date: ", begin_date print "service_name: ", service_name print "name:", self.name print "description: ", sel... |
frontend = eDVBResourceManager.getInstance().allocateRawChannel(fe_id).getFrontend() | def tunerTypeChanged(nimmgr, configElement): fe_id = configElement.fe_id print "tunerTypeChanged feid %d to mode %s" % (fe_id, configElement.value) open("/proc/stb/frontend/%d/mode" % (fe_id), "w").write(configElement.value) frontend = eDVBResourceManager.getInstance().allocateRawChannel(fe_id).getFrontend() frontend.r... | |
self["key_red"] = Boolean(True) | self["key_red"].setBoolean(True) | def fillList(self, arg=None): streams = [] conflist = [] selectedidx = 0 service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if self.settings.menupage.getValue() == "audio": self.setTitle(_("Select audio track")) if S... |
self["key_green"] = Boolean(True) | self["key_green"].setBoolean(True) | def fillList(self, arg=None): streams = [] conflist = [] selectedidx = 0 service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if self.settings.menupage.getValue() == "audio": self.setTitle(_("Select audio track")) if S... |
else: streams = [(None, "", "", _("none"), "")] | else: streams = [] | def fillList(self, arg=None): streams = [] conflist = [] selectedidx = 0 service = self.session.nav.getCurrentService() self.audioTracks = audio = service and service.audioTracks() n = audio and audio.getNumberOfTracks() or 0 if self.settings.menupage.getValue() == "audio": self.setTitle(_("Select audio track")) if S... |
streams = [(None, "", "", _("none"), "")] | streams = [] | #def __call__(self, *args, **kwargs): #self.fnc(*self.args) |
def keyRight(self): if self.focus == FOCUS_CONFIG: ConfigListScreen.keyRight(self) elif self.focus == FOCUS_STREAMS and self["streams"].count(): | def keyRight(self, config = False): if config or self.focus == FOCUS_CONFIG: if self["config"].getCurrentIndex() < 3: ConfigListScreen.keyRight(self) elif hasattr(self, "plugincallfunc"): self.plugincallfunc() if self.focus == FOCUS_STREAMS and self["streams"].count(): | def keyRight(self): if self.focus == FOCUS_CONFIG: ConfigListScreen.keyRight(self) elif self.focus == FOCUS_STREAMS and self["streams"].count(): self["streams"].setIndex(self["streams"].count()-1) |
self.colorkey(0) | if self["key_red"].getBoolean(): self.colorkey(0) | def keyRed(self): self.colorkey(0) |
self.colorkey(1) | if self["key_green"].getBoolean(): self.colorkey(1) | def keyGreen(self): self.colorkey(1) |
self.colorkey(2) | if self["key_yellow"].getBoolean(): self.colorkey(2) | def keyYellow(self): self.colorkey(2) |
pass | if self["key_blue"].getBoolean(): print "colorkey(3)" self.colorkey(3) | def keyBlue(self): pass |
ConfigListScreen.keyRight(self) | self.keyRight(True) | def colorkey(self, idx): self["config"].setCurrentIndex(idx) ConfigListScreen.keyRight(self) |
self.usbmountpoint = "/mnt/usb/" | self.usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/" | def __init__(self, session, destdir=None): Screen.__init__(self, session) #self.skin_path = plugin_path #self.menu = args self.box = HardwareInfo().get_device_name() self.feed_base = "http://www.dreamboxupdate.com/opendreambox" #/1.5/%s/images/" % self.box self.usbmountpoint = "/mnt/usb/" |
self.container.setCWD("/mnt") | self.container.setCWD(resolveFilename(SCOPE_MEDIA)+"usb/") | def ackedDestination(self): print "[ackedDestination]", self.branch, self.target_dir self.container.setCWD("/mnt") if self.target_dir[:8] == "/autofs/": self.target_dir = "/dev/" + self.target_dir[8:-1] |
print "mounting device " + dev + " to /mnt/usb..." system("mount "+dev+" /mnt/usb/ -o rw,sync") session.open(NFIDownload,"/mnt/usb/") | print "mounting device " + dev + " to /media/usb..." usbmountpoint = resolveFilename(SCOPE_MEDIA)+"usb/" system("mount %s %s -o rw,sync" % (dev, usbmountpoint)) session.open(NFIDownload,usbmountpoint) | def filescan_open(list, session, **kwargs): dev = "/dev/" + (list[0].path).rsplit('/',1)[0][7:] print "mounting device " + dev + " to /mnt/usb..." system("mount "+dev+" /mnt/usb/ -o rw,sync") session.open(NFIDownload,"/mnt/usb/") |
choices = { "nothing": _("nothing connected"), | choices = { "nothing": _("not configured"), | def createConfigMode(self): if self.nim.isCompatible("DVB-S"): choices = { "nothing": _("nothing connected"), "simple": _("simple"), "advanced": _("advanced")} #if len(nimmanager.getNimListOfType(nimmanager.getNimType(self.slotid), exception = x)) > 0: # choices["equal"] = _("equal to") # choices["satposdepends"] = _("... |
return((name, version, description, state, installedpng, divpng)) | return((name, version, _(description), state, installedpng, divpng)) | def buildEntryComponent(self, name, version, description, state): divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png")) if state == 'installed': installedpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installed.png")... |
return((name, version, description, state, upgradeablepng, divpng)) | return((name, version, _(description), state, upgradeablepng, divpng)) | def buildEntryComponent(self, name, version, description, state): divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png")) if state == 'installed': installedpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installed.png")... |
return((name, version, description, state, installablepng, divpng)) | return((name, version, _(description), state, installablepng, divpng)) | def buildEntryComponent(self, name, version, description, state): divpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "skin_default/div-h.png")) if state == 'installed': installedpng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installed.png")... |
if self.installed_packetlist.has_key(x[0].strip()): if self.installed_packetlist[x[0].strip()] == x[1].strip(): status = "installed" self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status)) | if self.installed_packetlist.has_key(x[0]): if self.opkgAvail: if self.upgradeable_packages.has_key(x[0]): status = "upgradeable" else: status = "installed" | def buildPacketList(self): self.list = [] self.cachelist = [] |
status = "upgradeable" self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status)) | if self.installed_packetlist[x[0]] == x[1]: status = "installed" else: status = "upgradeable" | def buildPacketList(self): self.list = [] self.cachelist = [] |
self.list.append(self.buildEntryComponent(x[0].strip(), x[1].strip(), x[2].strip(), status)) if not any(x[0].strip().endswith(x) for x in self.unwanted_extensions): self.cachelist.append([x[0].strip(), x[1].strip(), x[2].strip(), status]) | self.list.append(self.buildEntryComponent(x[0], x[1], x[2], status)) self.cachelist.append([x[0], x[1], x[2], status]) | def buildPacketList(self): self.list = [] self.cachelist = [] |
for parts in getProcMounts(): if path.realpath(parts[0]).startswith(self.dev_path): try: stat = statvfs(parts[1]) except OSError: continue return stat.f_bfree/1000 * stat.f_bsize/1000 | dev = self.findMount() if dev: stat = statvfs(dev) return (stat.f_bfree/1000) * (stat.f_bsize/1000) | def free(self): for parts in getProcMounts(): if path.realpath(parts[0]).startswith(self.dev_path): try: stat = statvfs(parts[1]) except OSError: continue return stat.f_bfree/1000 * stat.f_bsize/1000 return -1 |
def _unmount(self): self.unmount() def unmount(self): cmd = "umount" | def mountDevice(self): | def _unmount(self): self.unmount() |
cmd = ' ' . join([cmd, parts[1]]) break else: | self.mount_device = parts[0] self.mount_path = parts[1] return parts[1] def findMount(self): if self.mount_path is None: return self.mountDevice() return self.mount_path def unmount(self): dev = self.mountDevice() if dev is None: | def unmount(self): cmd = "umount" for parts in getProcMounts(): if path.realpath(parts[0]).startswith(self.dev_path): cmd = ' ' . join([cmd, parts[1]]) break else: # not mounted, return OK return 0 print "[Harddisk]", cmd res = system(cmd) return (res >> 8) |
lines = fstab.readlines() | def mount(self): try: fstab = open("/etc/fstab") except IOError: return -1 | |
res = -1 | def mount(self): try: fstab = open("/etc/fstab") except IOError: return -1 | |
if path.realpath(parts[0]) == self.partitionPath("1"): cmd = "mount -t ext3 " + parts[0] | fspath = path.realpath(parts[0]) if path.realpath(fspath) == dev: print "[Harddisk] mounting:", fspath cmd = "mount -t ext3 " + fspath | def mount(self): try: fstab = open("/etc/fstab") except IOError: return -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.