mirror of
https://github.com/robweber/xbmcbackup.git
synced 2024-12-22 14:05:23 +01:00
fixes #39
This commit is contained in:
parent
25a9faed9a
commit
d28596728b
@ -1,5 +1,7 @@
|
||||
Version 0.4.3
|
||||
|
||||
added error message if remote directory is blank
|
||||
|
||||
added license tag
|
||||
|
||||
Version 0.4.2
|
||||
|
20
default.py
20
default.py
@ -20,13 +20,19 @@ if(mode != -1):
|
||||
#run the profile backup
|
||||
backup = XbmcBackup()
|
||||
|
||||
if(mode == backup.Restore):
|
||||
#allow user to select the backup to restore from
|
||||
restorePoints = backup.listBackups()
|
||||
if(backup.remoteConfigured()):
|
||||
|
||||
selectedRestore = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30021),restorePoints)
|
||||
if(mode == backup.Restore):
|
||||
#allow user to select the backup to restore from
|
||||
restorePoints = backup.listBackups()
|
||||
|
||||
if(selectedRestore != -1):
|
||||
backup.selectRestore(restorePoints[selectedRestore])
|
||||
selectedRestore = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30021),restorePoints)
|
||||
|
||||
if(selectedRestore != -1):
|
||||
backup.selectRestore(restorePoints[selectedRestore])
|
||||
|
||||
backup.run(mode)
|
||||
backup.run(mode)
|
||||
else:
|
||||
#can't go any further
|
||||
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30045))
|
||||
utils.openSettings()
|
||||
|
@ -44,6 +44,14 @@ class XbmcBackup:
|
||||
self.remote_base_path = "/"
|
||||
self.remote_vfs = DropboxFileSystem("/")
|
||||
|
||||
def remoteConfigured(self):
|
||||
result = True
|
||||
|
||||
if(self.remote_base_path == ""):
|
||||
result = False
|
||||
|
||||
return result
|
||||
|
||||
def listBackups(self):
|
||||
result = []
|
||||
|
||||
|
@ -10,6 +10,9 @@ def data_dir():
|
||||
def addon_dir():
|
||||
return __Addon.getAddonInfo('path')
|
||||
|
||||
def openSettings():
|
||||
__Addon.openSettings()
|
||||
|
||||
def log(message,loglevel=xbmc.LOGNOTICE):
|
||||
xbmc.log(encode(__addon_id__ + ": " + message),level=loglevel)
|
||||
|
||||
|
18
scheduler.py
18
scheduler.py
@ -50,14 +50,18 @@ class BackupScheduler:
|
||||
utils.showNotification(utils.getString(30053))
|
||||
#run the job in backup mode, hiding the dialog box
|
||||
backup = XbmcBackup()
|
||||
backup.run(XbmcBackup.Backup,True)
|
||||
|
||||
#check if this is a "one-off"
|
||||
if(int(utils.getSetting("schedule_interval")) == 0):
|
||||
#disable the scheduler after this run
|
||||
self.enabled = "false"
|
||||
utils.setSetting('enable_scheduler','false')
|
||||
if(backup.remoteConfigured()):
|
||||
backup.run(XbmcBackup.Backup,True)
|
||||
|
||||
#check if this is a "one-off"
|
||||
if(int(utils.getSetting("schedule_interval")) == 0):
|
||||
#disable the scheduler after this run
|
||||
self.enabled = "false"
|
||||
utils.setSetting('enable_scheduler','false')
|
||||
else:
|
||||
utils.showNotification(utils.getString(30045))
|
||||
|
||||
#check if we should shut the computer down
|
||||
if(utils.getSetting("cron_shutdown") == 'true'):
|
||||
#wait 10 seconds to make sure all backup processes and files are completed
|
||||
@ -81,7 +85,7 @@ class BackupScheduler:
|
||||
|
||||
if(new_run_time != self.next_run):
|
||||
self.next_run = new_run_time
|
||||
utils.showNotification(utils.getString(30080) + " " + datetime.datetime.fromtimestamp(self.next_run).strftime('%m-%d-%Y %H:%M'))
|
||||
utils.showNotification(utils.getString(30081) + " " + datetime.datetime.fromtimestamp(self.next_run).strftime('%m-%d-%Y %H:%M'))
|
||||
utils.log("scheduler will run again on " + datetime.datetime.fromtimestamp(self.next_run).strftime('%m-%d-%Y %H:%M'))
|
||||
|
||||
def settingsChanged(self):
|
||||
|
Loading…
Reference in New Issue
Block a user