Kodi Community Forum
New Addon Manager informations for developers. - 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: New Addon Manager informations for developers. (/showthread.php?tid=70731)

Pages: 1 2 3 4 5 6


New Addon Manager informations for developers. - queeup - 2010-03-25

Hi,

I guess Addon Manager development almost finished. Could you share some important things with us? I want to be ready before new Addon Manager release.

I have description.xml sample one of the @rwparris send to us via e-mail. But it's seems old now. I need new example file with all new strings.

Any other information also appreciated Smile


- ppic - 2010-03-25

ready to learn Big Grin


- jurrabi - 2010-03-25

I got some plugins to start working with some changes... I'd like to share them.

Be aware that this is not developers info, but just try&fail testing...


1. You need the plugin in the new addons directory

2. You need a unique ID per plugin. The team is naming something like "inverted.domain.type" but some programmers have told me that you can name it what ever you want, as far as it is unique.

3. You need a description.xml file. Plugin structure:

[HTML]<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addoninfo>
<id>com.domain.pluginID</id>
<type>plugin</type>
<supportedcontent>
<content>video</content>
</supportedcontent>
<title>plugin title</title>
<library>default.py</library>
<version>1.0.0</version>
<platforms>
<platform>all</platform>
<platform>windows</platform>
<platform>linux</platform>
</platforms>
<minversion>
<xbmc>25000</xbmc>
</minversion>
<summary>Sort description of plugin content</summary>
<description>Detailed description of plugin functions</description>
<author>you</author>
</addoninfo>[/HTML]

4. xbmcplugin module has some changes.
4.1 xbmcplugin.getSetting grows in parameters from 1 to 2. now a call looks like this:
Code:
pluginhandle = int (sys.argv[1])
settingvalue = xbmcplugin.getSetting ( pluginhandle,  "downloadpath")

4.2 xbmcplugin.openSettings disappears. Don't know new option for this yet.


If you want I can keep updating this until official word from developers...


- jmarshall - 2010-03-26

There may be some more changes to the XML in the wind which is why it hasn't yet been announced Smile

The above is correct regarding id and the handle change for xbmcplugin.getSetting.

Cheers,
Jonathan


- queeup - 2010-03-26

Thx for answers guys. I want to ask some questions.

<supportedcontent> is equivalent with xbmcplugin.setContent ? If it's equivalent we don't need to use setContent in plugin code I guess.

Is it possible to use xbmcplugin.setSetting & xbmcplugin.getSetting for argv? I mean can I use it instead of this code?
PHP Code:
params dict(part.split('=') for part in sys.argv][ 1: ].split('&'))
caturl urllib.unquote_plus(params"url" ]) 



- jurrabi - 2010-03-26

Nope (and correct me if I'm wrong)

What you talk about are parameters, that you still get the same way.

settings are what the user can configure about your plugin in the plugin configuration screen.


- CrashX - 2010-03-26

<platforms>
<platform>all</platform>
<platform>windows</platform>
<platform>linux</platform>
</platforms>

Why have <platform>all</platform> ?


- ppic - 2010-03-26

thinks, that's just an example no ?


- queeup - 2010-03-26

yes. if you use <platform>all</platform> you don't need others.


- saspes - 2010-04-16

Problem with xbmcplugin.setSetting():

Add:
self._handle = int(sys.argv[ 1 ])
xbmcplugin.setSetting( self._handle, "temp", "temp" )

ERROR:
more keyword list entries than argument specifiers


- jurrabi - 2010-04-16

Use something like this (or just the else part if you are not interested in a multiversion compatible script):


Code:
    if VERSION_XBMC <= 28764:
        xbmcplugin.openSettings( sys.argv[ 0 ] )
    else:
        sys.modules["__main__"].__settings__.openSettings()

and to get the xbmc version I'm using something like this (I'm sure there are better ways)


Code:
try:
    buildVersion = xbmc.getInfoLabel("System.BuildVersion")
    if buildVersion.startswith('PRE-10.') or buildVersion.startswith('10.') or buildVersion.startswith('UNKNOWN'):
        # Probablemente se trate de xbmc - buscamos la revisión en la forma rXXXXX
        xbmc.output ("[xbmctools] XBMC BuildVersion: " + buildVersion)
        rev_re = re.compile(' r(\d+)')
        VERSION_XBMC = int (rev_re.search(buildVersion).group(1))
    elif buildVersion.startswith('0.9.'):
        # Probablemente se trata de la betaX de Boxee
        xbmc.output ("[xbmctools] BOXEE BuildVersion: " + buildVersion)
        rev_re = re.compile('0\.9\.\d+\.(\d+)')
        VERSION_BOXEE = int (rev_re.search(buildVersion).group(1))
        VERSION_XBMC = 0
        xbmc.output ("[xbmctools] init Versión BOXEE: %d" % (VERSION_BOXEE,))
    else: #Falta código para Plex... Cuando tenga acceso
        VERSION_XBMC = 0
except:
    xbmc.output ("[xbmctools] init except: %s" % (sys.exc_info()[0],))
    VERSION_XBMC = 0



- highlandsun - 2010-06-09

Where's the official documentation for these changes? I've tried updating the hulu plugin - written an addon.xml file for it, tweaked the getSettings API, but I get nothing. Using a fresh pull, svn r30995.

In the xbmc.log I see this:
23:46:18 T:139723181070400 M:3003072512 INFO: ADDON: cpluff: 'Plug-in xbmc.gui has been installed.'
23:46:18 T:139723181070400 M:3003072512 INFO: ADDON: cpluff: 'Plug-in plugin.video.hulu has been installed.'

But my Video library is empty. What's the trick to get it to actually load?

Would be nice if one of the sticky posts got updated with this info. The wiki is out of date, and there doesn't appear to be any other doc anywhere.


- jmarshall - 2010-06-09

Official docs are in process. In the meantime, here's one I did for one of the other plugins that was around here a while ago:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.fukung.nsfw"
       name="Fukung NSFW"
       version="1.0.0"
       provider-name="GrimmVarg">
  <requires>
    <import addon="xbmc.python" version="1.0"/>
  </requires>
  <extension point="xbmc.python.pluginsource"
             library="default.py">
    <provides>image</provides>
  </extension>
  <extension point="xbmc.addon.metadata">
    <summary>Pictures from Fukung NSFW</summary>
    <description></description>
    <platform>all</platform>
  </extension>
</addon>

There's a schema for the xbmc.python.pluginsource extension point inside the xbmc.python folder in SVN:

http://trac.xbmc.org/browser/trunk/addons/xbmc.python/pluginsource.xsd

Similarly, there's a schema in the other xbmc.addon folder for the xbmc.addon.metadata extension point.

Cheers,
Jonathan


- highlandsun - 2010-06-09

Thanks, that helped. Now it's pretty much working, but none of my plugin's localized strings are being displayed. I'm just getting blanks instead. Something else changed in how that needs to be initialized?


- amet - 2010-06-09

highlandsun Wrote:Thanks, that helped. Now it's pretty much working, but none of my plugin's localized strings are being displayed. I'm just getting blanks instead. Something else changed in how that needs to be initialized?

to have the localized strings you have to

Code:
import xbmcaddon

__settings__ = xbmcaddon.Addon(id='plugin.fukung.nsfw')

__language__ = __settings__.getLocalizedString