2010-09-08, 21:45
As some will be aware, I'm developing an addon developers guide to xbmx. I'm coming at it from the stance of a complete Python/Xbmc noob.
you can find the thread and a link to the fledgling doc here http://forum.xbmc.org/showthread.php?tid=68337
The first example script I'm writing is as follows
But the line
xbmcplugin.addDirectoryItem(thisPlugin,'',item)
fails. debug error is
xbmcplugin.addDirectoryItem(thisPlugin,'',item)
SystemError: error return without exception set
I'd appreciate any pointers as to why - as the obviously the error message is about as useful as a fart.
Like I said, that is my first bit of Python scripting ever, so no funny jokes please :-)
you can find the thread and a link to the fledgling doc here http://forum.xbmc.org/showthread.php?tid=68337
The first example script I'm writing is as follows
Code:
# Step 1 - load in xbmc core support and setup the environment
import xbmcplugin
import sys
# magic; id of this plugin - cast to integer
thisPlugin = int(sys.argv[1])
# Step 2 - create the support functions (or classes)
def createListing():
"""
Creates a listing that XBMC can display as a directory listing
@return list
"""
listing = []
listing.append('The first item')
listing.append('The second item')
listing.append('The third item')
listing.append('The fourth item')
return listing
def sendToXbmc(listing):
"""
Sends a listing to XBMC for display as a directory listing
Plugins always result in a listing
@param list listing
@return void
"""
#access global plugin id
global thisPlugin
# send each item to xbmc
for item in listing:
xbmcplugin.addDirectoryItem(thisPlugin,'',item)
# tell xbmc we have finished creating the directory listing
xbmcplugin.endOfDirectory(thisPlugin))
# Step 3 - run the program
sendToXbmc(createListing())
But the line
xbmcplugin.addDirectoryItem(thisPlugin,'',item)
fails. debug error is
xbmcplugin.addDirectoryItem(thisPlugin,'',item)
SystemError: error return without exception set
I'd appreciate any pointers as to why - as the obviously the error message is about as useful as a fart.
Like I said, that is my first bit of Python scripting ever, so no funny jokes please :-)