aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Plugins/update.py
blob: 7126875b4766f6df7d669889cfc23381e9c2485e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from enigma import *
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Label import Label

import os

class Example(Screen):
	skin = """
		<screen position="100,100" size="550,400" title="IPKG upgrade..." >
			<widget name="text" position="0,0" size="550,400" font="Arial;15" />
		</screen>"""
		
	def __init__(self, session):
		self.skin = Example.skin
		Screen.__init__(self, session)

		self["text"] = Label("Press OK to upgrade")
				
		self["actions"] = ActionMap(["WizardActions"], 
		{
			"ok": self.ok,
			"back": self.close
		}, -1)
		
	def ok(self):
		lines = os.popen("ipkg update && ipkg upgrade", "r").readlines()
		string = ""
		for x in lines:
			string += x
		self["text"].setText(string)
		
		
def main(session):
	session.open(Example)
	

def getPicturePath():
		return ""

def getPluginName():
		return "Softwareupdate"