Exemplo n.º 1
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)
Exemplo n.º 2
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,
         )
Exemplo n.º 3
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)
Exemplo n.º 4
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"))
Exemplo n.º 5
0
 def doRemove(self, callback, pkgname):
     self.session.openWithCallback(
         callback,
         Console,
         cmdlist=[self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname, "sync"],
         closeOnSuccess=True,
     )
Exemplo n.º 6
0
	def startIpkgListAvailable(self):
		self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list '" + self.PLUGIN_PREFIX + "*'")
Exemplo n.º 7
0
	def startIpkgListInstalled(self, pkgname = PLUGIN_PREFIX + '*'):
		self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list_installed '%s'" % pkgname)
Exemplo n.º 8
0
 def startIpkgListAvailable(self):
     self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list")
Exemplo n.º 9
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)
Exemplo n.º 10
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)
Exemplo n.º 11
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")
Exemplo n.º 12
0
 def startIpkgListAvailable(self):
     self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() +
                            " list '" + self.PLUGIN_PREFIX + "*'")
Exemplo n.º 13
0
 def startIpkgListInstalled(self, pkgname=PLUGIN_PREFIX + '*'):
     self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() +
                            " list_installed '%s'" % pkgname)
Exemplo n.º 14
0
	def startIpkgListAvailable(self):
		self.container.execute(self.ipkg + Ipkg.opkgExtraDestinations() + " list")
Exemplo n.º 15
0
	def doRemove(self, callback, pkgname):
		self.session.openWithCallback(callback, Console, cmdlist = [self.ipkg_remove + Ipkg.opkgExtraDestinations() + " " + self.PLUGIN_PREFIX + pkgname, "sync"], closeOnSuccess = True)
Exemplo n.º 16
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")