From e40e6c685d33343f360ce5539b2d840d51bdefb2 Mon Sep 17 00:00:00 2001 From: Rob Weber Date: Thu, 13 Dec 2012 15:11:25 -0600 Subject: [PATCH] support for quitting xbmc after scheduled backup --- resources/language/English/strings.xml | 1 + resources/settings.xml | 1 + scheduler.py | 10 +++++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/language/English/strings.xml b/resources/language/English/strings.xml index f709e70..d49614e 100644 --- a/resources/language/English/strings.xml +++ b/resources/language/English/strings.xml @@ -54,4 +54,5 @@ Every Week First Day of Month Custom Schedule + Shutdown After Backup diff --git a/resources/settings.xml b/resources/settings.xml index 4774662..8a81b6f 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -21,5 +21,6 @@ + diff --git a/scheduler.py b/scheduler.py index 42f00c7..8b9e990 100644 --- a/scheduler.py +++ b/scheduler.py @@ -44,7 +44,15 @@ class BackupScheduler: #run the job in backup mode, hiding the dialog box backup = XbmcBackup() backup.run(XbmcBackup.Backup,True) - self.findNextRun(now,True) + + #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 + time.sleep(10) + xbmc.executebuiltin('Quit()') + else: + #find the next run time like normal + self.findNextRun(now,True) else: self.findNextRun(now)