This commit is contained in:
Rob Weber 2013-12-05 14:26:35 -06:00
parent 25a9faed9a
commit d28596728b
5 changed files with 37 additions and 14 deletions

View File

@ -1,5 +1,7 @@
Version 0.4.3 Version 0.4.3
added error message if remote directory is blank
added license tag added license tag
Version 0.4.2 Version 0.4.2

View File

@ -20,6 +20,8 @@ if(mode != -1):
#run the profile backup #run the profile backup
backup = XbmcBackup() backup = XbmcBackup()
if(backup.remoteConfigured()):
if(mode == backup.Restore): if(mode == backup.Restore):
#allow user to select the backup to restore from #allow user to select the backup to restore from
restorePoints = backup.listBackups() restorePoints = backup.listBackups()
@ -30,3 +32,7 @@ if(mode != -1):
backup.selectRestore(restorePoints[selectedRestore]) 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()

View File

@ -44,6 +44,14 @@ class XbmcBackup:
self.remote_base_path = "/" self.remote_base_path = "/"
self.remote_vfs = DropboxFileSystem("/") self.remote_vfs = DropboxFileSystem("/")
def remoteConfigured(self):
result = True
if(self.remote_base_path == ""):
result = False
return result
def listBackups(self): def listBackups(self):
result = [] result = []

View File

@ -10,6 +10,9 @@ def data_dir():
def addon_dir(): def addon_dir():
return __Addon.getAddonInfo('path') return __Addon.getAddonInfo('path')
def openSettings():
__Addon.openSettings()
def log(message,loglevel=xbmc.LOGNOTICE): def log(message,loglevel=xbmc.LOGNOTICE):
xbmc.log(encode(__addon_id__ + ": " + message),level=loglevel) xbmc.log(encode(__addon_id__ + ": " + message),level=loglevel)

View File

@ -50,6 +50,8 @@ class BackupScheduler:
utils.showNotification(utils.getString(30053)) utils.showNotification(utils.getString(30053))
#run the job in backup mode, hiding the dialog box #run the job in backup mode, hiding the dialog box
backup = XbmcBackup() backup = XbmcBackup()
if(backup.remoteConfigured()):
backup.run(XbmcBackup.Backup,True) backup.run(XbmcBackup.Backup,True)
#check if this is a "one-off" #check if this is a "one-off"
@ -57,6 +59,8 @@ class BackupScheduler:
#disable the scheduler after this run #disable the scheduler after this run
self.enabled = "false" self.enabled = "false"
utils.setSetting('enable_scheduler','false') utils.setSetting('enable_scheduler','false')
else:
utils.showNotification(utils.getString(30045))
#check if we should shut the computer down #check if we should shut the computer down
if(utils.getSetting("cron_shutdown") == 'true'): if(utils.getSetting("cron_shutdown") == 'true'):
@ -81,7 +85,7 @@ class BackupScheduler:
if(new_run_time != self.next_run): if(new_run_time != self.next_run):
self.next_run = new_run_time 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')) utils.log("scheduler will run again on " + datetime.datetime.fromtimestamp(self.next_run).strftime('%m-%d-%Y %H:%M'))
def settingsChanged(self): def settingsChanged(self):