From 4a78b1d01397dc077441c426ac883ae172eb6e76 Mon Sep 17 00:00:00 2001 From: primaeval Date: Fri, 12 Aug 2016 11:57:07 +0200 Subject: [PATCH] background run --- main.py | 5 +---- run.py | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 run.py diff --git a/main.py b/main.py index be14cb4..869f21b 100644 --- a/main.py +++ b/main.py @@ -322,10 +322,7 @@ def write_config(): @plugin.route('/run_webgrab') def run_webgrab(): - exe = plugin.get_setting('exe') - path = xbmc.translatePath('special://profile/addon_data/script.webgrab/webgrab/config') - status = Popen([exe,path]) - return + xbmc.executebuiltin('XBMC.RunScript(special://home/addons/script.webgrab/run.py)') @plugin.route('/copy_config') def copy_config(): diff --git a/run.py b/run.py new file mode 100644 index 0000000..8e23ff5 --- /dev/null +++ b/run.py @@ -0,0 +1,22 @@ +from subprocess import call +import xbmcaddon,xbmcgui + +dialog = xbmcgui.Dialog() + + +ADDON = xbmcaddon.Addon(id='script.webgrab') +try: LIBRE = xbmcaddon.Addon(id='service.webgrabplus') +except: LIBRE = '' +exe = ADDON.getSetting('exe') +path = ADDON.getSetting('config_output_folder') +dialog.notification("Webgrab+Plus Configurator","Starting") +if LIBRE: + status = call([exe]) +else: + status = call([exe,path]) +if status != 0: + message = "Error %s" % status +else: + message ="Finished" +dialog.notification("Webgrab+Plus Configurator",message) +