rewrite ServiceEventTracker and PerServiceBase service event handle code
[enigma2.git] / lib / python / Screens / ImageWizard.py
1 from Wizard import Wizard, wizardManager
2
3 from Tools.Directories import fileExists
4
5 import os
6
7 backupfile = "backupenigma2settings.tar"
8
9 def checkConfigBackup():
10         paths = ['/media/hdd/', '/media/cf/']
11         for x in paths:
12                 if fileExists(x + backupfile):
13                         return x
14         return None
15
16 if checkConfigBackup() is None:
17         backupAvailable = 0
18 else:
19         backupAvailable = 1
20
21 class ImageWizard(Wizard):
22         def __init__(self, session):
23                 self.xmlfile = "imagewizard.xml"
24                 Wizard.__init__(self, session, showSteps=False, showStepSlider=False, showList=True, showConfig=True)
25
26         def markDone(self):
27                 pass
28
29 wizardManager.registerWizard(ImageWizard, backupAvailable, priority = 10)
30
31 def doBackup(path):
32         os.system('tar cvpf ' + path + backupfile + ' /etc/enigma2')
33
34 def doRestore(path):
35         os.system('cd / && /bin/tar xvpf ' + path + backupfile)
36         
37
38