addDirectoryItem, simple script I can't understand.
#1
Hi, i write simple python script. When I click on button1 I want to display a button2. What I doing wrong?

Code:
xbmcgui.Dialog().ok('', sys.argv[2])
def select():
        xbmcplugin.setContent(int(sys.argv[1]),'movies')
        xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys.argv[0] + "?foo", listitem=xbmcgui.ListItem(label="button1"), isFolder=False)
        xbmcplugin.endOfDirectory(int(sys.argv[1]))

def select2():
        xbmcplugin.setContent(int(sys.argv[1]),'movies')
        xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=sys.argv[0], listitem=xbmcgui.ListItem(label="button2"), isFolder=False)
        xbmcplugin.endOfDirectory(int(sys.argv[1]))
        

if sys.argv[2] == "?foo":
    select2()
else:
    select()
Reply
#2
isFolder=False tells XBMC that this is a media file to be passed to a player. For your plugin to be launched recursively you need to use isFolder=True.
Reply
#3
Heh, Thanks a lot.
Reply

Logout Mark Read Team Forum Stats Members Help
addDirectoryItem, simple script I can't understand.0