def installDestinationCallback(self, result): if result is not None: dest = result[1] if dest.startswith('/'): dest = os.path.normpath(dest) extra = '--add-dest %s:%s -d %s' % (dest, dest, dest) Ipkg.opkgAddDestination(dest) else: extra = '-d ' + dest self.doInstall(self.installFinished, self['list'].l.getCurrentSelection()[0].name + ' ' + extra) else: self.resetPostInstall()
def installDestinationCallback(self, result): if result is not None: dest = result[1] if dest[0] == '/': # Custom install path, add it to the list too dest = os.path.normpath(dest) extra = '--dest %s:%s -d %s' % (dest,dest,dest) Ipkg.opkgAddDestination(dest) else: extra = '-d ' + dest self.doInstall(self.installFinished, self["list"].l.getCurrentSelection()[0].name + ' ' + extra) else: self.resetPostInstall()
def installDestinationCallback(self, result): if result is not None: dest = result[1] if dest.startswith('/'): # Custom install path, add it to the list too dest = os.path.normpath(dest) extra = '--add-dest %s:%s -d %s' % (dest,dest,dest) Ipkg.opkgAddDestination(dest) else: extra = '-d ' + dest self.doInstall(self.installFinished, pluginnames + ' ' + extra) else: self.resetPostInstall()
def installDestinationCallback(self, result): if result is not None: dest = result[1] if dest.startswith("/"): # Custom install path, add it to the list too dest = os.path.normpath(dest) extra = "--add-dest %s:%s -d %s" % (dest, dest, dest) Ipkg.opkgAddDestination(dest) else: extra = "-d " + dest self.doInstall(self.installFinished, self["list"].l.getCurrentSelection()[0].name + " " + extra) else: self.resetPostInstall()
def installDestinationCallback(self, result): if result is not None: dest = result[1] if dest.startswith('/'): # Custom install path, add it to the list too dest = os.path.normpath(dest) extra = '--add-dest %s:%s -d %s' % (dest,dest,dest) Ipkg.opkgAddDestination(dest) else: extra = '-d ' + dest self["text"].setText(_("No new plugins found")) else: self.resetPostInstall()
def runInstall(self, val): if val: if self.type == self.DOWNLOAD: if self["list"].l.getCurrentSelection()[0].name.startswith("picons-"): supported_filesystems = frozenset( ("ext4", "ext3", "ext2", "reiser", "reiser4", "jffs2", "ubifs", "rootfs") ) candidates = [] import Components.Harddisk mounts = Components.Harddisk.getProcMounts() for partition in harddiskmanager.getMountedPartitions(False, mounts): if partition.filesystem(mounts) in supported_filesystems: candidates.append((partition.description, partition.mountpoint)) if candidates: from Components.Renderer import Picon self.postInstallCall = Picon.initPiconPaths self.session.openWithCallback( self.installDestinationCallback, ChoiceBox, title=_("Install picons on"), list=candidates ) return self.install_settings_name = self["list"].l.getCurrentSelection()[0].name # iq [ # if self["list"].l.getCurrentSelection()[0].name.startswith('settings-'): if self["list"].l.getCurrentSelection()[0].name.startswith("settings-") or self[ "list" ].l.getCurrentSelection()[0].name.startswith("channel."): # ] self.check_settings = True # iq [ # self.startIpkgListInstalled(self.PLUGIN_PREFIX + 'settings-*') self.container.execute( self.ipkg + Ipkg.opkgExtraDestinations() + " list_installed " + self.PLUGIN_PREFIX + "settings-* ; " + self.ipkg + Ipkg.opkgExtraDestinations() + " list_installed " + self.PLUGIN_PREFIX + "channel.*" ) # ] else: self.runSettingsInstall() elif self.type == self.REMOVE: self.doRemove(self.installFinished, self["list"].l.getCurrentSelection()[0].name)
def doRemove(self, callback, pkgname): if pkgname.startswith("kernel-module-"): self.session.openWithCallback( callback, Console, cmdlist=[self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + pkgname, "sync"], closeOnSuccess=True, ) else: self.session.openWithCallback( callback, Console, cmdlist=[self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname, "sync"], closeOnSuccess=True, )
def doRemove(self, callback, pkgname): self.session.openWithCallback( callback, Console, cmdlist=[self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname, "sync"], closeOnSuccess=True, )
def go(self): sel = self["list"].l.getCurrentSelection() if sel is None: return sel = sel[0] if isinstance(sel, str): # category if sel in self.expanded: self.expanded.remove(sel) else: self.expanded.append(sel) self.updateList() else: if self.type == self.DOWNLOAD: mbox=self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to download the plugin \"%s\"?") % sel.name) mbox.setTitle(_("Download plugins")) if self.type == self.REMOVE: mbox=self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to remove the plugin \"%s\"?") % sel.name, default = False) mbox.setTitle(_("Remove plugins")) elif self.type == self.TOOGLE: if 'hold' in os.popen("opkg status " + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + sel.name).read(): mbox=self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to unhold the plugin \"%s\"?") % sel.name, default = False) else: mbox=self.session.openWithCallback(self.runInstall, MessageBox, _("Do you really want to hold the plugin \"%s\"?") % sel.name, default = False) mbox.setTitle(_("Hold plugins"))
def doToogle(self, callback, pkgname): if 'hold' in os.popen("opkg status " + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname).read(): self.ipkg_toogle = self.ipkg + ' flag user' self.session.openWithCallback(callback, Console, cmdlist = [self.ipkg_toogle + " " + self.PLUGIN_PREFIX + pkgname, "sync"], closeOnSuccess = False) else: self.ipkg_toogle = self.ipkg + ' flag hold' self.session.openWithCallback(callback, Console, cmdlist = [self.ipkg_toogle + " " + self.PLUGIN_PREFIX + pkgname, "sync"], closeOnSuccess = False)
def doRemove(self, callback, pkgname): self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname, "sync" ], closeOnSuccess=True)
def doRemove(self, callback, pkgname): pkgname = self.PLUGIN_PREFIX + pkgname self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + pkgname, "sync" ], skin="Console_Pig")
def doRemove(self, callback, pkgname): if pkgname.startswith('kernel-module-'): self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + pkgname, "sync" ], closeOnSuccess=True) else: self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname, "sync" ], closeOnSuccess=True)
def doRemove(self, callback, pkgname): if pkgname.startswith('kernel-module-') or pkgname.startswith( 'enigma2-locale-'): self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + pkgname, "sync" ], skin="Console_Pig") else: self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname, "sync" ], skin="Console_Pig")
def doRemove(self, callback, pkgname): if pkgname.startswith('kernel-module-') or pkgname.startswith( 'enigma2-locale-') or pkgname.startswith( 'packagegroup-') or pkgname.startswith( 'python-') or pkgname.startswith('kodi-'): self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_remove + Ipkg.opkgExtraDestinations() + ' ' + pkgname, 'sync' ], closeOnSuccess=False) else: self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_remove + Ipkg.opkgExtraDestinations() + ' ' + self.PLUGIN_PREFIX + pkgname, 'sync' ], closeOnSuccess=False)
def go(self): sel = self["list"].l.getCurrentSelection() if sel is None: return sel = sel[0] if isinstance(sel, str): # category if sel in self.expanded: self.expanded.remove(sel) else: self.expanded.append(sel) self.updateList() else: if self.type == self.DOWNLOAD: mbox = self.session.openWithCallback( self.runInstall, MessageBox, _("Do you really want to download the plugin \"%s\"?") % sel.name) mbox.setTitle(_("Download plugins")) if self.type == self.REMOVE: mbox = self.session.openWithCallback( self.runInstall, MessageBox, _("Do you really want to remove the plugin \"%s\"?") % sel.name, default=False) mbox.setTitle(_("Remove plugins")) elif self.type == self.TOOGLE: if 'hold' in os.popen("opkg status " + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + sel.name).read(): mbox = self.session.openWithCallback( self.runInstall, MessageBox, _("Do you really want to unhold the plugin \"%s\"?") % sel.name, default=False) else: mbox = self.session.openWithCallback( self.runInstall, MessageBox, _("Do you really want to hold the plugin \"%s\"?") % sel.name, default=False) mbox.setTitle(_("Hold plugins"))
def doToogle(self, callback, pkgname): if 'hold' in os.popen("opkg status " + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname).read(): self.ipkg_toogle = self.ipkg + ' flag user' self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_toogle + " " + self.PLUGIN_PREFIX + pkgname, "sync" ], closeOnSuccess=False) else: self.ipkg_toogle = self.ipkg + ' flag hold' self.session.openWithCallback( callback, Console, cmdlist=[ self.ipkg_toogle + " " + self.PLUGIN_PREFIX + pkgname, "sync" ], closeOnSuccess=False)
def startIpkgListAvailable(self): self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list")
def doRemove(self, callback, pkgname): pkgname = self.PLUGIN_PREFIX + pkgname self.session.openWithCallback(callback, Console, cmdlist = [self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + pkgname, "sync"], skin="Console_Pig")
def startIpkgListAvailable(self): self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list '" + self.PLUGIN_PREFIX + "*'")
def startIpkgListInstalled(self, pkgname=PLUGIN_PREFIX + '*'): self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list_installed '%s'" % pkgname)
def doRemove(self, callback, pkgname): if pkgname.startswith('kernel-module-') or pkgname.startswith('enigma2-locale-'): self.session.openWithCallback(callback, Console, cmdlist=[self.ipkg_remove + Ipkg.opkgExtraDestinations() + ' ' + pkgname, 'sync'], closeOnSuccess=True) else: self.session.openWithCallback(callback, Console, cmdlist=[self.ipkg_remove + Ipkg.opkgExtraDestinations() + ' ' + self.PLUGIN_PREFIX + pkgname, 'sync'], closeOnSuccess=True)
def startIpkgListInstalled(self, pkgname=None): self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list_installed" + (" '%s'" % pkgname if pkgname else ""))
def startIpkgListInstalled(self, pkgname = PLUGIN_PREFIX + '*'): self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list_installed '%s'" % pkgname)