optionaly backup epg cache too
authorims <ims21@users.sourceforge.net>
Mon, 15 Dec 2014 22:48:51 +0000 (23:48 +0100)
committerErik Slagter <erik@openpli.org>
Tue, 16 Dec 2014 12:18:47 +0000 (13:18 +0100)
Signed-off-by: Erik Slagter <erik@openpli.org>

lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py

index c9b8ea0..4e3f225 100644 (file)
@@ -11,7 +11,7 @@ from Components.config import config
 from Components.ConfigList import ConfigList,ConfigListScreen
 from Components.FileList import MultiFileSelectList
 from Plugins.Plugin import PluginDescriptor
-from enigma import eTimer, eEnv
+from enigma import eTimer, eEnv, eEPGCache
 from Tools.Directories import *
 from os import popen, path, makedirs, listdir, access, stat, rename, remove, W_OK, R_OK
 from time import gmtime, strftime, localtime
@@ -66,6 +66,8 @@ class BackupScreen(Screen, ConfigListScreen):
 
        def doBackup(self):
                configfile.save()
+               if config.plugins.softwaremanager.epgcache.value:
+                       eEPGCache.getInstance().save()
                try:
                        if (path.exists(self.backuppath) == False):
                                makedirs(self.backuppath)
index ef42508..137ef6b 100644 (file)
@@ -56,6 +56,7 @@ config.plugins.softwaremanager.overwriteConfigFiles = ConfigSelection(
                                ], "Y")
 config.plugins.softwaremanager.onSetupMenu = ConfigYesNo(default=False)
 config.plugins.softwaremanager.onBlueButton = ConfigYesNo(default=False)
+config.plugins.softwaremanager.epgcache = ConfigYesNo(default=False)
 
 def write_cache(cache_file, cache_data):
        #Does a cPickle dump
@@ -394,6 +395,7 @@ class SoftwareManagerSetup(Screen, ConfigListScreen):
                self.list.append(self.overwriteConfigfilesEntry)
                self.list.append(getConfigListEntry(_("show softwaremanager in setup menu"), config.plugins.softwaremanager.onSetupMenu))
                self.list.append(getConfigListEntry(_("show softwaremanager on blue button"), config.plugins.softwaremanager.onBlueButton))
+               self.list.append(getConfigListEntry(_("epg cache backup"), config.plugins.softwaremanager.epgcache))
 
                self["config"].list = self.list
                self["config"].l.setSeperation(400)