Example #1
0
 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()
Example #3
0
	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()
Example #4
0
 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()
Example #5
0
	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()
Example #6
0
    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)
Example #7
0
 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,
         )
Example #8
0
 def doRemove(self, callback, pkgname):
     self.session.openWithCallback(
         callback,
         Console,
         cmdlist=[self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname, "sync"],
         closeOnSuccess=True,
     )
Example #9
0
	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"))
Example #10
0
	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)
Example #12
0
 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")
Example #13
0
 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)
Example #14
0
 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")
Example #15
0
 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)
Example #16
0
    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"))
Example #17
0
 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)
Example #18
0
 def startIpkgListAvailable(self):
     self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list")
Example #19
0
	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")
Example #20
0
 def startIpkgListAvailable(self):
     self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() +
                            " list '" + self.PLUGIN_PREFIX + "*'")
Example #21
0
 def startIpkgListInstalled(self, pkgname=PLUGIN_PREFIX + '*'):
     self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() +
                            " list_installed '%s'" % pkgname)
Example #22
0
 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)
Example #23
0
 def startIpkgListInstalled(self, pkgname=None):
     self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() +
                            " list_installed" +
                            (" '%s'" % pkgname if pkgname else ""))
Example #24
0
	def startIpkgListInstalled(self, pkgname = PLUGIN_PREFIX + '*'):
		self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list_installed '%s'" % pkgname)
Example #25
0
	def startIpkgListAvailable(self):
		self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list '" + self.PLUGIN_PREFIX + "*'")
Example #26
0
	def startIpkgListAvailable(self):
		self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list")