Пример #1
0
 def onAction(self, action):
     # exit
     if action.getId() == 92 or action.getId() == 10:
         self.close()
     # contextmenu
     if action.getId() == 117:
         identifier = self.getControl(32500).getSelectedItem().getProperty(
             "identifier")
         if identifier == "twitter":
             twitter_history = tweet.get_twitter_history()
             if twitter_history:
                 twitter_history = list(reversed(twitter_history))
                 choice = xbmcgui.Dialog().select(translate(32076),
                                                  twitter_history)
                 if choice > -1:
                     self.close()
                     tweets.start(twitterhash=twitter_history[choice])
             else:
                 xbmcgui.Dialog().ok(translate(32000), translate(32075))
         if identifier == "weibo":
             weibo_history = sina_tweet.get_twitter_history()
             if weibo_history:
                 weibo_history = list(reversed(weibo_history))
                 choice = xbmcgui.Dialog().select(translate(32076),
                                                  weibo_history)
                 if choice > -1:
                     self.close()
                     weibo.start(twitterhash=weibo_history[choice])
             else:
                 xbmcgui.Dialog().ok(translate(32000), translate(32075))
Пример #2
0
	def onClick(self,controlId):
		if controlId == 32500:
			identifier = self.getControl(32500).getSelectedItem().getProperty("identifier")
			if identifier == "livescores":
				self.close()
				livescores.start()
			elif identifier == "tables":
				self.close()
				leagueselection.start()
			elif identifier == "Pay Per View":
				self.close()
				tweets.start()
Пример #3
0
 def onClick(self, controlId):
     if controlId == 32500:
         identifier = self.getControl(32500).getSelectedItem().getProperty(
             "identifier")
         if identifier == "weibo":
             self.close()
             weibo.start()
         elif identifier == "settings":
             self.close()
             xbmcaddon.Addon().openSettings()
         elif identifier == "twitter":
             self.close()
             tweets.start()
Пример #4
0
 def onClick(self, controlId):
     if controlId == 32500:
         identifier = self.getControl(32500).getSelectedItem().getProperty(
             "identifier")
         if identifier == "livescores":
             self.close()
             livescores.start()
         elif identifier == "tables":
             self.close()
             leagueselection.start()
         elif identifier == "twitter":
             self.close()
             tweets.start()
Пример #5
0
def start(twitterbuscar_user=None, standalone=False):
    dialog = xbmcgui.Dialog()
    twitterbuscar_user = dialog.input("Introduce la busqueda",
                                      type=xbmcgui.INPUT_ALPHANUM)
    if len(twitterbuscar_user) != 0:
        twitterbuscar_user = twitterbuscar_user.replace("#", "")
    else:
        tweets.start("persona", "notuser")

    if twitterbuscar_user:
        select = Select('DialogSelect.xml',
                        config.get_runtime_path(),
                        user=twitterbuscar_user)
        select.doModal()
Пример #6
0
    def onAction(self, action):
        if (action == ACTION_SELECT_ITEM
                or action == 100) and self.getFocusId() == 6:
            self.close()
            selectitem = self.getControl(6).getSelectedItem()
            sc_name = selectitem.getProperty("sc_name")
            tweets.start("persona", sc_name)

        elif (action == ACTION_SELECT_ITEM
              or action == 100) and self.getFocusId() == 5:
            self.close()

        elif action == ACTION_PREVIOUS_MENU or action == ACTION_GESTURE_SWIPE_LEFT or action == 110 or action == 92:
            self.close()
Пример #7
0
 def onClick(self,controlId):
     if controlId == 33560:
         self.lista = "stats"
         self.reset_buttons(33560)
         self.setStats()
     elif controlId == 33561:
         self.lista = "trayectoria"
         self.reset_buttons(33561)
         self.setTrayectoria()
     elif controlId == 33562:
         self.lista = "titulos"
         self.reset_buttons(33562)
         self.setTitulos()
     elif controlId == 33563:
         self.lista = "efeme"
         self.reset_buttons(33563)
         self.setEfeme()
     elif controlId == 33564:
         self.lista = "news"
         self.reset_buttons(33564)
         self.setNews()
     elif controlId == 33570:
         select = self.getControl(33570).getSelectedItem()
         img = select.getProperty("img")
         title = select.getProperty("title")
         text = select.getProperty("text")
         main = newsDialog('script-matchcenter-News.xml', config.get_runtime_path(), img=img, text=text, title=title)
         main.doModal()
         del main
     elif controlId == 33557:
         import tweets
         tweets.start("persona", self.info["twitter"])
     elif controlId == 33559:
         if self.idx_foto == len(self.info["fotos"]) - 1:
             self.idx_foto = 0
         else:
             self.idx_foto += 1
         self.getControl(33554).setImage(self.info["fotos"][self.idx_foto])
     elif controlId == 33600:
         if xbmc.getCondVisibility("Control.IsVisible(33601)"):
             self.getControl(33601).setVisible(False)
         else:
             self.getControl(33601).setVisible(True)
     elif controlId == 33601:
         temporada = self.getControl(33601).getSelectedItem().getProperty("url")
         self.setInfo(temporada)  
Пример #8
0
	def onAction(self,action):
		#exit
		if action.getId() == 92 or action.getId() == 10:
			self.close()
		#contextmenu
		if action.getId() == 117:
			identifier = self.getControl(32500).getSelectedItem().getProperty("identifier")
			if identifier == "twitter":
				twitter_history = tweet.get_twitter_history()
				if twitter_history:
					twitter_history = list(reversed(twitter_history))
					choice = xbmcgui.Dialog().select(translate(32076), twitter_history)
					if choice > -1:
						self.close()
						tweets.start(twitterhash=twitter_history[choice])
				else:
					xbmcgui.Dialog().ok(translate(32000),translate(32075))
Пример #9
0
 def onClick(self, controlId):
     dialog = xbmcgui.Dialog()
     if controlId == 32500:
         identifier = self.getControl(32500).getSelectedItem().getProperty("identifier")
         if identifier == "livescores":
             self.close()
             tweets.start()
         elif identifier == "tables":
             self.close()
             dialog = xbmcgui.Dialog()
             dialog.ok("Not Avalible", "Feature Not Implamented Yet")
         elif identifier == "Settings":
             self.close()
             dialog = xbmcgui.Dialog()
             dialog.ok("Not Avalible", "Feature Not Implamented Yet")
         elif identifier == "Settings":
             self.close()
             dialog = xbmcgui.Dialog()
             dialog.ok("Not Avalible", "Feature Not Implamented Yet")
Пример #10
0
 def onInit(self):
     try:
         self.control_list = self.getControl(6)
         self.getControl(5).setNavigation(self.control_list,
                                          self.control_list,
                                          self.control_list,
                                          self.control_list)
         self.getControl(3).setEnabled(0)
         self.getControl(3).setVisible(0)
     except:
         pass
     self.getControl(1).setLabel(
         "[COLOR cadetblue][B]Elige usuario[/B][/COLOR]")
     self.getControl(5).setLabel("[COLOR red][B]Cerrar[/B][/COLOR]")
     self.control_list.reset()
     items = []
     try:
         users = tweet.user_search(self.hash)
     except:
         users = None
     if str(users) == "[]":
         self.close()
         tweets.start("persona", "''")
     if users:
         for user in users:
             name = user["name"].encode("utf-8", "ignore")
             name = "[COLOR bisque]" + name + "[/COLOR]"
             sc_name = user["screen_name"].encode("utf-8", "ignore")
             sc_namec = "[COLOR skyblue]" + sc_name + "[/COLOR]"
             pic = user["profilepic"]
             item = xbmcgui.ListItem(name + " (" +
                                     "[COLOR gold] @[/COLOR]" + sc_namec +
                                     ")")
             try:
                 item.setArt({"thumb": pic})
             except:
                 item.setThumbnailImage(pic)
             item.setProperty("sc_name", sc_name)
             items.append(item)
     self.getControl(6).addItems(items)
     self.setFocusId(6)