Kodi Community Forum
Accessing another addons code? - 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: Accessing another addons code? (/showthread.php?tid=82998)



Accessing another addons code? - daledude - 2010-10-11

Is there a recommended way of accessing another addons functionality or would I need to copy their code into my addon? For example, I'd like to use the Jdownloader addon to send files to Jdownloader or TVRage addon to get info on shows users configured with it.


- spiff - 2010-10-11

use the execbuiltin and submit a runplugin/RunScript with the appropriate params. it that doesn't cut it, you can alternatively split the add-ons you want to use (obviously have to get the original authors on board) in a script.module and a plugin/script. that way you can use the script.module.


- ppic - 2010-10-11

hum!

you mean if script addon.xml contains script.module we just have to import it and we will be able to load the py file pointed default=foo.py ?


- spiff - 2010-10-11

no, script.module puts a lib in the library path. you can then 'import foo' like you do with "normal" python modules/libraries. see how e.g. simplejson is used.


- ppic - 2010-10-12

yes, that's what i was meaning, sorry :ยง


- daledude - 2010-10-12

Thanks spiff. script.module is the cleaner way to go.


- Temhil - 2010-10-13

I am curious about the script.module. If someone install an addons requesting a script.module, is the user will be presented he as to install this module?
I tried something like that with a addons script using script.module.beautifulsoup without having script.module.beautifulsoup installed.
when I ran the addons, I have just got an error, but wasn't presented to install the missing script.module.beautifulsoup.

What is the expected behavior?


- spiff - 2010-10-13

deps are resolved on installation. either from a zip or from a repo. if you just copy files there manually and try to add the dep it won't be resolved. they are silently installed since from a users perspective they couldn't care less.


- Temhil - 2010-10-13

spiff Wrote:deps are resolved on installation. either from a zip or from a repo. if you just copy files there manually and try to add the dep it won't be resolved. they are silently installed since from a users perspective they couldn't care less.
Ok that's make sense now. Thank you for your quick answer.