当前位置: 首页>>代码示例>>Python>>正文


Python pluginHandler.cPluginHandler函数代码示例

本文整理汇总了Python中resources.lib.handler.pluginHandler.cPluginHandler函数的典型用法代码示例。如果您正苦于以下问题:Python cPluginHandler函数的具体用法?Python cPluginHandler怎么用?Python cPluginHandler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cPluginHandler函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getDownload

    def getDownload(self):

        oGui = cGui()
        sPluginHandle = cPluginHandler().getPluginHandle()
        sPluginPath = cPluginHandler().getPluginPath()
        sItemUrl = '%s?site=%s&function=%s&title=%s' % (sPluginPath, SITE_IDENTIFIER, 'StartDownloadList', 'tittle')
        meta = {'title': 'Demarrer la liste'}
        item = xbmcgui.ListItem('Demarrer la liste', iconImage=cConfig().getRootArt()+'download.png')
        item.setProperty("Fanart_Image", cConfig().getSetting('images_downloads'))
        
        #item.setInfo(type="Video", infoLabels = meta)
        
        #item.setProperty("Video", "false")
        #item.setProperty("IsPlayable", "false")

        xbmcplugin.addDirectoryItem(sPluginHandle,sItemUrl,item,isFolder=False)
        
        oOutputParameterHandler = cOutputParameterHandler()
        oGui.addDir(SITE_IDENTIFIER, 'StopDownloadList', 'Arreter les Téléchargements', 'download.png', oOutputParameterHandler)

        oOutputParameterHandler = cOutputParameterHandler()
        oGui.addDir(SITE_IDENTIFIER, 'getDownloadList', 'Liste de Téléchargement', 'download.png', oOutputParameterHandler)
        
        oOutputParameterHandler = cOutputParameterHandler()
        oGui.addDir(SITE_IDENTIFIER, 'CleanDownloadList', 'Nettoyer la liste (Fichiers finis)', 'download.png', oOutputParameterHandler)
          
        oGui.setEndOfDirectory()   
开发者ID:X-ardion,项目名称:venom-xbmc-addons,代码行数:27,代码来源:download.py

示例2: searchGlobal

def searchGlobal():
    import threading
    oGui = cGui()
    sSearchText = oGui.showKeyBoard()
    if (sSearchText != False and sSearchText != ''):
        aPlugins = []
        aPlugins = cPluginHandler().getAvailablePlugins()
        dialog = xbmcgui.DialogProgress()
        dialog.create('xStream',"Searching...")
        numPlugins = len(aPlugins)
        count = 0
        threads = []
        for pluginEntry in aPlugins:
            dialog.update(count*100/numPlugins,'Searching: '+str(pluginEntry['name'])+'...')
            count += 1
            logger.info('Searching for %s at %s' % (sSearchText, pluginEntry['id']))
            t = threading.Thread(target=_pluginSearch, args=(pluginEntry,sSearchText,oGui))
            threads += [t]
            t.start()
        for t in threads: 
            t.join()
        dialog.close()
        oGui.setView()
        oGui.setEndOfDirectory()
    return True
开发者ID:BIade86,项目名称:plugin.video.xstream,代码行数:25,代码来源:xstream.py

示例3: searchGlobal

def searchGlobal():
    oGui = cGui()
    sSearchText = oGui.showKeyBoard()
    if (sSearchText != False and sSearchText != ''):
        aPlugins = []
        aPlugins = cPluginHandler().getAvailablePlugins()
        oGui.dialog = xbmcgui.DialogProgress()
        oGui.dialog.create('xStream',"Searching...")
        numPlugins = len(aPlugins)
        count = 0
        for pluginEntry in aPlugins:
            pluginName = str(pluginEntry['name'])
            pluginSiteName = pluginEntry['id']
            oGui.dialog.update(count*100/numPlugins,'Searching: '+pluginName+'...')
            count += 1
            logger.info('Searching for "'+sSearchText+'" at '+pluginName)
            try:
                plugin = __import__(pluginSiteName, globals(), locals())
                function = getattr(plugin, '_search')
                oGuiElement = cGuiElement('[B][COLOR yellow]----'+pluginName+'----[/COLOR][/B]',pluginSiteName,'spacer')
                if len(pluginEntry)>2:
                    oGuiElement.setThumbnail(pluginEntry['icon'])
                oGui.addFolder(oGuiElement)
                function(oGui, sSearchText)
            except:
                logger.info(pluginName+': search failed')
                import traceback
                print traceback.format_exc()
        oGui.dialog.close()
        oGui.setView()
        oGui.setEndOfDirectory()
    return True
开发者ID:badwog1,项目名称:kodi-repo-gaymods,代码行数:32,代码来源:xstream.py

示例4: searchGlobal

def searchGlobal():
    import threading
    oGui = cGui()
    oGui.globalSearch = True
    oGui._collectMode = True
    sSearchText = oGui.showKeyBoard()
    if not sSearchText: return True
    aPlugins = []
    aPlugins = cPluginHandler().getAvailablePlugins()
    dialog = xbmcgui.DialogProgress()
    dialog.create('xStream',"Searching...")
    numPlugins = len(aPlugins)
    threads = []
    for count, pluginEntry in enumerate(aPlugins):
        dialog.update((count+1)*50/numPlugins,'Searching: '+str(pluginEntry['name'])+'...')
        logger.info('Searching for %s at %s' % (sSearchText, pluginEntry['id']))
        t = threading.Thread(target=_pluginSearch, args=(pluginEntry,sSearchText,oGui), name =pluginEntry['name'])
        threads += [t]
        t.start()
    for count, t in enumerate(threads):
        t.join()
        dialog.update((count+1)*50/numPlugins+50, t.getName()+' returned')
    dialog.close()
    # deactivate collectMode attribute because now we want the elements really added
    oGui._collectMode = False
    total=len(oGui.searchResults)
    for result in sorted(oGui.searchResults, key=lambda k: k['guiElement'].getSiteName()):
        oGui.addFolder(result['guiElement'],result['params'],bIsFolder=result['isFolder'],iTotal=total)
    oGui.setView()
    oGui.setEndOfDirectory()
    return True
开发者ID:Shinoby1992,项目名称:xstream,代码行数:31,代码来源:xstream.py

示例5: addFolder

    def addFolder(self, oGuiElement, oOutputParameterHandler='', isFolder=True):
        
        if oOutputParameterHandler.getValue('siteUrl'):
            sSiteUrl = oOutputParameterHandler.getValue('siteUrl')
            oGuiElement.setSiteUrl(sSiteUrl)
            
        oListItem = self.createListItem(oGuiElement)
        
        # if oGuiElement.getMeta():
            # oOutputParameterHandler.addParameter('sMeta', oGuiElement.getMeta())
        
        
        sItemUrl = self.__createItemUrl(oGuiElement, oOutputParameterHandler)
        
        #new context prend en charge les metas
        if cGui.CONTENT == "movies":
            self.createContexMenuWatch(oGuiElement, oOutputParameterHandler)
            #self.createContexMenuSimil(oGuiElement, oOutputParameterHandler)
            self.createContexMenuinfo(oGuiElement, oOutputParameterHandler)
            self.createContexMenuFav(oGuiElement, oOutputParameterHandler)

        elif cGui.CONTENT == "tvshows":
            self.createContexMenuWatch(oGuiElement, oOutputParameterHandler)
            self.createContexMenuinfo(oGuiElement, oOutputParameterHandler)
            self.createContexMenuFav(oGuiElement, oOutputParameterHandler)

        oListItem = self.__createContextMenu(oGuiElement, oListItem)
       
        sPluginHandle = cPluginHandler().getPluginHandle();

        xbmcplugin.addDirectoryItem(sPluginHandle, sItemUrl, oListItem, isFolder=isFolder)      
开发者ID:Peter31h,项目名称:venom-xbmc-addons,代码行数:31,代码来源:gui.py

示例6: setEndOfDirectory

    def setEndOfDirectory(self, ForceViewMode = False):

        iHandler = cPluginHandler().getPluginHandle()
        #modif 22/06
        if not self.listing:
            self.addText('cGui')

        xbmcplugin.addDirectoryItems(iHandler, self.listing, len(self.listing))

        xbmcplugin.setPluginCategory(iHandler, "")
        xbmcplugin.setContent(iHandler, cGui.CONTENT)
        xbmcplugin.addSortMethod(iHandler, xbmcplugin.SORT_METHOD_NONE)
        xbmcplugin.endOfDirectory(iHandler, succeeded=True, cacheToDisc=True)
        #reglage vue
        #50 = liste / 51 grande liste / 500 icone / 501 gallerie / 508 fanart /
        if (ForceViewMode):
            xbmc.executebuiltin('Container.SetViewMode(' + str(ForceViewMode) + ')')
        else:
            if (self.ADDON.getSetting('active-view') == 'true'):
                if cGui.CONTENT == "movies":
                    #xbmc.executebuiltin('Container.SetViewMode(507)')
                    xbmc.executebuiltin('Container.SetViewMode(%s)' % self.ADDON.getSetting('movie-view'))
                elif cGui.CONTENT == "tvshows":
                    xbmc.executebuiltin('Container.SetViewMode(%s)' % self.ADDON.getSetting('serie-view'))
                elif cGui.CONTENT == "files":
                    xbmc.executebuiltin('Container.SetViewMode(%s)' % self.ADDON.getSetting('default-view'))

        #bug affichage Kodi 18
        del self.listing [:]
开发者ID:LordVenom,项目名称:venom-xbmc-addons,代码行数:29,代码来源:gui.py

示例7: searchAlter

def searchAlter(params):
    searchText = params.getValue('searchTitle')
    searchImdbId = params.getValue('searchImdbID')
    import threading
    oGui = cGui()
    aPlugins = []
    aPlugins = cPluginHandler().getAvailablePlugins()
    dialog = xbmcgui.DialogProgress()
    dialog.create('xStream',"Searching...")
    numPlugins = len(aPlugins)
    count = 0
    threads = []
    for pluginEntry in aPlugins:
        dialog.update(count*100/numPlugins,'Searching: '+str(pluginEntry['name'])+'...')
        count += 1
        logger.info('Searching for "'+searchText+'" at '+pluginEntry['id'])
        t = threading.Thread(target=pluginSearch, args=(pluginEntry,searchText))
        threads += [t]
        t.start()
    for t in threads: 
        t.join()
    dialog.close()
    oGui.setView()
    oGui.setEndOfDirectory()
    #xbmc.executebuiltin('Container.Update')
    return True
开发者ID:Shinoby1992,项目名称:plugin.video.xstream,代码行数:26,代码来源:xstream.py

示例8: selectpage

    def selectpage(self):
        sPluginPath = cPluginHandler().getPluginPath();
        oInputParameterHandler = cInputParameterHandler()        
        #sParams = oInputParameterHandler.getAllParameter()

        sId = oInputParameterHandler.getValue('sId')
        sFunction = oInputParameterHandler.getValue('OldFunction')
        siteUrl = oInputParameterHandler.getValue('siteUrl')
        
        oParser = cParser()
        oldNum = oParser.getNumberFromString(siteUrl)
        newNum = 0
        if oldNum:
            newNum = self.showNumBoard()
        if newNum:
            try:
                siteUrl = siteUrl.replace(oldNum,newNum)
                
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', siteUrl)
                sParams = oOutputParameterHandler.getParameterAsUri()
                sTest = '%s?site=%s&function=%s&%s' % (sPluginPath, sId, sFunction, sParams)                
                xbmc.executebuiltin('XBMC.Container.Update(%s)' % sTest )
            except:
                return False
        
        return False     
开发者ID:Peter31h,项目名称:venom-xbmc-addons,代码行数:27,代码来源:gui.py

示例9: searchGlobal

def searchGlobal():
    oGui = cGui()
    sSearchText = oGui.showKeyBoard()
    if (sSearchText != False and sSearchText != ''):
        aPlugins = []
        aPlugins = cPluginHandler().getAvailablePlugins()
        for pluginEntry in aPlugins:
            pluginName = pluginEntry[0]
            pluginSiteName = pluginEntry[1]
            logger.info('Searching for "'+sSearchText+'" at '+pluginName)
            try:
                plugin = __import__(pluginSiteName, globals(), locals())
                function = getattr(plugin, '_search')
                oGuiElement = cGuiElement('[B][COLOR yellow]----'+pluginName+'----[/COLOR][/B]',pluginSiteName,'spacer')
                if len(pluginEntry)>2:
                    oGuiElement.setThumbnail(pluginEntry[2])
                oGui.addFolder(oGuiElement)
                function(oGui, sSearchText)
            except:
                logger.info(str(pluginName)+': search failed')
                import traceback
                print traceback.format_exc()
        oGui.setView()
        oGui.setEndOfDirectory()
    return True
开发者ID:choiipad,项目名称:plugin.video.xstream,代码行数:25,代码来源:xstream.py

示例10: __createContextMenu

    def __createContextMenu(self, oGuiElement, oListItem, bIsFolder, oOutputParams=''):
        sPluginPath = cPluginHandler().getPluginPath()
        aContextMenus = []

        if len(oGuiElement.getContextItems()) > 0:
            for oContextItem in oGuiElement.getContextItems():
                oOutputParameterHandler = oContextItem.getOutputParameterHandler()
                sParams = oOutputParameterHandler.getParameterAsUri()
                sTest = "%s?site=%s&function=%s&%s" % (sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams)
                aContextMenus += [(oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest,),)]

        oContextItem = cContextElement()
        oContextItem.setTitle("Info")
        aContextMenus += [(oContextItem.getTitle(), "XBMC.Action(Info)",)]
        if not bIsFolder:
            oContextItem.setTitle("add to Playlist")

            aContextMenus += [(oContextItem.getTitle(), "XBMC.Action(Info)",)]
            oContextItem.setTitle("Download")
            aContextMenus += [(oContextItem.getTitle(), "XBMC.Action(Info)",)]
            oContextItem.setTitle("send to JDownloader")
            aContextMenus += [(oContextItem.getTitle(), "XBMC.Action(Info)",)]

        oListItem.addContextMenuItems(aContextMenus)
        return oListItem
开发者ID:krikkiteer,项目名称:xbmc-xstream-plugin,代码行数:25,代码来源:gui.py

示例11: __createItemUrl

 def __createItemUrl(self, oGuiElement, bIsFolder, oOutputParameterHandler=''):
     if (oOutputParameterHandler == ''):
         #cOutputParameterHandler
         oOutputParameterHandler = ParameterHandler()
     if not bIsFolder:
         thumbnail = oGuiElement.getThumbnail()
         if thumbnail:
             oOutputParameterHandler.setParam('thumb',thumbnail) 
         itemValues = oGuiElement.getItemValues()
         metaParams = {} 
         if 'imdb_id' in itemValues and itemValues['imdb_id']:
             oOutputParameterHandler.setParam('imdbID',itemValues['imdb_id'])
         #if itemValues['title']:
         #    metaParams['title'] = itemValues['title']
         if 'mediaType' in itemValues and itemValues['mediaType']:
             oOutputParameterHandler.setParam('mediaType',itemValues['mediaType'])
         elif 'TVShowTitle' in itemValues and itemValues['TVShowTitle']:
             oOutputParameterHandler.setParam('mediaType','tvshow')
         if 'season' in itemValues and itemValues['season'] and int(itemValues['season'])>0:
             oOutputParameterHandler.setParam('season',itemValues['season'])
             oOutputParameterHandler.setParam('mediaType','season')
         if 'episode' in itemValues and itemValues['episode'] and int(itemValues['episode'])>0:
             oOutputParameterHandler.setParam('episode',itemValues['episode'])
             oOutputParameterHandler.setParam('mediaType','episode')
         oOutputParameterHandler.setParam('playMode','play')               
     sParams = oOutputParameterHandler.getParameterAsUri()
     sPluginPath = cPluginHandler().getPluginPath()
     if len(oGuiElement.getFunction()) == 0:
         sItemUrl = "%s?site=%s&title=%s&%s" % (sPluginPath, oGuiElement.getSiteName(), urllib.quote_plus(oGuiElement.getTitle()), sParams)
     else:
         sItemUrl = "%s?site=%s&function=%s&title=%s&%s" % (sPluginPath, oGuiElement.getSiteName(), oGuiElement.getFunction(), urllib.quote_plus(oGuiElement.getTitle()), sParams)
     return sItemUrl
开发者ID:Lokke,项目名称:plugin.video.xstream,代码行数:32,代码来源:gui.py

示例12: __createContextMenu

  def __createContextMenu(self, oGuiElement, oListItem):
    sPluginPath = cPluginHandler().getPluginPath();
    aContextMenus = []

    if len(oGuiElement.getContextItems()) > 0:
      for oContextItem in oGuiElement.getContextItems():                
        oOutputParameterHandler = oContextItem.getOutputParameterHandler()
        sParams = oOutputParameterHandler.getParameterAsUri()
        sTest = "%s?site=%s&function=%s&%s" % (sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams)                
        aContextMenus+= [ ( oContextItem.getTitle(), "XBMC.RunPlugin(%s)" % (sTest,),)]

      oListItem.addContextMenuItems(aContextMenus)
      #oListItem.addContextMenuItems(aContextMenus, True)

    if oGuiElement.getSiteName() != "cAboutGui":            
      oContextItem = cContextElement()
      oContextItem.setFile("cAboutGui")
      oContextItem.setTitle("Ueber xStream")
      oContextItem.setFunction("show")
      oOutputParameterHandler = oContextItem.getOutputParameterHandler()
      sParams = oOutputParameterHandler.getParameterAsUri()
      sTest = "%s?site=%s&function=%s&%s" % (sPluginPath, oContextItem.getFile(), oContextItem.getFunction(), sParams)
      aContextMenus+= [ ( oContextItem.getTitle(), "Container.Update(%s)" % (sTest,),)]
      oListItem.addContextMenuItems(aContextMenus)

    return oListItem
开发者ID:NICOLETTA1319,项目名称:xbmc-development-with-passion,代码行数:26,代码来源:gui.py

示例13: run

 def run(self, oGuiElement, sTitle, sUrl):
     sPluginHandle = cPluginHandler().getPluginHandle();
     #meta = oGuiElement.getInfoLabel()
     meta = {'label': sTitle, 'title': sTitle}
     item = xbmcgui.ListItem(path=sUrl, iconImage="DefaultVideo.png",  thumbnailImage=self.sThumbnail)
     
     item.setInfo( type="Video", infoLabels= meta )
                 
     if (cConfig().getSetting("playerPlay") == '0'):   
                         
         sPlayerType = self.__getPlayerType()
         xbmcPlayer = xbmc.Player(sPlayerType)
         xbmcPlayer.play( sUrl, item )
         xbmcplugin.endOfDirectory(sPluginHandle, True, False, False) 
         
     else:
         xbmcplugin.setResolvedUrl(sPluginHandle, True, item)
     
     timer = int(cConfig().getSetting('param_timeout'))
     xbmc.sleep(timer)
     
     while not xbmc.abortRequested:
         try: 
            self.currentTime = self.getTime()
            self.totalTime = self.getTotalTime()
         except: break
         xbmc.sleep(1000)
开发者ID:aurellulu,项目名称:venom-xbmc-addons,代码行数:27,代码来源:player.py

示例14: parseUrl

    def parseUrl(self):
	    oInputParameterHandler = cInputParameterHandler()

	    if (oInputParameterHandler.exist('function')):
	        sFunction = oInputParameterHandler.getValue('function')
	    else:
	        cConfig().log('call load methode')
	        sFunction = "load"

	    if (oInputParameterHandler.exist('site')):
	        sSiteName = oInputParameterHandler.getValue('site')
	        cConfig().log('load site ' + sSiteName + ' and call function ' + sFunction)
	        cStatistic().callStartPlugin(sSiteName)

	        if (isHosterGui(sSiteName, sFunction) == True):
	            return
	        
	        if (isGui(sSiteName, sFunction) == True):
	            return
	            
	        if (isFav(sSiteName, sFunction) == True):
	            return

	        if (isHome(sSiteName, sFunction) == True):
	            return

	        #if (isAboutGui(sSiteName, sFunction) == True):            
	            #return

	        #try:
	        exec "import " + sSiteName + " as plugin"
	        exec "plugin."+ sFunction +"()"
	        #except:
	        #    cConfig().log('could not load site: ' + sSiteName )
	    else:

	        if (cConfig().getSetting("home-view") == 'true'):
	            oHome = cHome()
	            cAbout()
	            exec "oHome."+ sFunction +"()"
	            return

	        oGui = cGui()
	        oPluginHandler = cPluginHandler()
	        aPlugins = oPluginHandler.getAvailablePlugins()
	        if (len(aPlugins) == 0):
	            oGui.openSettings()
		    oGui.updateDirectory()
	        else:
	            for aPlugin in aPlugins:
	                oGuiElement = cGuiElement()
	                oGuiElement.setTitle(aPlugin[0])
	                oGuiElement.setSiteName(aPlugin[1])
	                oGuiElement.setDescription(aPlugin[2])
	                oGuiElement.setFunction(sFunction)
	                oGuiElement.setIcon("icon.png")
	                oGui.addFolder(oGuiElement)

	        oGui.setEndOfDirectory()
开发者ID:bobynou,项目名称:venom-xbmc-addons,代码行数:59,代码来源:default.py

示例15: __isSeriesEverAvaiable

def __isSeriesEverAvaiable():
    cph = cPluginHandler()

    for site in cph.getAvailablePlugins():
        if site['id'] == SERIESEVER_IDENTIFIER:
            return True

    return False
开发者ID:StoneOffStones,项目名称:plugin.video.xstream,代码行数:8,代码来源:moviesever_com.py


注:本文中的resources.lib.handler.pluginHandler.cPluginHandler函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。