Ejemplo n.º 1
0
    def searchMovie(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()
        sSearchText = oInputParameterHandler.getValue('searchtext')
        sReadDB = oInputParameterHandler.getValue('readdb')
        sDisp = oInputParameterHandler.getValue('disp')

        oHandler = cRechercheHandler()
        aPlugins = oHandler.getAvailablePlugins(sDisp)
        if not sSearchText:
            sSearchText = oGui.showKeyBoard()
            sSearchText = urllib.quote(sSearchText)
        if (sSearchText != False):
            if (sReadDB != 'False'):
                meta = {}      
                meta['title'] = sSearchText
                meta['disp'] = sDisp
                cDb().insert_history(meta)
            #print aPlugins
            for aPlugin in aPlugins:
                    try:                   
                        oOutputParameterHandler = cOutputParameterHandler()
                        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
                        oGui.addDir(SITE_IDENTIFIER, 'showSearch', '[COLOR olive]'+ aPlugin[1] +'[/COLOR]', 'search.png', oOutputParameterHandler)
                    
                        exec "from resources.sites import "+aPlugin[1]+" as search"
                        sUrl = aPlugin[0]+sSearchText
                        searchUrl = "search.%s('%s')" % (aPlugin[2], sUrl)
                        exec searchUrl
                    except:       
                        pass
        else: return
        oGui.setEndOfDirectory()
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    sDisp = oInputParameterHandler.getValue('disp')
    
    dialog2 = xbmcgui.Dialog()
    dialog_select = [cConfig().getSetting('search1_label'), cConfig().getSetting('search2_label'), cConfig().getSetting('search3_label'), cConfig().getSetting('search4_label')]
    
    disp = ['search1','search2','search3','search4']
    
    ret = dialog2.select('Select Recherche',dialog_select)
     
    if ret > -1:
        
        oHandler = cRechercheHandler()
        aPlugins = oHandler.getAvailablePlugins(disp[ret])
        for aPlugin in aPlugins:
            try:                   
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
                oGui.addDir(SITE_IDENTIFIER, 'showSearch', '[COLOR olive]'+ aPlugin[1] +'[/COLOR]', 'search.png', oOutputParameterHandler)
            
                exec "from resources.sites import "+aPlugin[1]+" as search"
                sUrl = aPlugin[0]+sMovieTitle
                searchUrl = "search.%s('%s')" % (aPlugin[2], sUrl)
                exec searchUrl
            except:       
                pass
                
    oGui.setEndOfDirectory()
def VstreamSearch(sMovieTitle):
    
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    
    #Type de recherche
    sDisp = oInputParameterHandler.getValue('disp')
    
    oHandler = cRechercheHandler()
    oHandler.setText(sMovieTitle)
    oHandler.setDisp(sDisp)
    aPlugins = oHandler.getAvailablePlugins()
                
    oGui.setEndOfDirectory()
Ejemplo n.º 4
0
def VstreamSearch(sMovieTitle):

    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')

    #Type de recherche
    sDisp = oInputParameterHandler.getValue('disp')

    oHandler = cRechercheHandler()
    oHandler.setText(sMovieTitle)
    oHandler.setDisp(sDisp)
    aPlugins = oHandler.getAvailablePlugins()

    oGui.setEndOfDirectory()
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')
    
    sDisp = oInputParameterHandler.getValue('disp')
    
    dialog2 = xbmcgui.Dialog()
    dialog_select = [cConfig().getSetting('search1_label'), cConfig().getSetting('search2_label'), cConfig().getSetting('search3_label'), cConfig().getSetting('search4_label')]
    
    disp = ['search1','search2','search3','search4']
    
    if (sDisp == 'none'):
        ret = dialog2.select('Select Recherche',dialog_select)
    else:
        ret = disp.index(sDisp)
    
    #nettoyage du nom pr la recherche
    #print 'avant ' + sMovieTitle
    sMovieTitle = unicode(sMovieTitle, 'utf-8')#converti en unicode pour aider aux convertions
    sMovieTitle = unicodedata.normalize('NFD', sMovieTitle).encode('ascii', 'ignore').decode("unicode_escape")#vire accent et '\'
    sMovieTitle = sMovieTitle.encode("utf-8").lower() #on repasse en utf-8
    sMovieTitle = re.sub(r'[^(\w| )]', ' ', sMovieTitle) #vire les caracteres a la con qui peuvent trainer
    sMovieTitle = re.sub('( |^)(le|la|les|du|au|a|l)( |$)',' ', sMovieTitle) #vire les articles
    sMovieTitle = re.sub('\(.+?\)',' ', sMovieTitle) #vire les parentheses
    sMovieTitle = re.sub(' +',' ',sMovieTitle) #vire les espaces multiples et on laisse les espaces sans modifs car certains codent avec %20 d'autres avec +
    #print 'apres ' + sMovieTitle
    
    if ret > -1:
        
        oHandler = cRechercheHandler()
        aPlugins = oHandler.getAvailablePlugins(disp[ret])
        for aPlugin in aPlugins:
            try:                   
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
                oGui.addDir(SITE_IDENTIFIER, 'showSearch', '[COLOR olive]'+ aPlugin[1] +'[/COLOR]', 'search.png', oOutputParameterHandler)
            
                exec "from resources.sites import "+aPlugin[1]+" as search"
                sUrl = aPlugin[0]+sMovieTitle
                searchUrl = "search.%s('%s')" % (aPlugin[2], sUrl)
                exec searchUrl
            except:       
                pass
                
    oGui.setEndOfDirectory()
Ejemplo n.º 6
0
def searchGlobal():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sSearchText = oInputParameterHandler.getValue('searchtext')
    sReadDB = oInputParameterHandler.getValue('readdb')
    sDisp = oInputParameterHandler.getValue('disp')

    oHandler = cRechercheHandler()
    sSearchText = oHandler.setText(sSearchText)
    oHandler.setDisp(sDisp)
    oHandler.setRead(sReadDB)
    aPlugins = oHandler.getAvailablePlugins()
    if not aPlugins: return True
    total = len(aPlugins)

    #xbmc.log(str(aPlugins), xbmc.LOGNOTICE)

    dialog = cConfig().createDialog("vStream")
    xbmcgui.Window(10101).setProperty('search', 'true')

    oGui.addText2(
        'globalSearch', '[COLOR khaki]%s: %s[/COLOR]' %
        (cConfig().getlanguage(30076), sSearchText), 'none.png')

    for count, plugin in enumerate(aPlugins):

        xbmc.log(str(plugin['name']), xbmc.LOGNOTICE)
        text = '%s/%s - %s' % ((count + 1), total, plugin['name'])
        cConfig().updateDialogSearch(dialog, total, text)
        if dialog.iscanceled():
            break

        #nom du site
        oGui.addText2(
            plugin['identifier'],
            '%s. [COLOR olive]%s[/COLOR]' % ((count + 1), plugin['name']),
            'sites/%s.png' % (plugin['identifier']))
        #recherche import
        _pluginSearch(plugin, sSearchText)

    xbmcgui.Window(10101).setProperty('search', 'false')
    cConfig().finishDialog(dialog)

    oGui.setEndOfDirectory()

    return True
Ejemplo n.º 7
0
    def searchMovie(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()
        sSearchText = oInputParameterHandler.getValue('searchtext')
        sReadDB = oInputParameterHandler.getValue('readdb')
        sDisp = oInputParameterHandler.getValue('disp')

        oHandler = cRechercheHandler()
        oHandler.setText(sSearchText)
        oHandler.setDisp(sDisp)
        aPlugins = oHandler.getAvailablePlugins()

        if (sReadDB != 'False' and aPlugins == True):
            meta = {}
            meta['title'] = oHandler.getText()
            meta['disp'] = oHandler.getDisp()
            cDb().insert_history(meta)

        oGui.setEndOfDirectory()
Ejemplo n.º 8
0
    def searchMovie(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()
        sSearchText = oInputParameterHandler.getValue('searchtext')
        sReadDB = oInputParameterHandler.getValue('readdb')
        sDisp = oInputParameterHandler.getValue('disp')

        oHandler = cRechercheHandler()
        oHandler.setText(sSearchText)
        oHandler.setDisp(sDisp)
        aPlugins = oHandler.getAvailablePlugins()
        
        if (sReadDB != 'False' and aPlugins == True):
            meta = {}      
            meta['title'] = oHandler.getText()
            meta['disp'] = oHandler.getDisp()
            cDb().insert_history(meta)

        oGui.setEndOfDirectory()
Ejemplo n.º 9
0
    def searchMovie(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()
        sSearchText = oInputParameterHandler.getValue("searchtext")
        sReadDB = oInputParameterHandler.getValue("readdb")
        sDisp = oInputParameterHandler.getValue("disp")

        oHandler = cRechercheHandler()
        aPlugins = oHandler.getAvailablePlugins(sDisp)
        if not sSearchText:
            sSearchText = oGui.showKeyBoard()
            sSearchText = urllib.quote(sSearchText)
        if sSearchText != False:
            if sReadDB != "False":
                meta = {}
                meta["title"] = sSearchText
                meta["disp"] = sDisp
                cDb().insert_history(meta)
            # print aPlugins
            for aPlugin in aPlugins:
                try:
                    oOutputParameterHandler = cOutputParameterHandler()
                    oOutputParameterHandler.addParameter("siteUrl", "http://venom")
                    oGui.addDir(
                        SITE_IDENTIFIER,
                        "showSearch",
                        "[COLOR olive]" + aPlugin[1] + "[/COLOR]",
                        "search.png",
                        oOutputParameterHandler,
                    )

                    exec "from resources.sites import " + aPlugin[1] + " as search"
                    sUrl = aPlugin[0] + sSearchText
                    searchUrl = "search.%s('%s')" % (aPlugin[2], sUrl)
                    exec searchUrl
                except:
                    pass
        else:
            return
        oGui.setEndOfDirectory()
Ejemplo n.º 10
0
    def searchMovie(self):
        oGui = cGui()
        oInputParameterHandler = cInputParameterHandler()
        sSearchText = oInputParameterHandler.getValue('searchtext')
        sReadDB = oInputParameterHandler.getValue('readdb')
        sDisp = oInputParameterHandler.getValue('disp')

        oHandler = cRechercheHandler()
        aPlugins = oHandler.getAvailablePlugins(sDisp)
        if not sSearchText:
            sSearchText = oGui.showKeyBoard()
            sSearchText = urllib.quote(sSearchText)
        if (sSearchText != False):
            if (sReadDB != 'False'):
                meta = {}
                meta['title'] = sSearchText
                meta['disp'] = sDisp
                cDb().insert_history(meta)
            #print aPlugins
            for aPlugin in aPlugins:
                try:
                    oOutputParameterHandler = cOutputParameterHandler()
                    oOutputParameterHandler.addParameter(
                        'siteUrl', 'http://venom')
                    oGui.addDir(SITE_IDENTIFIER, 'showSearch',
                                '[COLOR olive]' + aPlugin[1] + '[/COLOR]',
                                'search.png', oOutputParameterHandler)

                    exec "from resources.sites import " + aPlugin[
                        1] + " as search"
                    sUrl = aPlugin[0] + sSearchText
                    searchUrl = "search.%s('%s')" % (aPlugin[2], sUrl)
                    exec searchUrl
                except:
                    pass
        else:
            return
        oGui.setEndOfDirectory()
Ejemplo n.º 11
0
def searchGlobal():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()

    sReadDB = oInputParameterHandler.getValue('readdb')
    sSearchText = oInputParameterHandler.getValue('searchtext')
    sDisp = oInputParameterHandler.getValue('disp')

    oHandler = cRechercheHandler()
    oHandler.setText(sSearchText)
    oHandler.setDisp(sDisp)
    oHandler.setRead(sReadDB)
    aPlugins = oHandler.getAvailablePlugins()
    if not aPlugins: return True
    total = len(aPlugins)

    #xbmc.log(str(aPlugins), xbmc.LOGNOTICE)

    dialog = cConfig().createDialog("vStream")
    xbmcgui.Window(10101).setProperty('search', 'true')

    oGui.addText(
        'globalSearch', '[COLOR khaki]%s: %s[/COLOR]' %
        (cConfig().getlanguage(30076), sSearchText), 'none.png')

    for count, plugin in enumerate(aPlugins):

        text = '%s/%s - %s' % ((count + 1), total, plugin['name'])
        cConfig().updateDialogSearch(dialog, total, text)
        if dialog.iscanceled():
            break

        #nom du site
        oGui.addText(
            plugin['identifier'],
            '%s. [COLOR olive]%s[/COLOR]' % ((count + 1), plugin['name']),
            'sites/%s.png' % (plugin['identifier']))
        #recherche import
        _pluginSearch(plugin, sSearchText)

    xbmcgui.Window(10101).setProperty('search', 'false')

    #affichage
    total = len(oGui.searchResults)
    #filtre
    int_1 = cUtil().CheckOrd(sSearchText)

    for count, result in enumerate(oGui.searchResults):
        text = '%s/%s - %s' % (
            (count + 1 / total), total, result['guiElement'].getTitle())
        cConfig().updateDialogSearch(dialog, total, text)

        #result['params'].addParameter('VSTRMSEARCH','True')

        oGui.addFolder(result['guiElement'], result['params'])
        #xbmc.log('%s - %s' % (middle,old_label),  xbmc.LOGNOTICE)

    cConfig().finishDialog(dialog)

    oGui.setEndOfDirectory()

    return True
Ejemplo n.º 12
0
def searchGlobal():
    cancel = False
    oGui = cGui()
    addons = addon()

    oInputParameterHandler = cInputParameterHandler()

    sSearchText = oInputParameterHandler.getValue('searchtext')
    sCat = oInputParameterHandler.getValue('sCat')

    oHandler = cRechercheHandler()
    oHandler.setText(sSearchText)
    oHandler.setCat(sCat)
    aPlugins = oHandler.getAvailablePlugins()
    if not aPlugins: return True
    total = len(aPlugins)

    #VSlog(str(aPlugins), xbmc.LOGNOTICE)

    progress_ = progress().VScreate()
  
    #kodi 17 vire la fenetre busy qui ce pose au dessus de la barre de Progress
    try:
        xbmc.executebuiltin("Dialog.Close(busydialog)")
    except: pass
    
    window(10101).setProperty('search', 'true')

    oGui.addText('globalSearch', addons.VSlang(30081) % (sSearchText), 'none.png')

    for count, plugin in enumerate(aPlugins):

        #text = '%s/%s - %s' % ((count+1), total, plugin['name'])
        progress_.VSupdatesearch(progress_, total, plugin['name'])
        if progress_.iscanceled():
            cancel = True
            progress_.close()
            break

        #nom du site
        oGui.addText(plugin['identifier'], '%s. [COLOR olive]%s[/COLOR]' % ((count+1), plugin['name']), 'sites/%s.png' % (plugin['identifier']))
        #recherche import
        _pluginSearch(plugin, sSearchText)

    window(10101).setProperty('search', 'false')
    #progress_.VSclose(progress_)

    #affichage
    total=len(oGui.searchResults)
    #progress_ = progress().VScreate()

    for count,result in enumerate(oGui.searchResults):
        #text = '%s/%s - %s' % ((count+1/total), total, result['guiElement'].getTitle())

        #if(count == 0):
        #    cConfig().updateDialogSearch(dialog, total, text,True)
        #else:
        #    cConfig().updateDialogSearch(dialog, total, text)
        progress_.VSupdatesearch(progress_, total, "Patience...")



        #result['params'].addParameter('VSTRMSEARCH','True')

        oGui.addFolder(result['guiElement'],result['params'])
        #VSlog('%s - %s' % (middle,old_label),  xbmc.LOGNOTICE)

        # if progress_.iscanceled():
        #     if cancel == True:
        #         continue
        #     else:
        #         break

    progress_.VSclose(progress_)

    oGui.setEndOfDirectory()

    return True
Ejemplo n.º 13
0
 def searchMovie2(self):
     oInputParameterHandler = cInputParameterHandler()
     sDisp = oInputParameterHandler.getValue('disp')
     oHandler = cRechercheHandler()
     liste = oHandler.getAvailablePlugins(sDisp)
     self.__callsearch(liste, sDisp)
Ejemplo n.º 14
0
def searchGlobal():
    oGui = cGui()
    addons = addon()

    oInputParameterHandler = cInputParameterHandler()

    sSearchText = oInputParameterHandler.getValue('searchtext')
    sCat = oInputParameterHandler.getValue('sCat')

    oHandler = cRechercheHandler()
    oHandler.setText(sSearchText)
    oHandler.setCat(sCat)
    aPlugins = oHandler.getAvailablePlugins()
    if not aPlugins:
        return True

    total = len(aPlugins)
    progress_ = progress().VScreate()




    # kodi 17 vire la fenetre busy qui se pose au dessus de la barre de Progress
    try:
        xbmc.executebuiltin('Dialog.Close(busydialog)')
    except:
        pass


    oGui.addText('globalSearch', addons.VSlang(30081) % sSearchText, 'search.png')
    sSearchText = Quote(sSearchText)

    count = 0
    for plugin in aPlugins:
 


        progress_.VSupdate(progress_, total, plugin['name'], True)
        if progress_.iscanceled():
            progress_.close()
            break
 
        oGui.searchResults[:] = []  # vider le tableau de résultats pour les récupérer par source




        _pluginSearch(plugin, sSearchText)

        if len(oGui.searchResults) > 0:  # Au moins un résultat
            count += 1



            # nom du site
            oGui.addText(plugin['identifier'], '%s. [COLOR olive]%s[/COLOR]' % (count, plugin['name']), 'sites/%s.png' % (plugin['identifier']))

            for result in oGui.searchResults:
                oGui.addFolder(result['guiElement'], result['params'])
 
    if not count:   # aucune source ne retourne de résultats
        oGui.addText('globalSearch')  # "Aucune information"


    progress_.VSclose(progress_)



    cGui.CONTENT = 'files'











    oGui.setEndOfDirectory()
    return True
Ejemplo n.º 15
0
def searchGlobal():
    cancel = False
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()

    #print xbmc.getInfoLabel('ListItem.Property(Category)')

    sSearchText = oInputParameterHandler.getValue('searchtext')
    sCat = oInputParameterHandler.getValue('sCat')

    oHandler = cRechercheHandler()
    oHandler.setText(sSearchText)
    oHandler.setCat(sCat)
    aPlugins = oHandler.getAvailablePlugins()
    if not aPlugins: return True
    total = len(aPlugins)

    #xbmc.log(str(aPlugins), xbmc.LOGNOTICE)

    dialog = cConfig().createDialog("vStream")
    #kodi 17 vire la fenetre busy qui ce pose au dessus de la barre de Progress
    try:
        xbmc.executebuiltin("Dialog.Close(busydialog)")
    except: pass
    xbmcgui.Window(10101).setProperty('search', 'true')

    oGui.addText('globalSearch', cConfig().getlanguage(30081) % (sSearchText), 'none.png')

    for count, plugin in enumerate(aPlugins):

        text = '%s/%s - %s' % ((count+1), total, plugin['name'])
        cConfig().updateDialogSearch(dialog, total, text)
        if dialog.iscanceled():
            cancel = True
            dialog.close()
            break

        #nom du site
        oGui.addText(plugin['identifier'], '%s. [COLOR olive]%s[/COLOR]' % ((count+1), plugin['name']), 'sites/%s.png' % (plugin['identifier']))
        #recherche import
        _pluginSearch(plugin, sSearchText)

    xbmcgui.Window(10101).setProperty('search', 'false')

    #affichage
    total=len(oGui.searchResults)
    #filtre
    int_1 = cUtil().CheckOrd(sSearchText)

    for count,result in enumerate(oGui.searchResults):
        text = '%s/%s - %s' % ((count+1/total), total, result['guiElement'].getTitle())

        if(count == 0):
            cConfig().updateDialogSearch(dialog, total, text,True)
        else:
            cConfig().updateDialogSearch(dialog, total, text)

        #result['params'].addParameter('VSTRMSEARCH','True')

        oGui.addFolder(result['guiElement'],result['params'])
        #xbmc.log('%s - %s' % (middle,old_label),  xbmc.LOGNOTICE)

        if dialog.iscanceled():
            if cancel == True:
                continue
            else:
                break

    cConfig().finishDialog(dialog)

    oGui.setEndOfDirectory()

    return True
Ejemplo n.º 16
0
def showHosters():
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    sUrl = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumbnail = oInputParameterHandler.getValue('sThumbnail')

    sDisp = oInputParameterHandler.getValue('disp')

    dialog2 = xbmcgui.Dialog()
    dialog_select = [
        cConfig().getSetting('search1_label'),
        cConfig().getSetting('search2_label'),
        cConfig().getSetting('search3_label'),
        cConfig().getSetting('search4_label')
    ]

    disp = ['search1', 'search2', 'search3', 'search4']

    if (sDisp == 'none'):
        ret = dialog2.select('Select Recherche', dialog_select)
    else:
        ret = disp.index(sDisp)

    #nettoyage du nom pr la recherche
    #print 'avant ' + sMovieTitle
    sMovieTitle = unicode(
        sMovieTitle, 'utf-8')  #converti en unicode pour aider aux convertions
    sMovieTitle = unicodedata.normalize('NFD', sMovieTitle).encode(
        'ascii', 'ignore').decode("unicode_escape")  #vire accent et '\'
    sMovieTitle = sMovieTitle.encode("utf-8").lower()  #on repasse en utf-8
    sMovieTitle = re.sub(
        r'[^(\w| )]', ' ',
        sMovieTitle)  #vire les caracteres a la con qui peuvent trainer
    sMovieTitle = re.sub('( |^)(le|la|les|du|au|a|l)( |$)', ' ',
                         sMovieTitle)  #vire les articles
    sMovieTitle = re.sub('\(.+?\)', ' ', sMovieTitle)  #vire les parentheses
    sMovieTitle = re.sub(
        ' +', ' ', sMovieTitle
    )  #vire les espaces multiples et on laisse les espaces sans modifs car certains codent avec %20 d'autres avec +
    #print 'apres ' + sMovieTitle

    if ret > -1:

        oHandler = cRechercheHandler()
        aPlugins = oHandler.getAvailablePlugins(disp[ret])
        for aPlugin in aPlugins:
            try:
                oOutputParameterHandler = cOutputParameterHandler()
                oOutputParameterHandler.addParameter('siteUrl', sUrl)
                oGui.addDir(aPlugin[1], 'load',
                            '[COLOR olive]' + aPlugin[1] + '[/COLOR]',
                            'search.png', oOutputParameterHandler)

                exec "from resources.sites import " + aPlugin[1] + " as search"
                sUrl = aPlugin[0] + sMovieTitle
                searchUrl = "search.%s('%s')" % (aPlugin[2], sUrl)
                exec searchUrl
            except:
                pass

    oGui.setEndOfDirectory()
Ejemplo n.º 17
0
 def searchMovie2(self):
     oInputParameterHandler = cInputParameterHandler()
     sDisp = oInputParameterHandler.getValue('disp')
     oHandler = cRechercheHandler()
     liste = oHandler.getAvailablePlugins(sDisp)
     self.__callsearch(liste, sDisp)
Ejemplo n.º 18
0
def searchGlobal():
    cancel = False
    oGui = cGui()
    addons = addon()

    oInputParameterHandler = cInputParameterHandler()

    sSearchText = oInputParameterHandler.getValue('searchtext')
    sCat = oInputParameterHandler.getValue('sCat')

    oHandler = cRechercheHandler()
    oHandler.setText(sSearchText)
    oHandler.setCat(sCat)
    aPlugins = oHandler.getAvailablePlugins()
    if not aPlugins: return True
    total = len(aPlugins)

    #VSlog(str(aPlugins), xbmc.LOGNOTICE)

    progress_ = progress().VScreate()

    #kodi 17 vire la fenetre busy qui ce pose au dessus de la barre de Progress
    try:
        xbmc.executebuiltin("Dialog.Close(busydialog)")
    except: pass

    window(10101).setProperty('search', 'true')

    oGui.addText('globalSearch', addons.VSlang(30081) % (sSearchText), 'none.png')

    for count, plugin in enumerate(aPlugins):

        #text = '%s/%s - %s' % ((count+1), total, plugin['name'])
        progress_.VSupdatesearch(progress_, total, plugin['name'])
        if progress_.iscanceled():
            cancel = True
            progress_.close()
            break

        #nom du site
        oGui.addText(plugin['identifier'], '%s. [COLOR olive]%s[/COLOR]' % ((count+1), plugin['name']), 'sites/%s.png' % (plugin['identifier']))
        #recherche import
        _pluginSearch(plugin, sSearchText)

    window(10101).setProperty('search', 'false')
    #progress_.VSclose(progress_)

    #affichage
    total=len(oGui.searchResults)
    #progress_ = progress().VScreate()

    for count,result in enumerate(oGui.searchResults):
        #text = '%s/%s - %s' % ((count+1/total), total, result['guiElement'].getTitle())

        #if(count == 0):
        #    cConfig().updateDialogSearch(dialog, total, text,True)
        #else:
        #    cConfig().updateDialogSearch(dialog, total, text)
        progress_.VSupdatesearch(progress_, total, "Patience...")



        #result['params'].addParameter('VSTRMSEARCH', 'True')

        oGui.addFolder(result['guiElement'],result['params'])
        #VSlog('%s - %s' % (middle, old_label),  xbmc.LOGNOTICE)

        # if progress_.iscanceled():
        #     if cancel == True:
        #         continue
        #     else:
        #         break

    progress_.VSclose(progress_)

    oGui.setEndOfDirectory()

    return True