(2015-01-18, 14:00)takoi Wrote: (2015-01-18, 12:41)el_Paraguayo Wrote: But the problem is the script is a service so how do you pass args to a running service? Is it better to have a service and a separate "helper" add-on to handle these separate scripts (I think this is what xsqueeze did).
I'm not sure what you mean, but you can add xbmc.python.library extension point to addon.xml to run a script separate from the service. You can't communicate directly with a service as it runs in a separate python process. If you really want to go down that path you need to go through a socket or other io.
Takoi, thanks.
I'll try to describe the main problem here:
- The service provides notification of live football scores.
- The leagues that are available is pulled from the BBC site and is not static
- Therefore, when selecting the leagues to follow, I need to make a request to the website. Hence the need to run a separate script from my addon settings page.
- The service checks the settings periodically and updates for any changes identified.
- There are also separate scripts bundled with the service that display league tables, detailed match info etc which are currently being called via RunScript.
The extension point is a good point (and one I'm already planning to use, albeit for a slightly different reason) but it does lead me to a question, where you've got multiple extension points with different scripts, which one is called when you run "RunScript(your.addon.id, args)"? If it runs the "xbmc.python.library" extension, rather than the service, then this could be made to solve everything as I can create a single script to do whatever I want based on the arguments passed to it. If it runs the service, then I don't think it quite does what I want.
I'm away from my machine for a few hours now, but I'm happy to test the extension point idea above later today.
Thanks again.