Kodi Community Forum
Script Module or Service? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+--- Thread: Script Module or Service? (/showthread.php?tid=122149)



Script Module or Service? - Eldorado - 2012-02-06

I'm looking to have 3 new scripts added to the official repository, but before I do so I would like to make sure that they are setup correctly

t0mm0's common lib & urlresolver - http://forum.xbmc.org/showthread.php?tid=105707
metahandlers - http://forum.xbmc.org/showthread.php?tid=105707

All 3 are helper scripts for creating addons, currently they are all defined as script modules - xbmc.python.module

I don't see any way of being able to install/uninstall/configure/rollback these types of scripts, so I'm second guessing if they should instead be defined as services?

I'm not really familiar with services and what makes them a service rather than a module.. ability to run in the background?

Is it wrong if I change these to be a service?


- giftie - 2012-02-07

Eldorado Wrote:I'm looking to have 3 new scripts added to the official repository, but before I do so I would like to make sure that they are setup correctly

t0mm0's common lib & urlresolver - http://forum.xbmc.org/showthread.php?tid=105707
metahandlers - http://forum.xbmc.org/showthread.php?tid=105707

All 3 are helper scripts for creating addons, currently they are all defined as script modules - xbmc.python.module

I don't see any way of being able to install/uninstall/configure/rollback these types of scripts, so I'm second guessing if they should instead be defined as services?

I'm not really familiar with services and what makes them a service rather than a module.. ability to run in the background?

Is it wrong if I change these to be a service?

A script module is installed when the Addon Manager comes across an addon.xml that requires the module.

Code:
<requires>
    <import addon="xbmc.python" version="2.0"/>
    <import addon="script.module.pil" version="1.1.7"/>
  </requires>

The version is controlled by the addon.xml. There doesn't seem to be a rollback for script modules

Also the script using the modules can adjust the script module settings(if needed) using the setSetting() in xbmcaddon.

A Service addon is one that runs at the start of XBMC.