Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

will now check for arguments "backup" or "restore" to bypass dialog p…

  • Loading branch information...
1 parent 3cd1ae3 commit 36332f20b8bf8b97361974bf068cfc57af4fc285 @robweber committed
Showing with 26 additions and 3 deletions.
  1. +8 −0 README.txt
  2. +1 −1  addon.xml
  3. +4 −0 changelog.txt
  4. +13 −2
8 README.txt
@@ -26,6 +26,14 @@ Using Dropbox as a storage target adds a few steps the first time you wish to ru
Once you have your app key and secret add them to the settings. XBMC Backup now needs to have permission to access your Dropbox account. When you see the prompt regarding the Dropbox URL Authorization DO NOT click OK. Check your XBMC log file for a line from "script.xbmcbackup" containing the authorization URL. Cut/paste this into a browser and click Allow. Once this is done you can click "OK" in XBMC and proceed as normal. XBMC Backup will cache the authorization code so you only have to do this once, or if you revoke the Dropbox permissions.
+Scripting XBMC Backup:
+If you wish to script this addon using an outside scheduler or script it can be given parameters via the Xbmc.RunScript() or JsonRPC.Addons.ExecuteAddon() methods. Parameters given are either "backup" or "restore" to launch the correct program mode. An example would be:
What this Addon Will Not Do:
This is not meant as an XBMC file sync solution. If you have multiple frontends you want to keep in sync this addon may work in a "poor man's" sort of way but it is not intended for that.
2  addon.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="script.xbmcbackup"
- name="XBMC Backup" version="0.3.3" provider-name="robweber">
+ name="XBMC Backup" version="0.3.4" provider-name="robweber">
<import addon="xbmc.python" version="2.1.0"/>
4 changelog.txt
@@ -1,3 +1,7 @@
+Version 0.3.4
+added ability to take parameters via RunScript() or JSONRPC.Addons.ExecuteAddon()
Version 0.3.3
updated xbmc python version (2.1.0)
@@ -2,8 +2,19 @@
import resources.lib.utils as utils
from resources.lib.backup import XbmcBackup
-#figure out if this is a backup or a restore
-mode = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30023),[utils.getString(30016),utils.getString(30017)])
+#the program mode
+mode = -1
+#check if mode was passed in as an argument
+if(len(sys.argv) > 1):
+ if(sys.argv[1].lower() == 'backup'):
+ mode = 0
+ elif(sys.argv[1].lower() == 'restore'):
+ mode = 1
+if(mode == -1):
+ #figure out if this is a backup or a restore from the user
+ mode = xbmcgui.Dialog().select(utils.getString(30010) + " - " + utils.getString(30023),[utils.getString(30016),utils.getString(30017)])
if(mode != -1):
#run the profile backup

0 comments on commit 36332f2

Please sign in to comment.
Something went wrong with that request. Please try again.