Posts: 71
Joined: Oct 2009
Reputation:
0
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.
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
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.
Posts: 2,710
Joined: Feb 2009
Reputation:
12
ppic
Skilled Python Coder
Posts: 2,710
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 ?
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
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.
Posts: 2,710
Joined: Feb 2009
Reputation:
12
ppic
Skilled Python Coder
Posts: 2,710
yes, that's what i was meaning, sorry :§
Posts: 71
Joined: Oct 2009
Reputation:
0
Thanks spiff. script.module is the cleaner way to go.
Posts: 402
Joined: Apr 2008
Reputation:
1
Temhil
Skilled Python Coder
Posts: 402
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?
Posts: 12,706
Joined: Nov 2003
Reputation:
129
spiff
Team-Kodi Member
Posts: 12,706
2010-10-13, 14:03
(This post was last modified: 2010-10-13, 14:05 by spiff.)
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.