switch to opkg
[enigma2.git] / lib / python / Plugins / SystemPlugins / OldSoftwareUpdate / plugin.py
index 0f6c4e846cdb6ec197332d9f02bc5255f5bc41fc..22e54369f6e19b60f1ad7089e3313d818bf25513 100644 (file)
@@ -1,20 +1,16 @@
 from enigma import RT_HALIGN_LEFT, RT_VALIGN_CENTER, eListboxPythonMultiContent, eListbox, eTimer, gFont
 from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
-from Components.ActionMap import ActionMap, NumberActionMap
+from Components.ActionMap import ActionMap
 from Components.ScrollLabel import ScrollLabel
-from Components.Label import Label
-from Components.GUIComponent import *
-from Components.MenuList import MenuList
-from Components.Input import Input
-from Screens.Console import Console
+from Components.GUIComponent import GUIComponent
 from Plugins.Plugin import PluginDescriptor
 
 from os import popen
 
 class Upgrade(Screen):
        skin = """
-               <screen position="100,100" size="550,400" title="IPKG upgrade..." >
+               <screen position="100,100" size="550,400" title="opkg upgrade..." >
                        <widget name="text" position="0,0" size="550,400" font="Regular;15" />
                </screen>"""
                
@@ -34,7 +30,7 @@ class Upgrade(Screen):
                
                self.update = True
                self.delayTimer = eTimer()
-               self.delayTimer.timeout.get().append(self.doUpdateDelay)
+               self.delayTimer.callback.append(self.doUpdateDelay)
                
        def go(self):
                if self.update:
@@ -43,7 +39,7 @@ class Upgrade(Screen):
                        self.close()
        
        def doUpdateDelay(self):
-               lines = popen("ipkg update && ipkg upgrade -force-defaults -force-overwrite", "r").readlines()
+               lines = popen("opkg update && opkg upgrade -force-defaults -force-overwrite", "r").readlines()
                string = ""
                for x in lines:
                        string += x
@@ -91,7 +87,7 @@ class PacketList(GUIComponent):
 
 class Ipkg(Screen):
        skin = """
-               <screen position="100,100" size="550,400" title="IPKG upgrade..." >
+               <screen position="100,100" size="550,400" title="opkg upgrade..." >
                        <widget name="list" position="0,0" size="550,400" scrollbarMode="showOnDemand" />
                </screen>"""
                
@@ -113,13 +109,13 @@ class Ipkg(Screen):
                
 
        def fillPacketList(self):
-               lines = popen("ipkg list", "r").readlines()
+               lines = popen("opkg list", "r").readlines()
                packetlist = []
                for x in lines:
                        split = x.split(' - ')
                        packetlist.append([split[0].strip(), split[1].strip()])
                
-               lines = popen("ipkg list_installed", "r").readlines()
+               lines = popen("opkg list_installed", "r").readlines()
                
                installedlist = {}
                for x in lines:
@@ -142,7 +138,7 @@ class Ipkg(Screen):
                        self.close()
        
        def doUpdateDelay(self):
-               lines = popen("ipkg update && ipkg upgrade", "r").readlines()
+               lines = popen("opkg update && opkg upgrade", "r").readlines()
                string = ""
                for x in lines:
                        string += x
@@ -165,4 +161,4 @@ def IpkgMain(session, **kwargs):
 
 def Plugins(**kwargs):
        return [PluginDescriptor(name="Old Softwareupdate", description="Updates your receiver's software", icon="update.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=UpgradeMain),
-                       PluginDescriptor(name="IPKG", description="IPKG frontend", icon="update.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=IpkgMain)]
+                       PluginDescriptor(name="opkg", description="opkg frontend", icon="update.png", where = PluginDescriptor.WHERE_PLUGINMENU, fnc=IpkgMain)]