- Servus...Kann mir jemand einen link schicken wo ich das Buli Ticker plugin runter laden kann da es in dem neuesten vti Image in den Erweiterungen nicht angezeigt wird denke ich doch das es extern über USB raufgebracht werden muss oder seh
- ich das falsch..Danke
Buli ticker
Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen
-
-
-
sauber danke
-
gerade das plugin drauf gemacht und erste Bundesliga ausgewählt und das lädt seit 5 min ...aufgehangen oder braucht die solo2 so lang um sich die Daten zu holen ?
-
auf dem Display steht update Prüfung...
-
Habe das Plugin im moment nicht drauf kann also nicht sagen ob es funktioniert.
Edit:
robier das doch noch mal aus.
Klick michDieser Beitrag wurde bereits 1 mal editiert, zuletzt von ditschi1691 () aus folgendem Grund: 2 aufeinanderfolgende Beiträge zusammengefasst.
-
schmiert bei beiden plugins ab so wichtig war es jetzt auch net muss ich eben Konferenz schauen box is bei beiden voll abgeschmiert kein Bock Image zu zerschießen Trotz alle dem vielen Dank
-
Das Kicker Plugin von kashmir hat einen Liveticker und der funzt auch.Nehmt das Leben nicht zu ernst, ihr kommt eh nicht lebend raus!
-
Hast du einen link für mich oder ist es in den Erweiterungen drin ?gruss
-
Musst du googeln: kashmir plugins- - - Beitrag wurde mit Deppentalk erstellt. - - -
-
sauber danke...
gruß -
ich möchte gerne die tastenbelegung im Sport1 Ticker tauschen da ich mit den "+-" tasten zappe und nicht mit den "<>" Tasten.
"ok": self.ok,
"cancel": self.exit,
"showMovies": self.loadPage,
"contextMenu": self.configScreen,
"showEventInfo": self.tabelle,
"up": self.up,
"down": self.down,
"green": self.subkanal,
"blue": self.extension,
"nextBouquet": moveSkinDown,
"prevBouquet": moveSkinUp,
"0": self.history,
"right": self.zapUp,
"left": self.zapDown
Leider crasht mir Die Box anschliessend beim aufruf des Plugins.
muss da noch etwas geändert werden?
Quellcode
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- import re, time
- from datetime import datetime
- from Components.ActionMap import *
- from Components.Label import Label
- from Components.MenuList import MenuList
- from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmap, MultiContentEntryPixmapAlphaTest
- from Components.Pixmap import Pixmap
- from Components.AVSwitch import AVSwitch
- from Components.config import config, ConfigInteger, ConfigSelection, getConfigListEntry, ConfigText, ConfigDirectory, ConfigYesNo, configfile, ConfigSelection, ConfigSubsection, ConfigPIN, NoSave, ConfigNothing
- from Components.ConfigList import ConfigListScreen
- from Components.PluginComponent import plugins
- from Components.Button import Button
- from Screens.InputBox import InputBox
- from Screens.ChoiceBox import ChoiceBox
- from Screens.ChannelSelection import ChannelSelection
- from Screens.InfoBar import InfoBar
- from Screens.InfoBarGenerics import InfoBarSubserviceSelection, InfoBarSeek, InfoBarShowHide
- from Screens.MovieSelection import MovieSelection
- from Screens.MessageBox import MessageBox
- from Screens.SubservicesQuickzap import SubservicesQuickzap
- from Screens.Screen import Screen
- from skin import parseColor
- from Tools.Directories import pathExists, fileExists, SCOPE_SKIN_IMAGE, resolveFilename
- from Tools.LoadPixmap import LoadPixmap
- from Plugins.Plugin import PluginDescriptor
- from twisted.web.client import getPage
- from twisted.web.client import downloadPage
- from enigma import eListboxPythonMultiContent, ePicLoad, ePoint, eListbox, eTimer, gFont, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_VALIGN_CENTER, loadPNG, RT_WRAP, eServiceReference, getDesktop, loadJPG
- try:
- from enigma import eMediaDatabase
- isDreamOS = True
- except:
- try:
- file = open("/proc/stb/info/model", "r")
- dev = file.readline().strip()
- file.close()
- if dev == "dm7080":
- isDreamOS = True
- elif dev == "dm820":
- isDreamOS = True
- else:
- isDreamOS = False
- except:
- isDreamOS = False
- def applySkinVars(skin,dict):
- for key in dict.keys():
- try:
- skin = skin.replace('{'+key+'}',dict[key])
- except Exception,e:
- print e,"@key=",key
- return skin
- # ticker position
- tickerpos_x = 20
- tickerpos_y = 620
- # config
- config.plugins.sport1ticker = ConfigSubsection()
- config.plugins.sport1ticker.tickerpos_x = ConfigInteger(tickerpos_x, (-20,100))
- config.plugins.sport1ticker.tickerpos_y = ConfigInteger(tickerpos_y, (000,1200))
- config.plugins.sport1ticker.ansicht = ConfigSelection(default="nebeneinander", choices = [("nebeneinander",_("nebeneinander")),("icons",_("icons")),("icons_info",_("icons_info")),("untereinander",_("untereinander"))])
- config.plugins.sport1ticker.select_liga = ConfigSelection(default="co12", choices = [("co12",_("1 liga")),("co3",_("2 liga")),("co4",_("3 liga")),("co19",_("CL")),("co33",_("DFB Pokal"))])
- config.plugins.sport1ticker.farbe = ConfigSelection(default="0x00dab329", choices = [("0xCC0000",_("Rot")),("0x00dab329",_("Gelb")),("0xFFFFFF",_("Weiss")),("0x663300",_("Braun")),("0x339966",_("Olive")),("0x000000",_("Schwarz")),("0x00ffff",_("HellBlau")),("0xccff33",_("HellGrün")),("0xff00ff",_("Lila")),("0x006633",_("Army"))])
- config.plugins.sport1ticker.farbe_neu = ConfigSelection(default="0xCC0000", choices = [("0xCC0000",_("Rot")),("0x00dab329",_("Gelb")),("0xFFFFFF",_("Weiss")),("0x663300",_("Braun")),("0x339966",_("Olive")),("0x000000",_("Schwarz")),("0x00ffff",_("HellBlau")),("0xccff33",_("HellGrün")),("0xff00ff",_("Lila")),("0x006633",_("Army"))])
- config.plugins.sport1ticker.live_farbe = ConfigSelection(default="yellow", choices = [("red",_("Rot")),("yellow",_("Gelb")),("blue",_("Blau")),("black",_("schwarz")),("green",_("Gruen")),("darkgrey",_("Dark Grau")),("white",_("Weiss"))])
- config.plugins.sport1ticker.live_spiel = ConfigSelection(default="0x339966", choices = [("0xCC0000",_("Rot")),("0x00dab329",_("Gelb")),("0xFFFFFF",_("Weiss")),("0x663300",_("Braun")),("0x339966",_("Olive")),("0x000000",_("Schwarz")),("0x00ffff",_("HellBlau")),("0xccff33",_("HellGrün")),("0xff00ff",_("Lila")),("0x006633",_("Army"))])
- config.plugins.sport1ticker.refreshtimer = ConfigInteger(10, (10,120))
- #config.plugins.sport1ticker.hideTimerOnOff = ConfigSelection(default=True, choices = [(True,_("AN")),(False,_("AUS"))])
- config.plugins.sport1ticker.hideTimerOnOff = ConfigYesNo(default = True)
- config.plugins.sport1ticker.hideTimer = ConfigInteger(5, (5,60))
- config.plugins.sport1ticker.hidetabTimer = ConfigInteger(5, (5,60))
- #config.plugins.sport1ticker.hidetabTimerOnOff = ConfigSelection(default=True, choices = [(True,_("AN")),(False,_("AUS"))])
- config.plugins.sport1ticker.hidetabTimerOnOff = ConfigYesNo(default = True)
- #config.plugins.sport1ticker.hideDateOnOff = ConfigSelection(default=True, choices = [(True,_("AN")),(False,_("AUS"))])
- config.plugins.sport1ticker.hideDateOnOff = ConfigYesNo(default = True)
- class tickerlist(MenuList):
- def __init__(self, list):
- MenuList.__init__(self, list, False, eListboxPythonMultiContent)
- self.l.setFont(0, gFont("Regular", 14))
- self.l.setFont(1, gFont("Regular", 16))
- self.l.setFont(2, gFont("Regular", 17))
- self.l.setFont(3, gFont("Regular", 18))
- self.l.setFont(4, gFont("Regular", 19))
- self.l.setFont(5, gFont("Regular", 20))
- self.l.setFont(6, gFont("Regular", 22))
- self.l.setFont(7, gFont("Regular", 24))
- self.l.setFont(8, gFont("Regular", 26))
- class sport1SetupRe(ConfigListScreen,Screen):
- skin = """
- <screen name="Sport1 Ticker Setup" position="center,center" size="640,450" title="Sport1 Ticker v1.3" >
- <widget name="config" position="0,0" size="640,385" itemHeight = "35" scrollbarMode="showOnDemand" />
- <widget name="buttonred" position="10,400" size="90,40" backgroundColor="red" valign="center" halign="center" zPosition="1" foregroundColor="foreground" font="Regular;18"/>
- <widget name="buttongreen" position="540,400" size="90,40" backgroundColor="green" valign="center" halign="center" zPosition="1" foregroundColor="foreground" font="Regular;18"/>
- </screen>"""
- def __init__(self, session):
- self.session = session
- Screen.__init__(self, session)
- self.list = []
- self.list.append(getConfigListEntry("Ticker X Position", config.plugins.sport1ticker.tickerpos_x))
- self.list.append(getConfigListEntry("Ticker Y Position", config.plugins.sport1ticker.tickerpos_y))
- self.list.append(getConfigListEntry(_("Ticker ansicht:"), config.plugins.sport1ticker.ansicht))
- self.list.append(getConfigListEntry(_("Bundesliga:"), config.plugins.sport1ticker.select_liga))
- self.list.append(getConfigListEntry(_("Live Ticker Update Intervall in x sec."), config.plugins.sport1ticker.refreshtimer))
- self.list.append(getConfigListEntry(_("Ticker Ausblenden:"), config.plugins.sport1ticker.hideTimerOnOff))
- self.list.append(getConfigListEntry(_("Ticker Ausblenden nach x sec."), config.plugins.sport1ticker.hideTimer))
- self.list.append(getConfigListEntry(_("Farbe der Tor Ergebnisse"), config.plugins.sport1ticker.farbe))
- self.list.append(getConfigListEntry(_("Farbe der Tor Ergebnisse bei einem Tor:"), config.plugins.sport1ticker.farbe_neu))
- self.list.append(getConfigListEntry(_("Farbe der Tor Ergebnisse wenn Live:"), config.plugins.sport1ticker.live_spiel))
- self.list.append(getConfigListEntry(_("Farbe des Live Tickers:"), config.plugins.sport1ticker.live_farbe))
- self.list.append(getConfigListEntry(_("Tabelle Ausblenden:"), config.plugins.sport1ticker.hidetabTimerOnOff))
- self.list.append(getConfigListEntry(_("Tabelle Ausblenden nach x sec."), config.plugins.sport1ticker.hidetabTimer))
- self.list.append(getConfigListEntry(_("Zeige Datum im Ticker:"), config.plugins.sport1ticker.hideDateOnOff))
- ConfigListScreen.__init__(self, self.list)
- self["buttonred"] = Label(_("cancel"))
- self["buttongreen"] = Label(_("ok"))
- self["setupActions"] = ActionMap(["SetupActions"],
- {
- "green": self.save,
- "red": self.cancel,
- "save": self.save,
- "cancel": self.cancel,
- "ok": self.save,
- }, -2)
- def save(self):
- for x in self["config"].list:
- x[1].save()
- self.close(True)
- def cancel(self):
- self.close(False)
- class Sport1TabelleRe(Screen):
- skin = """
- <screen position="center,center" size="690,660" transparent="0" flags="wfNoBorder" backgroundColor="background" >
- <eLabel name="Background_tabelle" position="center,center" size="650,600" zPosition="-4" backgroundColor="background" />
- <widget name="tabelle" position="20,20" size="650,660" transparent="0" scrollbarMode="showNever" backgroundColor="background" />
- </screen>"""
- def __init__(self, session, select_liga, gameday):
- self.select_liga = select_liga
- self.gameday = gameday
- Screen.__init__(self, session)
- self.session = session
- self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "MovieSelectionActions", "SetupActions"],
- {
- "ok": self.exit,
- "cancel": self.exit,
- "showEventInfo": self.exit,
- "right": self.changeLiga,
- "left": self.changeLiga
- }, -1)
- self["tabelle"] = tickerlist([])
- # hide timer interval
- self.hidetabTimer_interval = int(config.plugins.sport1ticker.hidetabTimer.value) * 1000
- # init timer
- if config.plugins.sport1ticker.hidetabTimerOnOff:
- self.hidetab = eTimer()
- if isDreamOS:
- self.hidetab_conn1 = self.hidetab.timeout.connect(self.loadPage)
- else:
- self.hidetab.callback.append(self.exit)
- # get infos
- self.onClose.append(self.__onClose)
- self.onLayoutFinish.append(self.loadPage)
- def changeLiga(self):
- if self.select_liga == "co12":
- self.select_liga = "co3"
- elif self.select_liga == "co3":
- self.select_liga = "co4"
- elif self.select_liga == "co4":
- self.select_liga = "co12"
- self.loadPage()
- def loadPage(self):
- url = "http://sportsapi.sport1.de/standing-live/%s" % self.select_liga
- print url
- getPage(url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.loadData).addErrback(self.dataError)
- def dataError(self, error):
- print error
- def loadData(self, data):
- tab_data = re.findall('"rank":"(.*?)".*?"id":"(.*?)".*?"name":"(.*?)".*?"matches":"(.*?)".*?"points" : "(.*?)".*?"difference" : "(.*?)".*?last_rank" : "(.*?)"', data, re.S)
- if tab_data:
- tab = []
- for rank,id,name,spieltage,points,diff,lastrank in tab_data:
- #for (spieltage,rein,raus,rank,lastrank,name,points) in tab_data:
- print rank,lastrank,id,name,spieltage,diff,points
- tab.append(self.show_tab(rank,lastrank,id,name,spieltage,diff,points))
- self["tabelle"].l.setList(tab)
- self["tabelle"].l.setItemHeight(32)
- self["tabelle"].selectionEnabled(0)
- if config.plugins.sport1ticker.hidetabTimerOnOff.value:
- self.hidetab.start(self.hidetabTimer_interval)
- def show_tab(self,rank,lastrank,id,name,spieltage,diff,points):
- res = [(rank,lastrank,id,name,spieltage,diff,points)]
- up = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/up.png"
- down = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/down.png"
- gleich = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/gleich.png"
- pic_verein = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/30x30/%s.png" % id
- if not fileExists(pic_verein):
- print "file EXISTIERT NICHT - Download: %s" % pic_verein
- pic_download_home = "http://static.weltsport.net/gfx/emblem/common/30x30/%s.png" % id
- downloadPage(pic_download_home, pic_verein)
- #vereinslogo = LoadPixmap(pic_verein)
- vereinslogo = loadPNG(pic_verein)
- self.windows_width = getDesktop(0).size().width()
- if str(self.windows_width) == "1920":
- self.isFULLHD = True
- else:
- self.isFULLHD = False
- print "HD:", self.isFULLHD, self.windows_width
- if not lastrank.isdigit():
- lastrank = "0"
- if not rank.isdigit():
- rank = "0"
- if self.isFULLHD:
- if int(rank) < int(lastrank):
- res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(up)))
- elif int(rank) > int(lastrank):
- res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(down)))
- elif int(rank) == int(lastrank):
- res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(gleich)))
- res.append(MultiContentEntryText(pos=(50, 0), size=(50, 26), font=3, text=rank+".", flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(100, 0), size=(50, 26), font=3, text="("+lastrank+")", flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(180, 0), size=(30, 30), png=vereinslogo))
- res.append(MultiContentEntryText(pos=(230, 0), size=(250, 26), font=3, text=unix_to_unicode(name), flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(490, 0), size=(40, 26), font=3, text=spieltage, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(545, 0), size=(40, 26), font=3, text=points, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(600, 0), size=(40, 26), font=3, text=diff, flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
- return res
- else:
- if int(rank) < int(lastrank):
- res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(up)))
- elif int(rank) > int(lastrank):
- res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(down)))
- elif int(rank) == int(lastrank):
- res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(gleich)))
- res.append(MultiContentEntryText(pos=(50, 0), size=(50, 26), font=8, text=rank+".", flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(100, 0), size=(50, 26), font=8, text="("+lastrank+")", flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(180, 0), size=(30, 30), png=vereinslogo))
- res.append(MultiContentEntryText(pos=(230, 0), size=(250, 26), font=8, text=unix_to_unicode(name), flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(480, 0), size=(40, 26), font=8, text=spieltage, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(540, 0), size=(40, 26), font=8, text=points, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(600, 0), size=(40, 26), font=8, text=diff, flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
- return res
- def __onClose(self):
- if config.plugins.sport1ticker.hidetabTimerOnOff.value:
- self.hidetab.stop()
- def exit(self):
- self.close()
- class sport1TickerRe(Screen):
- # skin = """
- # <screen position="center,center" size="580,500" transparent="0" flags="wfNoBorder" >
- # <eLabel name="Background_tabelle" position="center,center" size="580,500" zPosition="-4" backgroundColor="background" />
- # <widget name="tabelle" position="0,20" size="580,500" transparent="0" scrollbarMode="showNever" backgroundColor="background" />
- # </screen>"""
- # <eLabel name="Background" position="0,0" size="1920,1080" zPosition="-5" backgroundColor="#ff000000" />
- # <eLabel name="Background_ticker" position="{screen.position}" size="{screen.position2}" zPosition="-4" backgroundColor="background" />
- raw_skin = """
- <screen name="sport1TickerRe" position="{screen.position}" size="{screen.position2}" transparent="0" flags="wfNoBorder" >
- <widget name="ticker_matches" position="0,0" size="{screen.position3}" zPosition="-5" transparent="0" scrollbarMode="showNever" backgroundColor="background" />
- <widget name="ticker_msg" position="{screen.position4}" size="{screen.position5}" halign="left" valign="center" font="Regular;19" transparent="0" foregroundColor="%s" backgroundColor="background" />
- </screen>""" % config.plugins.sport1ticker.live_farbe.value
- def __init__(self, session):
- self.session = session
- # init screen
- tickerpos_x = config.plugins.sport1ticker.tickerpos_x.value
- tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
- self.windows_width = getDesktop(0).size().width()
- if str(self.windows_width) == "1920":
- self.isFULLHD = True
- else:
- self.isFULLHD = False
- print "HD:", self.isFULLHD, self.windows_width
- global tickerpos_x
- global tickerpos_y
- if config.plugins.sport1ticker.ansicht.value == "nebeneinander":
- if self.isFULLHD:
- tickerpos_x = 20
- tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
- screen_size_x = 1880
- screen_size_y = 105
- table_size_x = 1880
- table_size_y = 105
- msg_pos_x = tickerpos_x
- msg_pos_y = tickerpos_y + 105
- msg_size_x = 1880
- msg_size_y = 40
- else:
- tickerpos_x = 20
- tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
- screen_size_x = 1240
- screen_size_y = 70
- table_size_x = 1240
- table_size_y = 60
- msg_pos_x = tickerpos_x
- msg_pos_y = tickerpos_y + 60
- msg_size_x = 1200
- msg_size_y = 20
- elif config.plugins.sport1ticker.ansicht.value == "icons":
- if self.isFULLHD:
- tickerpos_x = 0
- tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
- screen_size_x = 1920
- screen_size_y = 70
- table_size_x = 1920
- table_size_y = 70
- msg_pos_x = tickerpos_x
- msg_pos_y = tickerpos_y + 70
- msg_size_x = 1920
- msg_size_y = 20
- else:
- tickerpos_x = 10
- tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
- screen_size_x = 1260
- screen_size_y = 140
- table_size_x = 1260
- table_size_y = 140
- msg_pos_x = tickerpos_x
- msg_pos_y = tickerpos_y + 130
- msg_size_x = 1200
- msg_size_y = 20
- elif config.plugins.sport1ticker.ansicht.value == "icons_info":
- if self.isFULLHD:
- tickerpos_x = 10
- tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
- screen_size_x = 1980
- screen_size_y = 170
- table_size_x = 1980
- table_size_y = 170
- msg_pos_x = tickerpos_x
- msg_pos_y = tickerpos_y + 180
- msg_size_x = 1980
- msg_size_y = 20
- else:
- tickerpos_x = 10
- tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
- screen_size_x = 1260
- screen_size_y = 170
- table_size_x = 1260
- table_size_y = 170
- msg_pos_x = tickerpos_x
- msg_pos_y = tickerpos_y + 180
- msg_size_x = 1200
- msg_size_y = 20
- else:
- if self.isFULLHD:
- tickerpos_x = 10
- tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
- screen_size_x = 700
- screen_size_y = 320
- table_size_x = 700
- table_size_y = 320
- msg_pos_x = tickerpos_x
- msg_pos_y = tickerpos_y + 320
- msg_size_x = 700
- msg_size_y = 40
- else:
- tickerpos_x = 10
- tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
- screen_size_x = 480
- screen_size_y = 180
- table_size_x = 480
- table_size_y = 250
- msg_pos_x = tickerpos_x
- msg_pos_y = tickerpos_y + 180
- msg_size_x = 480
- msg_size_y = 20
- self.dict = {'screen.position': "%i,%i"%(tickerpos_x,tickerpos_y), 'screen.position2': "%i,%i"%(screen_size_x,screen_size_y), 'screen.position3': "%i,%i"%(screen_size_x,screen_size_y), 'screen.position4': "%i,%i"%(msg_pos_x,msg_pos_y), 'screen.position5': "%i,%i"%(msg_size_x,msg_size_y),}
- self.skin = applySkinVars(sport1TickerRe.raw_skin,self.dict)
- Screen.__init__(self, session)
- self["actions"] = ActionMap(["ColorActions","OkCancelActions","DirectionActions","HelpActions","MovieSelectionActions","InputActions","InfobarActions","InfobarTeletextActions","ChannelSelectBaseActions"],
- {
- "ok": self.ok,
- "cancel": self.exit,
- "showMovies": self.loadPage,
- "contextMenu": self.configScreen,
- "showEventInfo": self.tabelle,
- "up": self.up,
- "down": self.down,
- "green": self.subkanal,
- "blue": self.extension,
- "nextBouquet": moveSkinDown,
- "prevBouquet": moveSkinUp,
- "0": self.history,
- "right": self.zapUp,
- "left": self.zapDown
- }, -1)
- self["ticker_msg"] = Label("")
- #self["ticker_msg"].setText("Zur Zeit keine infos vorhanden.")
- self["ticker_matches"] = tickerlist([])
- # ticker interval
- self.update_interval = int(config.plugins.sport1ticker.refreshtimer.value) * 1000
- self.hideTimer_interval = int(config.plugins.sport1ticker.hideTimer.value) * 1000
- # tricky
- self.reloadgui = False
- self.firststart = True
- self.show_tor = False
- self.gameday = ""
- self.current_season_id = ""
- self.current_round_id = ""
- # hide ticker timer
- if config.plugins.sport1ticker.hideTimerOnOff.value:
- self.hideTimer = eTimer()
- if isDreamOS:
- self.hideTimer_conn1 = self.hideTimer.timeout.connect(self.hideTicker)
- else:
- self.hideTimer.callback.append(self.hideTicker)
- self.hideTimer.start(self.hideTimer_interval)
- self.reloadgui = True
- # autoload loadPage
- self.updateTimer = eTimer()
- if isDreamOS:
- self.updateTimer_conn1 = self.updateTimer.timeout.connect(self.loadPage)
- else:
- self.updateTimer.callback.append(self.loadPage)
- # init farben
- self.tor_farbe = long(config.plugins.sport1ticker.farbe.value, 16)
- self.tor_farbe_neu = long(config.plugins.sport1ticker.farbe_neu.value, 16)
- self.live_spiel = long(config.plugins.sport1ticker.live_spiel.value, 16)
- # init game tables
- self.games_data = []
- self.games_data_old = []
- # select liga from config
- self.select_liga = config.plugins.sport1ticker.select_liga.value
- # zeige datum im ticker
- self.hideDateOnOff = config.plugins.sport1ticker.hideDateOnOff.value
- # get infos
- self.onLayoutFinish.append(self.loadPage)
- self.onClose.append(self.__onClose)
- def subkanal(self):
- if InfoBar and InfoBar.instance:
- InfoBar.subserviceSelection(InfoBar.instance)
- def history(self):
- if InfoBar and InfoBar.instance:
- InfoBar.historyNext(InfoBar.instance)
- def extension(self):
- if InfoBar and InfoBar.instance:
- InfoBar.showExtensionSelection(InfoBar.instance)
- def zapDown(self):
- if InfoBar and InfoBar.instance:
- InfoBar.zapDown(InfoBar.instance)
- def zapUp(self):
- if InfoBar and InfoBar.instance:
- InfoBar.zapUp(InfoBar.instance)
- def moveSkinUp(self):
- if not self.shown:
- self.show()
- global tickerpos_y
- tickerpos_y += 5
- print tickerpos_y
- config.plugins.sport1ticker.tickerpos_y.value = tickerpos_y
- config.plugins.sport1ticker.tickerpos_y.save()
- self.instance.move(ePoint(tickerpos_x, tickerpos_y))
- def moveSkinDown(self):
- if not self.shown:
- self.show()
- global tickerpos_y
- tickerpos_y -= 5
- print tickerpos_y
- config.plugins.sport1ticker.tickerpos_y.value = tickerpos_y
- config.plugins.sport1ticker.tickerpos_y.save()
- self.instance.move(ePoint(tickerpos_x, tickerpos_y))
- def hideTicker(self):
- if self.shown:
- print "[Sport1]: hide ticker."
- if config.plugins.sport1ticker.hideTimerOnOff.value:
- self.hideTimer.stop()
- self.hide()
- def loadPage(self):
- # stop updateTmer
- self.updateTimer.stop()
- # get gameday
- if self.firststart:
- self.firststart = False
- #init_url = "http://ticker.sport1.de/ticker/data/fussball/"+self.select_liga+"/init.json"
- init_url = "http://sportsapi.sport1.de/competition/%s" % self.select_liga
- print init_url
- getPage(init_url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.get_gameday).addErrback(self.dataError)
- else:
- self.loadPageData()
- def loadPageData(self):
- # hole daten
- print "[Sport1]: update.."
- if config.plugins.sport1ticker.select_liga.value == "co19" or config.plugins.sport1ticker.select_liga.value == "co33":
- url = "http://sportsapi.sport1.de/matches-by-season/co19/se%s/ro%s" % (self.current_season_id, self.current_round_id)
- else:
- url = "http://sportsapi.sport1.de/matches-by-season/%s/se/md%s" % (self.select_liga, self.gameday)
- print url
- getPage(url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.loadData).addErrback(self.dataError)
- def dataError(self, error):
- print error
- def get_gameday(self, data):
- check_gameday = re.findall('"current_matchday":"(.*?)"', data, re.S)
- current_round_id = re.findall('"current_round_id":"(.*?)"', data, re.S)
- current_season_id = re.findall('"current_season_id":"(.*?)"', data, re.S)
- if current_round_id:
- self.current_round_id = current_round_id[0]
- if current_season_id:
- self.current_season_id = current_season_id[0]
- if check_gameday:
- print "[Sport1]: gameday %s" % check_gameday[0]
- self.gameday = check_gameday[0]
- self.loadPageData()
- def loadData(self, data):
- self.ticker_games = []
- matches = re.findall('"matchday".*?"match_date":"(.*?)","match_time":"(.*?)".*?"finished":"(.*?)".*?"live_status":"(.*?)".*?current_period":"(.*?)".*?"home".*?"id":"(.*?)".*?"name":"(.*?)".*?"away".*?"id":"(.*?)".*?"name":"(.*?)".*?match_result":"(.*?)","match_result_at":"0","place":"home".*?match_result":"(.*?)","match_result_at":"0","place":"away"', data, re.S|re.S)
- #matches = re.findall('"active":([false|true].*?),.*?"gameid":([0-9]*),".*?date":"(.*?)".*?"tickerUrl":"(.*?)".*?"guest":{"longname":"(.*?)","result":(.*?),".*?"home":{"longname":"(.*?)","result":(.*?),"',data, re.S)
- if matches:
- self.games_data = []
- if self.select_liga == "bl":
- bundesliga = "bundesliga"
- elif self.select_liga == "bl2":
- bundesliga = "bundesliga2"
- elif self.select_liga == "bl3":
- bundesliga = "bundesliga3"
- elif self.select_liga == "dp":
- bundesliga = "dfbpokal"
- elif self.select_liga == "cl":
- bundesliga = "championsleague"
- elif self.select_liga == "uc":
- bundesliga = "europaleague"
- elif self.select_liga == "wq":
- bundesliga = "wmquali"
- #for live,id,datum,url,guest,gr,home,hr in matches:
- # ('06.03.2015', '20:30', 'no', 'full', '', 'VfB Stuttgart', 'Hertha BSC', '0', '0')
- for datum,urhzeit,finished,live_status,current_period,home_id,home,guest_id,guest,hr,gr in matches:
- print datum,urhzeit,finished,live_status,current_period,home_id,unix_to_unicode(home),guest_id,unix_to_unicode(guest),hr,gr
- #m_regex = '.*?http://ticker.sport1.de/liveticker/fussball/'+bundesliga+'/sport1.de/#/.*?,'+self.gameday+',.*?/'
- #print m_regex
- #if re.match(m_regex, url, re.S):
- match = "%s - %s" % (home,guest)
- tore = "%s - %s" % (hr,gr)
- datum = "%s %s" % (datum,urhzeit)
- #if live_status == "full":
- #if current_period == "game-start" or current_period == "second-half-start":
- # live = "true"
- #else:
- # live = "false"
- self.games_data.append((current_period,datum,home_id,guest_id,match,tore))
- if self.games_data:
- self.show_tor = False
- self.ticker_games.append(self.display_matches(self.games_data))
- self["ticker_matches"].l.setList(self.ticker_games)
- if self.isFULLHD:
- if config.plugins.sport1ticker.ansicht.value == "untereinander" or config.plugins.sport1ticker.ansicht.value == "icons":
- self["ticker_matches"].l.setItemHeight(330)
- elif config.plugins.sport1ticker.ansicht.value == "icons_info":
- self["ticker_matches"].l.setItemHeight(200)
- else:
- self["ticker_matches"].l.setItemHeight(100)
- self["ticker_matches"].selectionEnabled(0)
- else:
- if config.plugins.sport1ticker.ansicht.value == "untereinander" or config.plugins.sport1ticker.ansicht.value == "icons":
- self["ticker_matches"].l.setItemHeight(180)
- elif config.plugins.sport1ticker.ansicht.value == "icons_info":
- self["ticker_matches"].l.setItemHeight(200)
- else:
- self["ticker_matches"].l.setItemHeight(60)
- self["ticker_matches"].selectionEnabled(0)
- print "[Sport1]: rename data > data_old"
- self.games_data_old = self.games_data
- # starte updateTimer
- self.updateTimer.start(self.update_interval)
- def checkin(self, check):
- # rebuild list games_data_old
- temp_list = []
- for each in self.games_data_old:
- #temp_list.append(each[1:])
- temp_list.append(each[4:])
- (c_datum,c_status,c_home_id,c_guest_id,c_match,c_tore) = check
- # search in games_data_old
- search = (c_match, c_tore)
- if search in temp_list:
- return False
- else:
- self.show_tor = True
- return True
- def display_matches(self, entry):
- count = 0
- res = [()]
- if config.plugins.sport1ticker.ansicht.value == "icons" or config.plugins.sport1ticker.ansicht.value == "icons_info":
- e_list = entry[-10:]
- else:
- e_list = entry[-9:]
- for check in e_list:
- #current_period,datum,match,home_id,guest_id,tore
- (current_period,datum,home_id,guest_id,match,tore) = check
- tor = self.checkin(check)
- datum_anzeige = ""
- # if config.plugins.sport1ticker.select_liga.value == "co19":
- # # zeit formatierung
- # (datum_raw,uhrzeit) = datum.split(' ')
- # (days,month,year) = datum_raw.split('.')
- # (std,min) = uhrzeit.split(':')
- #
- # d = datetime(int(year), month_to_int(month), int(days), int(std), int(min), 0, 0)
- # spielbeginn_unixzeit = d.strftime('%s')
- # aktuelle_unixzeit = int(time.time())
- # if int(spielbeginn_unixzeit) < int(aktuelle_unixzeit):
- # continue
- # else:
- # count += 1
- #else:
- count += 1
- if self.hideDateOnOff and not config.plugins.sport1ticker.ansicht.value == "icons" or config.plugins.sport1ticker.ansicht.value == "icons_info":
- # zeit formatierung
- # 01.03.2015 17:30
- (datum_raw,uhrzeit) = datum.split(' ')
- (days,month,year) = datum_raw.split('.')
- if uhrzeit == "unknown":
- std = 00
- min = 00
- else:
- (std,min) = uhrzeit.split(':')
- d = datetime(int(year), month_to_int(month), int(days), int(std), int(min), 0, 0)
- spielbeginn_unixzeit = d.strftime('%s')
- aktuelle_unixzeit = int(time.time())
- # check spielbeginn/aktuelle zeit
- if int(spielbeginn_unixzeit) > int(aktuelle_unixzeit):
- if config.plugins.sport1ticker.ansicht.value == "icons_info":
- datum_anzeige = "%s.%s. %s:%s" % (days,month_to_int(month),std,min)
- else:
- tore = "%s.%s. %s:%s" % (days,month_to_int(month),std,min)
- # fix umlaute - unix_to_unicode
- match = unix_to_unicode(match)
- if current_period == "game-start":
- status_txt = "Live h:1"
- status = "true"
- elif current_period == "second-half-start":
- status_txt = "Live h:2"
- status = "true"
- elif current_period == "first-half-end":
- status_txt = "Halbzeit"
- status = "false"
- elif current_period == "game-end":
- status_txt = "Spielende"
- status = "false"
- elif current_period == "":
- status_txt = datum_anzeige
- status = "false"
- if self.isFULLHD:
- if config.plugins.sport1ticker.ansicht.value == "nebeneinander":
- # ansicht nebeneinander
- if not tor and status == "false":
- self.farbe_tore = self.tor_farbe
- elif not tor and status == "true":
- self.farbe_tore = self.live_spiel
- elif tor:
- self.farbe_tore = self.tor_farbe_neu
- if int(count) == 1:
- res.append(MultiContentEntryText(pos=(20, 0), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(490, 0), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 2:
- res.append(MultiContentEntryText(pos=(650, 0), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(1120, 0), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 3:
- res.append(MultiContentEntryText(pos=(1300, 0), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(1760, 0), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 4:
- res.append(MultiContentEntryText(pos=(20, 35), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(490, 35), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 5:
- res.append(MultiContentEntryText(pos=(650, 35), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(1120, 35), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 6:
- res.append(MultiContentEntryText(pos=(1300, 35), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(1760, 35), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 7:
- res.append(MultiContentEntryText(pos=(20, 70), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(490, 70), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 8:
- res.append(MultiContentEntryText(pos=(650, 70), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(1120, 70), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 9:
- res.append(MultiContentEntryText(pos=(1300, 70), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(1760, 70), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif config.plugins.sport1ticker.ansicht.value == "icons":
- # ansicht club icons
- (home, guest) = match.split(" - ")
- #pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
- #pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
- pic_blank = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/blank.png"
- pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home_id
- pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest_id
- if fileExists(pic_home):
- #png_home = LoadPixmap(pic_home)
- png_home = loadPNG(pic_home)
- else:
- #print "file EXISTIERT NICHT !!!!!"
- pic_download_home = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % home_id
- downloadPage(pic_download_home, pic_home)
- png_home = loadPNG(pic_blank)
- if fileExists(pic_guest):
- #png_guest = LoadPixmap(pic_guest)
- png_guest = loadPNG(pic_guest)
- else:
- #print "file EXISTIERT NICHT !!!!!"
- pic_download_guest = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % guest_id
- downloadPage(pic_download_guest, pic_guest)
- png_guest = loadPNG(pic_blank)
- if not tor and status == "false":
- self.farbe_tore = self.tor_farbe
- elif not tor and status == "true":
- self.farbe_tore = self.live_spiel
- elif tor:
- self.farbe_tore = self.tor_farbe_neu
- if int(count) == 1:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(55, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(140, 10), size=(50, 50), png=png_guest))
- elif int(count) == 2:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(200, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(255, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(340, 10), size=(50, 50), png=png_guest))
- elif int(count) == 3:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(400, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(445, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(530, 10), size=(50, 50), png=png_guest))
- elif int(count) == 4:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(590, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(635, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(720, 10), size=(50, 50), png=png_guest))
- elif int(count) == 5:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(780, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(825, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(910, 10), size=(50, 50), png=png_guest))
- elif int(count) == 6:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(970, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1015, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1100, 10), size=(50, 50), png=png_guest))
- elif int(count) == 7:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1160, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1205, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1290, 10), size=(50, 50), png=png_guest))
- elif int(count) == 8:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1350, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1395, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1480, 10), size=(50, 50), png=png_guest))
- elif int(count) == 9:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1540, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1585, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1670, 10), size=(50, 50), png=png_guest))
- elif int(count) == 10:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1730, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1775, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1860, 10), size=(50, 50), png=png_guest))
- elif config.plugins.sport1ticker.ansicht.value == "icons_info":
- # ansicht club icons
- (home, guest) = match.split(" - ")
- #pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
- #pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
- pic_blank = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/blank.png"
- pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home_id
- pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest_id
- if fileExists(pic_home):
- #png_home = LoadPixmap(pic_home)
- png_home = loadPNG(pic_home)
- else:
- pic_download_home = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % home_id
- print "file EXISTIERT NICHT - Download Vereins-Logo: %s" % pic_download_home
- downloadPage(pic_download_home, pic_home)
- png_home = loadPNG(pic_blank)
- if fileExists(pic_guest):
- #png_guest = LoadPixmap(pic_guest)
- png_guest = loadPNG(pic_guest)
- else:
- pic_download_guest = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % guest_id
- print "file EXISTIERT NICHT - Download Vereins-Logo: %s" % pic_download_guest
- downloadPage(pic_download_guest, pic_guest)
- png_guest = loadPNG(pic_blank)
- if not tor and status == "false":
- self.farbe_tore = self.tor_farbe
- elif not tor and status == "true":
- self.farbe_tore = self.live_spiel
- elif tor:
- self.farbe_tore = self.tor_farbe_neu
- if int(count) == 1:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(60, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(10, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 2:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(325, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(275, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 3:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(590, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(540, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 4:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(850, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(800, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 5:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1110, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(1060, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 6:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(60, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(10, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 7:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(325, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(275, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 8:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(590, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(540, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 9:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(850, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(800, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 10:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1110, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(1060, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- else:
- # ansicht untereinander
- if not tor and status == "false":
- self.farbe_tore = self.tor_farbe
- elif not tor and status == "true":
- self.farbe_tore = self.live_spiel
- elif tor:
- self.farbe_tore = self.tor_farbe_neu
- if int(count) == 1:
- res.append(MultiContentEntryText(pos=(20, 0), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(530, 0), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 2:
- res.append(MultiContentEntryText(pos=(20, 35), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(530, 35), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 3:
- res.append(MultiContentEntryText(pos=(20, 70), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(530, 70), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 4:
- res.append(MultiContentEntryText(pos=(20, 105), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(530, 105), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 5:
- res.append(MultiContentEntryText(pos=(20, 140), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(530, 140), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 6:
- res.append(MultiContentEntryText(pos=(20, 175), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(530, 175), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 7:
- res.append(MultiContentEntryText(pos=(20, 210), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(530, 210), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 8:
- res.append(MultiContentEntryText(pos=(20, 245), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(530, 245), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 9:
- res.append(MultiContentEntryText(pos=(20, 280), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(530, 280), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- else:
- if config.plugins.sport1ticker.ansicht.value == "nebeneinander":
- # ansicht nebeneinander
- if not tor and status == "false":
- self.farbe_tore = self.tor_farbe
- elif not tor and status == "true":
- self.farbe_tore = self.live_spiel
- elif tor:
- self.farbe_tore = self.tor_farbe_neu
- if int(count) == 1:
- res.append(MultiContentEntryText(pos=(20, 0), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(320, 0), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 2:
- res.append(MultiContentEntryText(pos=(410, 0), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(720, 0), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 3:
- res.append(MultiContentEntryText(pos=(810, 0), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(1120, 0), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 4:
- res.append(MultiContentEntryText(pos=(20, 20), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(320, 20), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 5:
- res.append(MultiContentEntryText(pos=(410, 20), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(720, 20), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 6:
- res.append(MultiContentEntryText(pos=(810, 20), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(1120, 20), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 7:
- res.append(MultiContentEntryText(pos=(20, 40), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(320, 40), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 8:
- res.append(MultiContentEntryText(pos=(410, 40), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(720, 40), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 9:
- res.append(MultiContentEntryText(pos=(810, 40), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(1120, 40), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif config.plugins.sport1ticker.ansicht.value == "icons":
- # ansicht club icons
- (home, guest) = match.split(" - ")
- #pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
- #pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
- pic_blank = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/blank.png"
- pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home_id
- pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest_id
- if fileExists(pic_home):
- #png_home = LoadPixmap(pic_home)
- png_home = loadPNG(pic_home)
- else:
- #print "file EXISTIERT NICHT !!!!!"
- pic_download_home = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % home_id
- downloadPage(pic_download_home, pic_home)
- png_home = loadPNG(pic_blank)
- if fileExists(pic_guest):
- #png_guest = LoadPixmap(pic_guest)
- png_guest = loadPNG(pic_guest)
- else:
- #print "file EXISTIERT NICHT !!!!!"
- pic_download_guest = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % guest_id
- downloadPage(pic_download_guest, pic_guest)
- png_guest = loadPNG(pic_blank)
- if not tor and status == "false":
- self.farbe_tore = self.tor_farbe
- elif not tor and status == "true":
- self.farbe_tore = self.live_spiel
- elif tor:
- self.farbe_tore = self.tor_farbe_neu
- if int(count) == 1:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(60, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 10), size=(50, 50), png=png_guest))
- elif int(count) == 2:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(330, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 10), size=(50, 50), png=png_guest))
- elif int(count) == 3:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(590, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 10), size=(50, 50), png=png_guest))
- elif int(count) == 4:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(850, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 10), size=(50, 50), png=png_guest))
- elif int(count) == 5:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1110, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 10), size=(50, 50), png=png_guest))
- elif int(count) == 6:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 80), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(60, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 80), size=(50, 50), png=png_guest))
- elif int(count) == 7:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 80), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(330, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 80), size=(50, 50), png=png_guest))
- elif int(count) == 8:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 80), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(590, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 80), size=(50, 50), png=png_guest))
- elif int(count) == 9:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 80), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(850, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 80), size=(50, 50), png=png_guest))
- elif int(count) == 10:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 80), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1110, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 80), size=(50, 50), png=png_guest))
- elif config.plugins.sport1ticker.ansicht.value == "icons_info":
- # ansicht club icons
- (home, guest) = match.split(" - ")
- #pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
- #pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
- pic_blank = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/blank.png"
- pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home_id
- pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest_id
- if fileExists(pic_home):
- #png_home = LoadPixmap(pic_home)
- png_home = loadPNG(pic_home)
- else:
- pic_download_home = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % home_id
- print "file EXISTIERT NICHT - Download Vereins-Logo: %s" % pic_download_home
- downloadPage(pic_download_home, pic_home)
- png_home = loadPNG(pic_blank)
- if fileExists(pic_guest):
- #png_guest = LoadPixmap(pic_guest)
- png_guest = loadPNG(pic_guest)
- else:
- pic_download_guest = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % guest_id
- print "file EXISTIERT NICHT - Download Vereins-Logo: %s" % pic_download_guest
- downloadPage(pic_download_guest, pic_guest)
- png_guest = loadPNG(pic_blank)
- if not tor and status == "false":
- self.farbe_tore = self.tor_farbe
- elif not tor and status == "true":
- self.farbe_tore = self.live_spiel
- elif tor:
- self.farbe_tore = self.tor_farbe_neu
- if int(count) == 1:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(60, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(10, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 2:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(325, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(275, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 3:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(590, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(540, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 4:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(850, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(800, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 5:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 10), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1110, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 10), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(1060, 60), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 6:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(60, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(10, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 7:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(325, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(275, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 8:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(590, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(540, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 9:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(850, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(800, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- elif int(count) == 10:
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 90), size=(50, 50), png = png_home))
- res.append(MultiContentEntryText(pos=(1110, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 90), size=(50, 50), png=png_guest))
- res.append(MultiContentEntryText(pos=(1060, 140), size=(190, 20), font=3, text=status_txt, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
- else:
- # ansicht untereinander
- if not tor and status == "false":
- self.farbe_tore = self.tor_farbe
- elif not tor and status == "true":
- self.farbe_tore = self.live_spiel
- elif tor:
- self.farbe_tore = self.tor_farbe_neu
- if int(count) == 1:
- res.append(MultiContentEntryText(pos=(20, 0), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(370, 0), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 2:
- res.append(MultiContentEntryText(pos=(20, 20), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(370, 20), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 3:
- res.append(MultiContentEntryText(pos=(20, 40), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(370, 40), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 4:
- res.append(MultiContentEntryText(pos=(20, 60), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(370, 60), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 5:
- res.append(MultiContentEntryText(pos=(20, 80), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(370, 80), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 6:
- res.append(MultiContentEntryText(pos=(20, 100), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(370, 100), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 7:
- res.append(MultiContentEntryText(pos=(20, 120), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(370, 120), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 8:
- res.append(MultiContentEntryText(pos=(20, 140), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(370, 140), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- elif int(count) == 9:
- res.append(MultiContentEntryText(pos=(20, 160), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- res.append(MultiContentEntryText(pos=(370, 160), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
- self.check_show()
- return res
- def check_show(self):
- if self.show_tor:
- print "[Sport1]: show ticker."
- if not self.shown:
- if config.plugins.sport1ticker.hideTimerOnOff.value:
- self.hideTimer.start(self.hideTimer_interval)
- self.show()
- else:
- if config.plugins.sport1ticker.hideTimerOnOff.value:
- self.hideTimer.stop()
- self.hideTimer.start(self.hideTimer_interval)
- else:
- pass
- def ok(self):
- if not self.shown:
- print "[Sport1]: show ticker."
- if config.plugins.sport1ticker.hideTimerOnOff.value:
- self.hideTimer.start(self.hideTimer_interval)
- self.show()
- else:
- print "[Sport1]: hide ticker."
- if config.plugins.sport1ticker.hideTimerOnOff.value:
- self.hideTimer.stop()
- self.hide()
- def up(self):
- self.servicelist = self.session.instantiateDialog(ChannelSelection)
- self.servicelist.moveUp()
- self.session.execDialog(self.servicelist)
- def down(self):
- self.servicelist = self.session.instantiateDialog(ChannelSelection)
- self.servicelist.moveDown()
- self.session.execDialog(self.servicelist)
- def tabelle(self):
- #if self.select_liga == "bl" or self.select_liga == "bl2":
- if config.plugins.sport1ticker.select_liga.value == "co19":
- message = self.session.open(MessageBox, _("Keine Tabelle verfuegbar."), MessageBox.TYPE_INFO, timeout=5)
- elif config.plugins.sport1ticker.select_liga.value == "co33":
- message = self.session.open(MessageBox, _("Keine Tabelle verfuegbar."), MessageBox.TYPE_INFO, timeout=5)
- else:
- self.session.open(Sport1TabelleRe, self.select_liga, self.gameday)
- #else:
- # message = self.session.open(MessageBox, _("Keine Tabelle verfuegbar."), MessageBox.TYPE_INFO, timeout=5)
- def configScreen(self):
- self.session.openWithCallback(self.configClose, sport1SetupRe)
- def configClose(self, result):
- if result:
- self.close(self.session, False)
- def __onClose(self):
- print "[Sport1]: stop timer."
- self.updateTimer.stop()
- if config.plugins.sport1ticker.hideTimerOnOff.value and self.reloadgui:
- self.hideTimer.stop()
- def exit(self):
- self.close(self.session, True)
- def unix_to_unicode(text):
- special = {"\xc4": "Ae", "\xe4": "ae", "\xd6" : "Oe", "\xf6" : "oe", "\xdc" :"Ue", "\xfc" : "ue", "\xdf" : "ss"}
- for key in special.keys():
- text = text.replace(key, special[key])
- return text
- def month_to_int(text):
- special = {"Jan": "1", "Feb": "2", "Mar" : "3", "Apr" : "4", "May" :"5", "Jun" : "6", "Jul" : "7", "Aug" : "8", "Sep" : "9", "Oct" : "10", "Nov" : "11", "Dec" : "12"}
- for key in special.keys():
- text = text.replace(key, special[key])
- return int(text)
- def main(session, **kwargs):
- session.openWithCallback(check_close,sport1TickerRe)
- def check_close(session, result):
- if not result:
- print "[Sport1]: screen reload.."
- session.openWithCallback(check_close,sport1TickerRe)
- def Plugins(**kwargs):
- return [
- PluginDescriptor(name="Sport1 Ticker", description="Sport1 Live Ticker", where = [PluginDescriptor.WHERE_EXTENSIONSMENU], fnc=main),
- PluginDescriptor(name="Sport1 Ticker", description="Sport1 Live Ticker", where = [PluginDescriptor.WHERE_PLUGINMENU], fnc=main, icon="plugin.png")
- ]
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Flo79 ()
-
Ähnliche Themen