Example #1
0
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:
        listItem = xbmcgui.ListItem(
            label=item['name'],
            path=item['path'],
            iconImage=item['logo'],
            thumbnailImage=item['thumbnail'],
            )

        #print "===> adding: " + str(item[0]) + " " + str(item[2])
        print "===> adding: " + str(item)
        xbmcplugin.addDirectoryItem(thisPlugin, item['path'], listItem, isFolder=False, totalItems=len(listing))

    # tell xbmc we have finished creating the directory listing
    xbmcplugin.endOfDirectory(thisPlugin)
Example #2
0
    def end_of_directory(self, succeeded=True, update_listing=False,
                         cache_to_disc=True):
        '''Wrapper for xbmcplugin.endOfDirectory. Records state in
        self._end_of_directory.

        Typically it is not necessary to call this method directly, as
        calling :meth:`~xbmcswift2.Plugin.finish` will call this method.
        '''
        if not self._end_of_directory:
            self._end_of_directory = True
            # Finalize the directory items
            return xbmcplugin.endOfDirectory(self.handle, succeeded,
                                             update_listing, cache_to_disc)
        assert False, 'Already called endOfDirectory.'
Example #3
0
    def end_of_directory(self, succeeded=True, update_listing=False,
                         cache_to_disc=True):
        '''Wrapper for xbmcplugin.endOfDirectory. Records state in
        self._end_of_directory.

        Typically it is not necessary to call this method directly, as
        calling :meth:`~xbmcswift2.Plugin.finish` will call this method.
        '''
        if not self._end_of_directory:
            self._end_of_directory = True
            # Finalize the directory items
            return xbmcplugin.endOfDirectory(self.handle, succeeded,
                                             update_listing, cache_to_disc)
        assert False, 'Already called endOfDirectory.'
 def end_of_directory(self):
     '''Tell XBMC that we have finished adding items to this directory.'''
     xbmcplugin.endOfDirectory(self.handle)