Skip to content

Commit

Permalink
background run
Browse files Browse the repository at this point in the history
  • Loading branch information
primaeval committed Aug 12, 2016
1 parent 6fd4ac3 commit 4a78b1d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
5 changes: 1 addition & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
22 changes: 22 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 4a78b1d

Please sign in to comment.