Ejemplo n.º 1
0
 def doRemove(self, callback, pkgname):
     if pkgname.startswith(
         (self.ALSAUTILS_PREFIX, self.BLUEZ_PREFIX, self.BUSYBOX_PREFIX,
          self.E2FSPROGS_PREFIX, self.ENIGMA2LOCALE_PREFIX,
          self.FIRMWARE_PREFIX, self.FREQUENCY_PREFIX,
          self.GLIBCCHARMAP_PREFIX, self.GLIBCGCONC_PREFIX,
          self.GSTPLUGINS_PREFIX, self.GSTOLDPLUGINS_PREFIX,
          self.KERNELMODULE_PREFIX, self.MTDUTILS_PREFIX,
          self.PACKAGEGROUPBASE_PREFIX, self.PAMPLUGIN_PREFIX,
          self.PERLMODULE_PREFIX, self.PYTHON_PREFIX, self.TZDATA_PREFIX,
          self.UTILLINUX_PREFIX)):
         self.session.openWithCallback(
             callback,
             Console,
             cmdlist=[
                 self.opkg_remove + Opkg.opkgExtraDestinations() + " " +
                 pkgname, "sync"
             ],
             skin="Console_Pig")
     else:
         self.session.openWithCallback(
             callback,
             Console,
             cmdlist=[
                 self.opkg_remove + Opkg.opkgExtraDestinations() + " " +
                 self.PLUGIN_PREFIX + pkgname, "sync"
             ],
             skin="Console_Pig")
Ejemplo n.º 2
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)
				Opkg.opkgAddDestination(dest)
			else:
				extra = '-d ' + dest
			self.doInstall(self.installFinished, self["list"].l.getCurrentSelection()[0].name + ' ' + extra)
		else:
			self.resetPostInstall()
Ejemplo n.º 3
0
 def runFinished(self, retval):
     if self.check_settings:
         self.check_settings = False
         self.runSettingsInstall()
         return
     self.remainingdata = ""
     if self.run == 0:
         self.run = 1
         if self.type == self.DOWNLOAD:
             self.startOpkgListInstalled()
     elif self.run == 1 and self.type == self.DOWNLOAD:
         self.run = 2
         pluginlist = []
         self.pluginlist = pluginlist
         for plugin in Opkg.enumPlugins(self.PLUGIN_PREFIX):
             if plugin[0] not in self.installedplugins:
                 pluginlist.append(plugin + (plugin[0][15:], ))
         if pluginlist:
             pluginlist.sort()
             self.updateList()
             self["list"].instance.show()
         else:
             self["text"].setText(_("No new plugins found"))
     else:
         if self.pluginlist:
             self.updateList()
             self["list"].instance.show()
         else:
             self["text"].setText(_("No new plugins found"))
Ejemplo n.º 4
0
 def doRemove(self, callback, pkgname):
     pkgname = self.PLUGIN_PREFIX + pkgname
     self.session.openWithCallback(
         callback,
         Console,
         cmdlist=[
             self.opkg_remove + Opkg.opkgExtraDestinations() + " " +
             pkgname, "sync"
         ],
         skin="Console_Pig")
Ejemplo n.º 5
0
 def doRemove(self, callback, pkgname):
     if pkgname.startswith('kernel-module-') or pkgname.startswith(
             'enigma2-locale-'):
         self.session.openWithCallback(
             callback,
             Console,
             cmdlist=[
                 self.opkg_remove + Opkg.opkgExtraDestinations() + " " +
                 pkgname, "sync"
             ],
             skin="Console_Pig")
     else:
         self.session.openWithCallback(
             callback,
             Console,
             cmdlist=[
                 self.opkg_remove + Opkg.opkgExtraDestinations() + " " +
                 self.PLUGIN_PREFIX + pkgname, "sync"
             ],
             skin="Console_Pig")
Ejemplo n.º 6
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"))
            elif 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 " +
                                      Opkg.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"))
Ejemplo n.º 7
0
 def doToogle(self, callback, pkgname):
     if 'hold' in os.popen("opkg status " + Opkg.opkgExtraDestinations() +
                           " " + self.PLUGIN_PREFIX + pkgname).read():
         self.opkg_toogle = self.opkg + ' flag user'
         self.session.openWithCallback(
             callback,
             Console,
             cmdlist=[
                 self.opkg_toogle + " " + self.PLUGIN_PREFIX + pkgname,
                 "sync"
             ],
             skin="Console_Pig")
     else:
         self.opkg_toogle = self.opkg + ' flag hold'
         self.session.openWithCallback(
             callback,
             Console,
             cmdlist=[
                 self.opkg_toogle + " " + self.PLUGIN_PREFIX + pkgname,
                 "sync"
             ],
             skin="Console_Pig")
Ejemplo n.º 8
0
 def startOpkgListAvailable(self):
     self.container.execute(self.opkg + Opkg.opkgExtraDestinations() +
                            " list '" + self.PLUGIN_PREFIX + "*'")
Ejemplo n.º 9
0
 def startOpkgListInstalled(self, pkgname=PLUGIN_PREFIX + '*'):
     self.container.execute(self.opkg + Opkg.opkgExtraDestinations() +
                            " list_installed '%s'" % pkgname)
Ejemplo n.º 10
0
 def startOpkgListAvailable(self):
     self.container.execute(self.opkg + Opkg.opkgExtraDestinations() +
                            " list")
Ejemplo n.º 11
0
 def runFinished(self, retval):
     if self.check_settings:
         self.check_settings = False
         self.runSettingsInstall()
         return
     self.remainingdata = ""
     if self.run == 0:
         self.run = 1
         if self.type == self.DOWNLOAD:
             self.startOpkgListInstalled()
     elif self.run == 1 and self.type == self.DOWNLOAD:
         self.run = 2
         pluginlist = []
         self.pluginlist = pluginlist
         for plugin in Opkg.enumPlugins(self.PLUGIN_PREFIX):
             if plugin[0] not in self.installedplugins:
                 pluginlist.append(plugin + (plugin[0][15:], ))
         if config.misc.pluginbrowser.alsautils.value:
             for plugin in Opkg.enumPlugins(self.ALSAUTILS_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.bluez.value:
             for plugin in Opkg.enumPlugins(self.BLUEZ_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.busybox.value:
             for plugin in Opkg.enumPlugins(self.BUSYBOX_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.e2fsprogs.value:
             for plugin in Opkg.enumPlugins(self.E2FSPROGS_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.enigma2locale.value:
             for plugin in Opkg.enumPlugins(self.ENIGMA2LOCALE_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.firmware.value:
             for plugin in Opkg.enumPlugins(self.FIRMWARE_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.frequency.value:
             for plugin in Opkg.enumPlugins(self.FREQUENCY_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.glibccharmap.value:
             for plugin in Opkg.enumPlugins(self.GLIBCCHARMAP_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.glibcgconv.value:
             for plugin in Opkg.enumPlugins(self.GLIBCGCONC_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.gstplugins.value:
             for plugin in Opkg.enumPlugins(self.GSTPLUGINS_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
             for plugin in Opkg.enumPlugins(self.GSTOLDPLUGINS_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.kernelmodule.value:
             for plugin in Opkg.enumPlugins(self.KERNELMODULE_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.mtdutils.value:
             for plugin in Opkg.enumPlugins(self.MTDUTILS_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.packagegroupbase.value:
             for plugin in Opkg.enumPlugins(self.PACKAGEGROUPBASE_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.pamplugin.value:
             for plugin in Opkg.enumPlugins(self.PAMPLUGIN_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.perlmodule.value:
             for plugin in Opkg.enumPlugins(self.PERLMODULE_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.python.value:
             for plugin in Opkg.enumPlugins(self.PYTHON_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.tzdata.value:
             for plugin in Opkg.enumPlugins(self.TZDATA_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if config.misc.pluginbrowser.utillinux.value:
             for plugin in Opkg.enumPlugins(self.UTILLINUX_PREFIX):
                 if plugin[0] not in self.installedplugins:
                     pluginlist.append(plugin + (plugin[0], ))
         if pluginlist:
             pluginlist.sort()
             self.updateList()
             self["list"].instance.show()
         else:
             self["text"].setText(_("No new plugins found"))
     else:
         if self.pluginlist:
             self.updateList()
             self["list"].instance.show()
         else:
             self["text"].setText(_("No new plugins found"))