+ def flasherFinishedCB(self, answer):
+ if answer == True:
+ self.wizard_mode = True
+ self["feedlist"].moveSelection(0)
+ self["path_bottom"].text = str(self["destlist"].getCurrentDirectory())
+ self.nfo_download()
+ self.nfi_download()
+
+ def configBackup(self):
+ self.session.openWithCallback(self.runBackup, MessageBox, _("The wizard can backup your current settings. Do you want to do a backup now?"))
+
+ def runBackup(self, result=None):
+ from Tools.Directories import createDir, isMount, pathExists
+ from time import localtime
+ from datetime import date
+ from Screens.Console import Console
+ if result:
+ if isMount("/mnt/usb/"):
+ if (pathExists("/mnt/usb/backup") == False):
+ createDir("/mnt/usb/backup", True)
+ d = localtime()
+ dt = date(d.tm_year, d.tm_mon, d.tm_mday)
+ self.backup_file = "backup/" + str(dt) + "_settings_backup.tar.gz"
+ self.session.open(Console, title = "Backup running", cmdlist = ["tar -czvf " + "/mnt/usb/" + self.backup_file + " /etc/enigma2/ /etc/network/interfaces /etc/wpa_supplicant.conf"], finishedCallback = self.backup_finished, closeOnSuccess = True)
+ else:
+ self.backup_file = None
+ self.backup_finished()
+
+ def backup_finished(self):
+ wizardfd = open("/mnt/usb/wizard.nfo", "w")
+ if wizardfd:
+ wizardfd.write("image: "+self["feedlist"].getNFIname()+'\n')
+ wizardfd.write("configuration: "+self.backup_file+'\n')
+ wizardfd.close()
+ self.session.open(MessageBox, _("To update your Dreambox firmware, please follow these steps:\n1) Turn off your box with the rear power switch and plug in the bootable USB stick.\n2) Turn mains back on and hold the DOWN button on the front panel pressed for 10 seconds.\n3) Wait for bootup and follow instructions of the wizard."), type = MessageBox.TYPE_INFO)
+