New Addon Manager informations for developers.
#1
Question 
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
Reply
#2
ready to learn Big Grin
Reply
#3
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...
Always read the XBMC Online Manual,Frequently Asked Questions and search the forum before posting.
For troubleshooting and bug reporting use -> Log file.

Reply
#4
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
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#5
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" ]) 
Reply
#6
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.
Always read the XBMC Online Manual,Frequently Asked Questions and search the forum before posting.
For troubleshooting and bug reporting use -> Log file.

Reply
#7
<platforms>
<platform>all</platform>
<platform>windows</platform>
<platform>linux</platform>
</platforms>

Why have <platform>all</platform> ?
The normal XBMC log IS NOT a debug log, to enable debug logging you must toggle it on under XBMC Settings - System or in advancedsettings.xml. Use XBMC Debug Log Addon to retrieve it.
Reply
#8
thinks, that's just an example no ?
Reply
#9
yes. if you use <platform>all</platform> you don't need others.
Reply
#10
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
Reply
#11
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
Always read the XBMC Online Manual,Frequently Asked Questions and search the forum before posting.
For troubleshooting and bug reporting use -> Log file.

Reply
#12
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.
Reply
#13
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/addon...source.xsd

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

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#14
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?
Reply
#15
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
Reply

Logout Mark Read Team Forum Stats Members Help
New Addon Manager informations for developers.0