Long running plugins
#1
Hello,

I'm rather new at Addon development, therefore I need to state a general question:

I try to run a common video plugin with code as seen below:

Code:
import xbmc,xbmcgui
import xbmcaddon

time2wait=20000
dialog=xbmcgui.DialogProgressBG()
dialog.create("title","please wait...")
step=int(100.0/time2wait)

for n in range(time2wait):
    dialog.update(n*step)
    xbmc.sleep(1)

print "ready to go"
xbmc.executebuiltin('Notification(%s, %s, %d, %s)'%("Script", "Finished", 5000, None))

The problem is, the complete GUI is freezing without any refresh of the progress bar.
Same happens with the foreground version: I cannot cancel it via mouse. The cancel-button does not react.
Only pressing ESC kills the script in a hard way.

So my question is: Is there a way to run plugins "in background" such that the dialogs will render and react correctly?

I'm using ArchLinux. With XBMC version:
XBMC Media Center 13.2 Git:Unknown
Copyright © 2005-2013 Team XBMC - http://xbmc.org

Best regards
Alex
Reply
#2
Try increasing your sleep value to 1000 (1 second).
Its possible that the for loop is to tight.
Reply
#3
Sorry, this doesn't work either.
But when I change my addon from video-plugin to a service, everything works fine.
I can use my plugin as service without any problem. so when nobody needs further investigation I can close the thread.
Reply

Logout Mark Read Team Forum Stats Members Help
Long running plugins0