fix skipping of configuration backup
[enigma2.git] / lib / python / Plugins / SystemPlugins / NFIFlash / downloader.py
index 160620fd55a0caa94608a1e660df085cf0743247..c91c85888b91a73a31b97e66b9f26b360c74bae0 100644 (file)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 from Components.MenuList import MenuList
 from Screens.Screen import Screen
 from Screens.MessageBox import MessageBox
@@ -657,13 +658,17 @@ class NFIDownload(Screen):
                                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)
-
-       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()
+               else:
+                       self.backup_file = None
+                       self.backup_finished(skipped=True)
+
+       def backup_finished(self, skipped=False):
+               if not skipped:
+                       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)
 
        def closeCB(self):