Ejemplo n.º 1
0
 def onInit(self):
     xbmc.log(msg="[Match Center] Script started", level=xbmc.LOGDEBUG)
     if os.path.exists(ignored_league_list_file):
         self.ignored_leagues = [
             league.lower()
             for league in eval(FileIO.fileread(ignored_league_list_file))
             if league
         ]
     else:
         self.ignored_leagues = []
     xbmc.executebuiltin("ClearProperty(no-games,Home)")
     self.getControl(32540).setImage(
         os.path.join(addon_path, "resources", "img", "goal.png"))
     xbmc.executebuiltin(
         "SetProperty(loading-script-matchcenter-livescores,1,home)")
     self.livescoresThread()
     xbmc.executebuiltin(
         "ClearProperty(loading-script-matchcenter-livescores,Home)")
     i = 0
     while self.isRunning:
         if (float(i * 200) /
             (livescores_update_time * 60 * 1000)).is_integer() and (
                 (i * 200) / (3 * 60 * 1000)) != 0:
             self.livescoresThread()
         xbmc.sleep(200)
         i += 1
     xbmc.log(msg="[Match Center] Script stopped", level=xbmc.LOGDEBUG)
Ejemplo n.º 2
0
 def onAction(self, action):
     if action.getId() == 92 or action.getId() == 10:
         self.stopRunning()
     elif action.getId() == 117:
         choose = xbmcgui.Dialog().select("Choose an option",
                                          ["Ignore this league"])
         if choose > -1:
             panel = self.getControl(32500)
             league = panel.getSelectedItem().getProperty(
                 "league_and_round").split(" - ")
             if len(league) > 1 and league[0]:
                 items = []
                 events_list = []
                 i = 0
                 for item in self.items:
                     if league[0].lower() not in item.getProperty(
                             "league_and_round").lower():
                         items.append(item)
                         events_list.append(self.livecopy[i])
                     i += 1
                 panel.reset()
                 panel.addItems(items)
                 self.items = items
                 self.livecopy = events_list
                 self.already_ignored = eval(
                     FileIO.fileread(ignored_league_list_file))
                 self.already_ignored.append(league[0])
                 FileIO.filewrite(ignored_league_list_file,
                                  str(self.already_ignored))
Ejemplo n.º 3
0
	def onInit(self):
		xbmc.log(msg="[Match Center] Script started", level=xbmc.LOGDEBUG)
		if os.path.exists(ignored_league_list_file):
			self.ignored_leagues = [league.lower() for league in eval(FileIO.fileread(ignored_league_list_file)) if league] 
		else:
			self.ignored_leagues = []
		xbmc.executebuiltin("ClearProperty(no-games,Home)")
		self.getControl(32540).setImage(os.path.join(addon_path,"resources","img","goal.png"))
		xbmc.executebuiltin("SetProperty(loading-script-matchcenter-livescores,1,home)")
		self.livescoresThread()
		xbmc.executebuiltin("ClearProperty(loading-script-matchcenter-livescores,Home)")
		i = 0
		while self.isRunning:
			if (float(i*200)/(livescores_update_time*60*1000)).is_integer() and ((i*200)/(3*60*1000)) != 0:
				self.livescoresThread()
			xbmc.sleep(200)
			i += 1
		xbmc.log(msg="[Match Center] Script stopped", level=xbmc.LOGDEBUG)
Ejemplo n.º 4
0
	def onAction(self,action):
		if action.getId() == 92 or action.getId() == 10:
			self.stopRunning()
		elif action.getId() == 117:
			choose = xbmcgui.Dialog().select("Choose an option",["Ignore this league"])
			if choose > -1:
				panel = self.getControl(32500)
				league = panel.getSelectedItem().getProperty("league_and_round").split(" - ")
				if len(league) > 1 and league[0]:
					items = []
					events_list = []
					i = 0
					for item in self.items:
						if league[0].lower() not in item.getProperty("league_and_round").lower():
							items.append(item)
							events_list.append(self.livecopy[i])
						i += 1
					panel.reset()
					panel.addItems(items)
					self.items = items
					self.livecopy = events_list
					self.already_ignored = eval(FileIO.fileread(ignored_league_list_file))
					self.already_ignored.append(league[0])
					FileIO.filewrite(ignored_league_list_file,str(self.already_ignored))
Ejemplo n.º 5
0
	def __init__( self, *args, **kwargs ):
		if os.path.exists(ignored_league_list_file):
			self.already_ignored = eval(FileIO.fileread(ignored_league_list_file))
		else:
			self.already_ignored = []
Ejemplo n.º 6
0
 def __init__(self, *args, **kwargs):
     if os.path.exists(ignored_league_list_file):
         self.already_ignored = eval(
             FileIO.fileread(ignored_league_list_file))
     else:
         self.already_ignored = []