Esempio n. 1
0
    def showHistory(self):
        oGui = cGui()

        row = cDb().get_history()
        if row:
            oGui.addText(SITE_IDENTIFIER, self.addons.VSlang(30416))
        else:
            oGui.addText(SITE_IDENTIFIER)
        oOutputParameterHandler = cOutputParameterHandler()
        for match in row:

            # code to get type with disp
            sType = self.addons.getSetting('search' + match[2][-1:] + '_type')
            if sType:
                oOutputParameterHandler.addParameter('type', sType)
                window(10101).setProperty('search_type', sType)

            oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
            oOutputParameterHandler.addParameter('searchtext', match[1])
            # oOutputParameterHandler.addParameter('disp', match[2])
            # oOutputParameterHandler.addParameter('readdb', 'False')

            oGuiElement = cGuiElement()
            oGuiElement.setSiteName('globalSearch')
            oGuiElement.setFunction('globalSearch')

            try:
                oGuiElement.setTitle('- ' + match[1])
            except:
                oGuiElement.setTitle('- ' + str(match[1], 'utf-8'))

            oGuiElement.setFileName(match[1])
            oGuiElement.setCat(match[2])
            oGuiElement.setIcon('search.png')
            oGui.CreateSimpleMenu(oGuiElement, oOutputParameterHandler,
                                  SITE_IDENTIFIER, 'cHome', 'delSearch',
                                  self.addons.VSlang(30412))
            oGui.addFolder(oGuiElement, oOutputParameterHandler)

        if row:
            oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
            oGui.addDir(SITE_IDENTIFIER, 'delSearch',
                        self.addons.VSlang(30413), 'search.png',
                        oOutputParameterHandler)

        oGui.setEndOfDirectory()
Esempio n. 2
0
def _pluginSearch(plugin, sSearchText):

    # Appeler la source en mode Recherche globale
    window(10101).setProperty('search', 'true')

    try:
        plugins = __import__(
            'Plugins.Extensions.IPTVPlayer.tsiplayer.addons.resources.sites.%s'
            % plugin['identifier'],
            fromlist=[plugin['identifier']])
        function = getattr(plugins, plugin['search'][1])
        sUrl = plugin['search'][0] + str(sSearchText)
        if os.path.exists(
                GetCacheSubDir('Tsiplayer') + 'VStream_listing.search'):
            function(sUrl)

        VSlog('Load Search: ' + str(plugin['identifier']))
    except:
        VSlog(plugin['identifier'] + ': search failed')

    window(10101).setProperty('search', 'false')
Esempio n. 3
0
 def TextBoxes(self, heading, anounce):
     # activate the text viewer window
     xbmc.executebuiltin("ActivateWindow(%d)" % 10147)
     # get window
     win = window(10147)
     # win.show()
     # give window time to initialize
     xbmc.sleep(100)
     # set heading
     win.getControl(1).setLabel(heading)
     win.getControl(5).setText(anounce)
     return
Esempio n. 4
0
    def addText(self, sId, sLabel='', sIcon='none.png'):
        printDBG('addText0001:')
        # Pas de texte lors des recherches globales
        if window(10101).getProperty('search') == 'true':
            return

        oGuiElement = cGuiElement()
        oGuiElement.setSiteName(sId)
        oGuiElement.setFunction('DoNothing')
        if not sLabel:
            sLabel = self.ADDON.VSlang(30204)
        oGuiElement.setTitle(sLabel)
        oGuiElement.setIcon(sIcon)
        oGuiElement.setThumbnail(oGuiElement.getIcon())
        oGuiElement.setMeta(0)

        oOutputParameterHandler = cOutputParameterHandler()
        self.addFolder(oGuiElement, oOutputParameterHandler)
Esempio n. 5
0
    def addFolder(self,
                  oGuiElement,
                  oOutputParameterHandler='',
                  _isFolder=True):
        printDBG('addFolder0001:')
        # recherche append les reponses
        if window(10101).getProperty('search') == 'true':
            import copy
            cGui.searchResults.append({
                'guiElement':
                oGuiElement,
                'params':
                copy.deepcopy(oOutputParameterHandler)
            })
            return

        # Des infos a rajouter ?
        params = {
            'siteUrl': oGuiElement.setSiteUrl,
            'sTmdbId': oGuiElement.setTmdbId,
            'sYear': oGuiElement.setYear
        }

        try:
            for sParam, callback in params.iteritems():
                value = oOutputParameterHandler.getValue(sParam)
                if value:
                    callback(value)
        except AttributeError:
            for sParam, callback in params.items():
                value = oOutputParameterHandler.getValue(sParam)
                if value:
                    callback(value)
        oListItem = self.createListItem(oGuiElement)
        oListItem.setProperty('IsPlayable', 'false')

        sCat = oGuiElement.getCat()
        if sCat:
            cGui.sCat = sCat
            oOutputParameterHandler.addParameter('sCat', sCat)

        sItemUrl = self.__createItemUrl(oGuiElement, oOutputParameterHandler)

        oOutputParameterHandler.addParameter('sTitleWatched',
                                             oGuiElement.getTitleWatched())
        if cGui.CONTENT in ('movies', 'tvshows', 'episodes'):
            self.createContexMenuinfo(oGuiElement, oOutputParameterHandler)
            self.createContexMenuba(oGuiElement, oOutputParameterHandler)
            self.createContexMenuBookmark(oGuiElement, oOutputParameterHandler)

            if self.ADDON.getSetting('bstoken') != '':
                self.createContexMenuTrakt(oGuiElement,
                                           oOutputParameterHandler)
            if self.ADDON.getSetting('tmdb_account') != '':
                self.createContexMenuTMDB(oGuiElement, oOutputParameterHandler)
            self.createContexMenuSimil(oGuiElement, oOutputParameterHandler)
            self.createContexMenuWatch(oGuiElement, oOutputParameterHandler)

        elif sCat and sCat == 5:  # MISC
            self.createContexMenuBookmark(oGuiElement, oOutputParameterHandler)
            self.createContexMenuWatch(oGuiElement, oOutputParameterHandler)
        oListItem = self.__createContextMenu(oGuiElement, oListItem)
        self.listing.append((sItemUrl, oListItem, _isFolder))
        # Vider les paramètres pour être recyclé
        self.TsiplayerWrite(oGuiElement, oOutputParameterHandler)
Esempio n. 6
0
    def showSearch(self,
                   searchtext=cInputParameterHandler().getValue('searchtext')):

        if not searchtext:
            return self.showSearchText()

        window(10101).clearProperty('search_text')

        oGui = cGui()
        oGui.addText('globalSearch',
                     self.addons.VSlang(30077) % searchtext, 'none.png')

        # utilisation de guielement pour ajouter la bonne catégorie
        oGuiElement = cGuiElement()
        oGuiElement.setSiteName('globalSearch')
        oGuiElement.setFunction('showSearch')
        oGuiElement.setIcon('search.png')
        oGuiElement.setMeta(0)
        # oGuiElement.setThumbnail(sThumbnail)
        # oGuiElement.setFanart(sFanart)

        # Recherche globale films
        oOutputParameterHandler = cOutputParameterHandler()
        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        oOutputParameterHandler.addParameter('searchtext', searchtext)
        oGuiElement.setTitle(self.addons.VSlang(30078))
        oGuiElement.setFileName(self.addons.VSlang(30078))
        oGuiElement.setCat(1)
        oGui.addFolder(oGuiElement, oOutputParameterHandler)

        # Recherche globale séries
        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        oOutputParameterHandler.addParameter('searchtext', searchtext)
        oGuiElement.setTitle(self.addons.VSlang(30079))
        oGuiElement.setFileName(self.addons.VSlang(30079))
        oGuiElement.setCat(2)
        oGui.addFolder(oGuiElement, oOutputParameterHandler)

        # Recherche globale Animés
        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        oOutputParameterHandler.addParameter('searchtext', searchtext)
        oGuiElement.setTitle(self.addons.VSlang(30118))
        oGuiElement.setFileName(self.addons.VSlang(30118))
        oGuiElement.setCat(3)
        oGui.addFolder(oGuiElement, oOutputParameterHandler)

        # Recherche globale Dramas
        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        oOutputParameterHandler.addParameter('searchtext', searchtext)
        oGuiElement.setTitle(self.addons.VSlang(30123))
        oGuiElement.setFileName(self.addons.VSlang(30123))
        oGuiElement.setCat(4)
        oGui.addFolder(oGuiElement, oOutputParameterHandler)

        # Recherche globale divers
        oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        oOutputParameterHandler.addParameter('searchtext', searchtext)
        oGuiElement.setTitle(self.addons.VSlang(30080))
        oGuiElement.setFileName(self.addons.VSlang(30080))
        oGuiElement.setCat(5)
        oGui.addFolder(oGuiElement, oOutputParameterHandler)

        # oOutputParameterHandler.addParameter('siteUrl', 'http://venom')
        # oOutputParameterHandler.addParameter('searchtext', searchtext)
        # oOutputParameterHandler.addParameter('disp', 'search10')
        # oOutputParameterHandler.addParameter('readdb', 'True')
        # oGui.addDir('globalSearch', 'showSearchText', 'self.addons.VSlang(30417), 'search.png', oOutputParameterHandler)

        oGui.setEndOfDirectory()