Buli ticker

    Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

    • Buli ticker

      1. 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
      2. ich das falsch..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 ?
    • Habe das Plugin im moment nicht drauf kann also nicht sagen ob es funktioniert.



      Edit:
      robier das doch noch mal aus. :8)

      Klick mich

      Dieser 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 :D Trotz alle dem vielen Dank ;)
    • Sport1 Ticker Keymap ändern

      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

      1. #!/usr/bin/python
      2. # -*- coding: utf-8 -*-
      3. import re, time
      4. from datetime import datetime
      5. from Components.ActionMap import *
      6. from Components.Label import Label
      7. from Components.MenuList import MenuList
      8. from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmap, MultiContentEntryPixmapAlphaTest
      9. from Components.Pixmap import Pixmap
      10. from Components.AVSwitch import AVSwitch
      11. from Components.config import config, ConfigInteger, ConfigSelection, getConfigListEntry, ConfigText, ConfigDirectory, ConfigYesNo, configfile, ConfigSelection, ConfigSubsection, ConfigPIN, NoSave, ConfigNothing
      12. from Components.ConfigList import ConfigListScreen
      13. from Components.PluginComponent import plugins
      14. from Components.Button import Button
      15. from Screens.InputBox import InputBox
      16. from Screens.ChoiceBox import ChoiceBox
      17. from Screens.ChannelSelection import ChannelSelection
      18. from Screens.InfoBar import InfoBar
      19. from Screens.InfoBarGenerics import InfoBarSubserviceSelection, InfoBarSeek, InfoBarShowHide
      20. from Screens.MovieSelection import MovieSelection
      21. from Screens.MessageBox import MessageBox
      22. from Screens.SubservicesQuickzap import SubservicesQuickzap
      23. from Screens.Screen import Screen
      24. from skin import parseColor
      25. from Tools.Directories import pathExists, fileExists, SCOPE_SKIN_IMAGE, resolveFilename
      26. from Tools.LoadPixmap import LoadPixmap
      27. from Plugins.Plugin import PluginDescriptor
      28. from twisted.web.client import getPage
      29. from twisted.web.client import downloadPage
      30. 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
      31. try:
      32. from enigma import eMediaDatabase
      33. isDreamOS = True
      34. except:
      35. try:
      36. file = open("/proc/stb/info/model", "r")
      37. dev = file.readline().strip()
      38. file.close()
      39. if dev == "dm7080":
      40. isDreamOS = True
      41. elif dev == "dm820":
      42. isDreamOS = True
      43. else:
      44. isDreamOS = False
      45. except:
      46. isDreamOS = False
      47. def applySkinVars(skin,dict):
      48. for key in dict.keys():
      49. try:
      50. skin = skin.replace('{'+key+'}',dict[key])
      51. except Exception,e:
      52. print e,"@key=",key
      53. return skin
      54. # ticker position
      55. tickerpos_x = 20
      56. tickerpos_y = 620
      57. # config
      58. config.plugins.sport1ticker = ConfigSubsection()
      59. config.plugins.sport1ticker.tickerpos_x = ConfigInteger(tickerpos_x, (-20,100))
      60. config.plugins.sport1ticker.tickerpos_y = ConfigInteger(tickerpos_y, (000,1200))
      61. config.plugins.sport1ticker.ansicht = ConfigSelection(default="nebeneinander", choices = [("nebeneinander",_("nebeneinander")),("icons",_("icons")),("icons_info",_("icons_info")),("untereinander",_("untereinander"))])
      62. config.plugins.sport1ticker.select_liga = ConfigSelection(default="co12", choices = [("co12",_("1 liga")),("co3",_("2 liga")),("co4",_("3 liga")),("co19",_("CL")),("co33",_("DFB Pokal"))])
      63. 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"))])
      64. 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"))])
      65. config.plugins.sport1ticker.live_farbe = ConfigSelection(default="yellow", choices = [("red",_("Rot")),("yellow",_("Gelb")),("blue",_("Blau")),("black",_("schwarz")),("green",_("Gruen")),("darkgrey",_("Dark Grau")),("white",_("Weiss"))])
      66. 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"))])
      67. config.plugins.sport1ticker.refreshtimer = ConfigInteger(10, (10,120))
      68. #config.plugins.sport1ticker.hideTimerOnOff = ConfigSelection(default=True, choices = [(True,_("AN")),(False,_("AUS"))])
      69. config.plugins.sport1ticker.hideTimerOnOff = ConfigYesNo(default = True)
      70. config.plugins.sport1ticker.hideTimer = ConfigInteger(5, (5,60))
      71. config.plugins.sport1ticker.hidetabTimer = ConfigInteger(5, (5,60))
      72. #config.plugins.sport1ticker.hidetabTimerOnOff = ConfigSelection(default=True, choices = [(True,_("AN")),(False,_("AUS"))])
      73. config.plugins.sport1ticker.hidetabTimerOnOff = ConfigYesNo(default = True)
      74. #config.plugins.sport1ticker.hideDateOnOff = ConfigSelection(default=True, choices = [(True,_("AN")),(False,_("AUS"))])
      75. config.plugins.sport1ticker.hideDateOnOff = ConfigYesNo(default = True)
      76. class tickerlist(MenuList):
      77. def __init__(self, list):
      78. MenuList.__init__(self, list, False, eListboxPythonMultiContent)
      79. self.l.setFont(0, gFont("Regular", 14))
      80. self.l.setFont(1, gFont("Regular", 16))
      81. self.l.setFont(2, gFont("Regular", 17))
      82. self.l.setFont(3, gFont("Regular", 18))
      83. self.l.setFont(4, gFont("Regular", 19))
      84. self.l.setFont(5, gFont("Regular", 20))
      85. self.l.setFont(6, gFont("Regular", 22))
      86. self.l.setFont(7, gFont("Regular", 24))
      87. self.l.setFont(8, gFont("Regular", 26))
      88. class sport1SetupRe(ConfigListScreen,Screen):
      89. skin = """
      90. <screen name="Sport1 Ticker Setup" position="center,center" size="640,450" title="Sport1 Ticker v1.3" >
      91. <widget name="config" position="0,0" size="640,385" itemHeight = "35" scrollbarMode="showOnDemand" />
      92. <widget name="buttonred" position="10,400" size="90,40" backgroundColor="red" valign="center" halign="center" zPosition="1" foregroundColor="foreground" font="Regular;18"/>
      93. <widget name="buttongreen" position="540,400" size="90,40" backgroundColor="green" valign="center" halign="center" zPosition="1" foregroundColor="foreground" font="Regular;18"/>
      94. </screen>"""
      95. def __init__(self, session):
      96. self.session = session
      97. Screen.__init__(self, session)
      98. self.list = []
      99. self.list.append(getConfigListEntry("Ticker X Position", config.plugins.sport1ticker.tickerpos_x))
      100. self.list.append(getConfigListEntry("Ticker Y Position", config.plugins.sport1ticker.tickerpos_y))
      101. self.list.append(getConfigListEntry(_("Ticker ansicht:"), config.plugins.sport1ticker.ansicht))
      102. self.list.append(getConfigListEntry(_("Bundesliga:"), config.plugins.sport1ticker.select_liga))
      103. self.list.append(getConfigListEntry(_("Live Ticker Update Intervall in x sec."), config.plugins.sport1ticker.refreshtimer))
      104. self.list.append(getConfigListEntry(_("Ticker Ausblenden:"), config.plugins.sport1ticker.hideTimerOnOff))
      105. self.list.append(getConfigListEntry(_("Ticker Ausblenden nach x sec."), config.plugins.sport1ticker.hideTimer))
      106. self.list.append(getConfigListEntry(_("Farbe der Tor Ergebnisse"), config.plugins.sport1ticker.farbe))
      107. self.list.append(getConfigListEntry(_("Farbe der Tor Ergebnisse bei einem Tor:"), config.plugins.sport1ticker.farbe_neu))
      108. self.list.append(getConfigListEntry(_("Farbe der Tor Ergebnisse wenn Live:"), config.plugins.sport1ticker.live_spiel))
      109. self.list.append(getConfigListEntry(_("Farbe des Live Tickers:"), config.plugins.sport1ticker.live_farbe))
      110. self.list.append(getConfigListEntry(_("Tabelle Ausblenden:"), config.plugins.sport1ticker.hidetabTimerOnOff))
      111. self.list.append(getConfigListEntry(_("Tabelle Ausblenden nach x sec."), config.plugins.sport1ticker.hidetabTimer))
      112. self.list.append(getConfigListEntry(_("Zeige Datum im Ticker:"), config.plugins.sport1ticker.hideDateOnOff))
      113. ConfigListScreen.__init__(self, self.list)
      114. self["buttonred"] = Label(_("cancel"))
      115. self["buttongreen"] = Label(_("ok"))
      116. self["setupActions"] = ActionMap(["SetupActions"],
      117. {
      118. "green": self.save,
      119. "red": self.cancel,
      120. "save": self.save,
      121. "cancel": self.cancel,
      122. "ok": self.save,
      123. }, -2)
      124. def save(self):
      125. for x in self["config"].list:
      126. x[1].save()
      127. self.close(True)
      128. def cancel(self):
      129. self.close(False)
      130. class Sport1TabelleRe(Screen):
      131. skin = """
      132. <screen position="center,center" size="690,660" transparent="0" flags="wfNoBorder" backgroundColor="background" >
      133. <eLabel name="Background_tabelle" position="center,center" size="650,600" zPosition="-4" backgroundColor="background" />
      134. <widget name="tabelle" position="20,20" size="650,660" transparent="0" scrollbarMode="showNever" backgroundColor="background" />
      135. </screen>"""
      136. def __init__(self, session, select_liga, gameday):
      137. self.select_liga = select_liga
      138. self.gameday = gameday
      139. Screen.__init__(self, session)
      140. self.session = session
      141. self["actions"] = ActionMap(["OkCancelActions", "DirectionActions", "MovieSelectionActions", "SetupActions"],
      142. {
      143. "ok": self.exit,
      144. "cancel": self.exit,
      145. "showEventInfo": self.exit,
      146. "right": self.changeLiga,
      147. "left": self.changeLiga
      148. }, -1)
      149. self["tabelle"] = tickerlist([])
      150. # hide timer interval
      151. self.hidetabTimer_interval = int(config.plugins.sport1ticker.hidetabTimer.value) * 1000
      152. # init timer
      153. if config.plugins.sport1ticker.hidetabTimerOnOff:
      154. self.hidetab = eTimer()
      155. if isDreamOS:
      156. self.hidetab_conn1 = self.hidetab.timeout.connect(self.loadPage)
      157. else:
      158. self.hidetab.callback.append(self.exit)
      159. # get infos
      160. self.onClose.append(self.__onClose)
      161. self.onLayoutFinish.append(self.loadPage)
      162. def changeLiga(self):
      163. if self.select_liga == "co12":
      164. self.select_liga = "co3"
      165. elif self.select_liga == "co3":
      166. self.select_liga = "co4"
      167. elif self.select_liga == "co4":
      168. self.select_liga = "co12"
      169. self.loadPage()
      170. def loadPage(self):
      171. url = "http://sportsapi.sport1.de/standing-live/%s" % self.select_liga
      172. print url
      173. getPage(url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.loadData).addErrback(self.dataError)
      174. def dataError(self, error):
      175. print error
      176. def loadData(self, data):
      177. tab_data = re.findall('"rank":"(.*?)".*?"id":"(.*?)".*?"name":"(.*?)".*?"matches":"(.*?)".*?"points" : "(.*?)".*?"difference" : "(.*?)".*?last_rank" : "(.*?)"', data, re.S)
      178. if tab_data:
      179. tab = []
      180. for rank,id,name,spieltage,points,diff,lastrank in tab_data:
      181. #for (spieltage,rein,raus,rank,lastrank,name,points) in tab_data:
      182. print rank,lastrank,id,name,spieltage,diff,points
      183. tab.append(self.show_tab(rank,lastrank,id,name,spieltage,diff,points))
      184. self["tabelle"].l.setList(tab)
      185. self["tabelle"].l.setItemHeight(32)
      186. self["tabelle"].selectionEnabled(0)
      187. if config.plugins.sport1ticker.hidetabTimerOnOff.value:
      188. self.hidetab.start(self.hidetabTimer_interval)
      189. def show_tab(self,rank,lastrank,id,name,spieltage,diff,points):
      190. res = [(rank,lastrank,id,name,spieltage,diff,points)]
      191. up = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/up.png"
      192. down = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/down.png"
      193. gleich = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/gleich.png"
      194. pic_verein = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/30x30/%s.png" % id
      195. if not fileExists(pic_verein):
      196. print "file EXISTIERT NICHT - Download: %s" % pic_verein
      197. pic_download_home = "http://static.weltsport.net/gfx/emblem/common/30x30/%s.png" % id
      198. downloadPage(pic_download_home, pic_verein)
      199. #vereinslogo = LoadPixmap(pic_verein)
      200. vereinslogo = loadPNG(pic_verein)
      201. self.windows_width = getDesktop(0).size().width()
      202. if str(self.windows_width) == "1920":
      203. self.isFULLHD = True
      204. else:
      205. self.isFULLHD = False
      206. print "HD:", self.isFULLHD, self.windows_width
      207. if not lastrank.isdigit():
      208. lastrank = "0"
      209. if not rank.isdigit():
      210. rank = "0"
      211. if self.isFULLHD:
      212. if int(rank) < int(lastrank):
      213. res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(up)))
      214. elif int(rank) > int(lastrank):
      215. res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(down)))
      216. elif int(rank) == int(lastrank):
      217. res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(gleich)))
      218. res.append(MultiContentEntryText(pos=(50, 0), size=(50, 26), font=3, text=rank+".", flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
      219. res.append(MultiContentEntryText(pos=(100, 0), size=(50, 26), font=3, text="("+lastrank+")", flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
      220. res.append(MultiContentEntryPixmapAlphaTest(pos=(180, 0), size=(30, 30), png=vereinslogo))
      221. res.append(MultiContentEntryText(pos=(230, 0), size=(250, 26), font=3, text=unix_to_unicode(name), flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      222. res.append(MultiContentEntryText(pos=(490, 0), size=(40, 26), font=3, text=spieltage, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      223. res.append(MultiContentEntryText(pos=(545, 0), size=(40, 26), font=3, text=points, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      224. res.append(MultiContentEntryText(pos=(600, 0), size=(40, 26), font=3, text=diff, flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
      225. return res
      226. else:
      227. if int(rank) < int(lastrank):
      228. res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(up)))
      229. elif int(rank) > int(lastrank):
      230. res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(down)))
      231. elif int(rank) == int(lastrank):
      232. res.append(MultiContentEntryPixmapAlphaTest(pos=(13, 1), size=(24, 24), png=loadPNG(gleich)))
      233. res.append(MultiContentEntryText(pos=(50, 0), size=(50, 26), font=8, text=rank+".", flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
      234. res.append(MultiContentEntryText(pos=(100, 0), size=(50, 26), font=8, text="("+lastrank+")", flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
      235. res.append(MultiContentEntryPixmapAlphaTest(pos=(180, 0), size=(30, 30), png=vereinslogo))
      236. res.append(MultiContentEntryText(pos=(230, 0), size=(250, 26), font=8, text=unix_to_unicode(name), flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      237. res.append(MultiContentEntryText(pos=(480, 0), size=(40, 26), font=8, text=spieltage, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      238. res.append(MultiContentEntryText(pos=(540, 0), size=(40, 26), font=8, text=points, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      239. res.append(MultiContentEntryText(pos=(600, 0), size=(40, 26), font=8, text=diff, flags=RT_HALIGN_RIGHT|RT_VALIGN_CENTER))
      240. return res
      241. def __onClose(self):
      242. if config.plugins.sport1ticker.hidetabTimerOnOff.value:
      243. self.hidetab.stop()
      244. def exit(self):
      245. self.close()
      246. class sport1TickerRe(Screen):
      247. # skin = """
      248. # <screen position="center,center" size="580,500" transparent="0" flags="wfNoBorder" >
      249. # <eLabel name="Background_tabelle" position="center,center" size="580,500" zPosition="-4" backgroundColor="background" />
      250. # <widget name="tabelle" position="0,20" size="580,500" transparent="0" scrollbarMode="showNever" backgroundColor="background" />
      251. # </screen>"""
      252. # <eLabel name="Background" position="0,0" size="1920,1080" zPosition="-5" backgroundColor="#ff000000" />
      253. # <eLabel name="Background_ticker" position="{screen.position}" size="{screen.position2}" zPosition="-4" backgroundColor="background" />
      254. raw_skin = """
      255. <screen name="sport1TickerRe" position="{screen.position}" size="{screen.position2}" transparent="0" flags="wfNoBorder" >
      256. <widget name="ticker_matches" position="0,0" size="{screen.position3}" zPosition="-5" transparent="0" scrollbarMode="showNever" backgroundColor="background" />
      257. <widget name="ticker_msg" position="{screen.position4}" size="{screen.position5}" halign="left" valign="center" font="Regular;19" transparent="0" foregroundColor="%s" backgroundColor="background" />
      258. </screen>""" % config.plugins.sport1ticker.live_farbe.value
      259. def __init__(self, session):
      260. self.session = session
      261. # init screen
      262. tickerpos_x = config.plugins.sport1ticker.tickerpos_x.value
      263. tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
      264. self.windows_width = getDesktop(0).size().width()
      265. if str(self.windows_width) == "1920":
      266. self.isFULLHD = True
      267. else:
      268. self.isFULLHD = False
      269. print "HD:", self.isFULLHD, self.windows_width
      270. global tickerpos_x
      271. global tickerpos_y
      272. if config.plugins.sport1ticker.ansicht.value == "nebeneinander":
      273. if self.isFULLHD:
      274. tickerpos_x = 20
      275. tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
      276. screen_size_x = 1880
      277. screen_size_y = 105
      278. table_size_x = 1880
      279. table_size_y = 105
      280. msg_pos_x = tickerpos_x
      281. msg_pos_y = tickerpos_y + 105
      282. msg_size_x = 1880
      283. msg_size_y = 40
      284. else:
      285. tickerpos_x = 20
      286. tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
      287. screen_size_x = 1240
      288. screen_size_y = 70
      289. table_size_x = 1240
      290. table_size_y = 60
      291. msg_pos_x = tickerpos_x
      292. msg_pos_y = tickerpos_y + 60
      293. msg_size_x = 1200
      294. msg_size_y = 20
      295. elif config.plugins.sport1ticker.ansicht.value == "icons":
      296. if self.isFULLHD:
      297. tickerpos_x = 0
      298. tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
      299. screen_size_x = 1920
      300. screen_size_y = 70
      301. table_size_x = 1920
      302. table_size_y = 70
      303. msg_pos_x = tickerpos_x
      304. msg_pos_y = tickerpos_y + 70
      305. msg_size_x = 1920
      306. msg_size_y = 20
      307. else:
      308. tickerpos_x = 10
      309. tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
      310. screen_size_x = 1260
      311. screen_size_y = 140
      312. table_size_x = 1260
      313. table_size_y = 140
      314. msg_pos_x = tickerpos_x
      315. msg_pos_y = tickerpos_y + 130
      316. msg_size_x = 1200
      317. msg_size_y = 20
      318. elif config.plugins.sport1ticker.ansicht.value == "icons_info":
      319. if self.isFULLHD:
      320. tickerpos_x = 10
      321. tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
      322. screen_size_x = 1980
      323. screen_size_y = 170
      324. table_size_x = 1980
      325. table_size_y = 170
      326. msg_pos_x = tickerpos_x
      327. msg_pos_y = tickerpos_y + 180
      328. msg_size_x = 1980
      329. msg_size_y = 20
      330. else:
      331. tickerpos_x = 10
      332. tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
      333. screen_size_x = 1260
      334. screen_size_y = 170
      335. table_size_x = 1260
      336. table_size_y = 170
      337. msg_pos_x = tickerpos_x
      338. msg_pos_y = tickerpos_y + 180
      339. msg_size_x = 1200
      340. msg_size_y = 20
      341. else:
      342. if self.isFULLHD:
      343. tickerpos_x = 10
      344. tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
      345. screen_size_x = 700
      346. screen_size_y = 320
      347. table_size_x = 700
      348. table_size_y = 320
      349. msg_pos_x = tickerpos_x
      350. msg_pos_y = tickerpos_y + 320
      351. msg_size_x = 700
      352. msg_size_y = 40
      353. else:
      354. tickerpos_x = 10
      355. tickerpos_y = config.plugins.sport1ticker.tickerpos_y.value
      356. screen_size_x = 480
      357. screen_size_y = 180
      358. table_size_x = 480
      359. table_size_y = 250
      360. msg_pos_x = tickerpos_x
      361. msg_pos_y = tickerpos_y + 180
      362. msg_size_x = 480
      363. msg_size_y = 20
      364. 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),}
      365. self.skin = applySkinVars(sport1TickerRe.raw_skin,self.dict)
      366. Screen.__init__(self, session)
      367. self["actions"] = ActionMap(["ColorActions","OkCancelActions","DirectionActions","HelpActions","MovieSelectionActions","InputActions","InfobarActions","InfobarTeletextActions","ChannelSelectBaseActions"],
      368. {
      369. "ok": self.ok,
      370. "cancel": self.exit,
      371. "showMovies": self.loadPage,
      372. "contextMenu": self.configScreen,
      373. "showEventInfo": self.tabelle,
      374. "up": self.up,
      375. "down": self.down,
      376. "green": self.subkanal,
      377. "blue": self.extension,
      378. "nextBouquet": moveSkinDown,
      379. "prevBouquet": moveSkinUp,
      380. "0": self.history,
      381. "right": self.zapUp,
      382. "left": self.zapDown
      383. }, -1)
      384. self["ticker_msg"] = Label("")
      385. #self["ticker_msg"].setText("Zur Zeit keine infos vorhanden.")
      386. self["ticker_matches"] = tickerlist([])
      387. # ticker interval
      388. self.update_interval = int(config.plugins.sport1ticker.refreshtimer.value) * 1000
      389. self.hideTimer_interval = int(config.plugins.sport1ticker.hideTimer.value) * 1000
      390. # tricky
      391. self.reloadgui = False
      392. self.firststart = True
      393. self.show_tor = False
      394. self.gameday = ""
      395. self.current_season_id = ""
      396. self.current_round_id = ""
      397. # hide ticker timer
      398. if config.plugins.sport1ticker.hideTimerOnOff.value:
      399. self.hideTimer = eTimer()
      400. if isDreamOS:
      401. self.hideTimer_conn1 = self.hideTimer.timeout.connect(self.hideTicker)
      402. else:
      403. self.hideTimer.callback.append(self.hideTicker)
      404. self.hideTimer.start(self.hideTimer_interval)
      405. self.reloadgui = True
      406. # autoload loadPage
      407. self.updateTimer = eTimer()
      408. if isDreamOS:
      409. self.updateTimer_conn1 = self.updateTimer.timeout.connect(self.loadPage)
      410. else:
      411. self.updateTimer.callback.append(self.loadPage)
      412. # init farben
      413. self.tor_farbe = long(config.plugins.sport1ticker.farbe.value, 16)
      414. self.tor_farbe_neu = long(config.plugins.sport1ticker.farbe_neu.value, 16)
      415. self.live_spiel = long(config.plugins.sport1ticker.live_spiel.value, 16)
      416. # init game tables
      417. self.games_data = []
      418. self.games_data_old = []
      419. # select liga from config
      420. self.select_liga = config.plugins.sport1ticker.select_liga.value
      421. # zeige datum im ticker
      422. self.hideDateOnOff = config.plugins.sport1ticker.hideDateOnOff.value
      423. # get infos
      424. self.onLayoutFinish.append(self.loadPage)
      425. self.onClose.append(self.__onClose)
      426. def subkanal(self):
      427. if InfoBar and InfoBar.instance:
      428. InfoBar.subserviceSelection(InfoBar.instance)
      429. def history(self):
      430. if InfoBar and InfoBar.instance:
      431. InfoBar.historyNext(InfoBar.instance)
      432. def extension(self):
      433. if InfoBar and InfoBar.instance:
      434. InfoBar.showExtensionSelection(InfoBar.instance)
      435. def zapDown(self):
      436. if InfoBar and InfoBar.instance:
      437. InfoBar.zapDown(InfoBar.instance)
      438. def zapUp(self):
      439. if InfoBar and InfoBar.instance:
      440. InfoBar.zapUp(InfoBar.instance)
      441. def moveSkinUp(self):
      442. if not self.shown:
      443. self.show()
      444. global tickerpos_y
      445. tickerpos_y += 5
      446. print tickerpos_y
      447. config.plugins.sport1ticker.tickerpos_y.value = tickerpos_y
      448. config.plugins.sport1ticker.tickerpos_y.save()
      449. self.instance.move(ePoint(tickerpos_x, tickerpos_y))
      450. def moveSkinDown(self):
      451. if not self.shown:
      452. self.show()
      453. global tickerpos_y
      454. tickerpos_y -= 5
      455. print tickerpos_y
      456. config.plugins.sport1ticker.tickerpos_y.value = tickerpos_y
      457. config.plugins.sport1ticker.tickerpos_y.save()
      458. self.instance.move(ePoint(tickerpos_x, tickerpos_y))
      459. def hideTicker(self):
      460. if self.shown:
      461. print "[Sport1]: hide ticker."
      462. if config.plugins.sport1ticker.hideTimerOnOff.value:
      463. self.hideTimer.stop()
      464. self.hide()
      465. def loadPage(self):
      466. # stop updateTmer
      467. self.updateTimer.stop()
      468. # get gameday
      469. if self.firststart:
      470. self.firststart = False
      471. #init_url = "http://ticker.sport1.de/ticker/data/fussball/"+self.select_liga+"/init.json"
      472. init_url = "http://sportsapi.sport1.de/competition/%s" % self.select_liga
      473. print init_url
      474. getPage(init_url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.get_gameday).addErrback(self.dataError)
      475. else:
      476. self.loadPageData()
      477. def loadPageData(self):
      478. # hole daten
      479. print "[Sport1]: update.."
      480. if config.plugins.sport1ticker.select_liga.value == "co19" or config.plugins.sport1ticker.select_liga.value == "co33":
      481. url = "http://sportsapi.sport1.de/matches-by-season/co19/se%s/ro%s" % (self.current_season_id, self.current_round_id)
      482. else:
      483. url = "http://sportsapi.sport1.de/matches-by-season/%s/se/md%s" % (self.select_liga, self.gameday)
      484. print url
      485. getPage(url, headers={'Content-Type':'application/x-www-form-urlencoded'}).addCallback(self.loadData).addErrback(self.dataError)
      486. def dataError(self, error):
      487. print error
      488. def get_gameday(self, data):
      489. check_gameday = re.findall('"current_matchday":"(.*?)"', data, re.S)
      490. current_round_id = re.findall('"current_round_id":"(.*?)"', data, re.S)
      491. current_season_id = re.findall('"current_season_id":"(.*?)"', data, re.S)
      492. if current_round_id:
      493. self.current_round_id = current_round_id[0]
      494. if current_season_id:
      495. self.current_season_id = current_season_id[0]
      496. if check_gameday:
      497. print "[Sport1]: gameday %s" % check_gameday[0]
      498. self.gameday = check_gameday[0]
      499. self.loadPageData()
      500. def loadData(self, data):
      501. self.ticker_games = []
      502. 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)
      503. #matches = re.findall('"active":([false|true].*?),.*?"gameid":([0-9]*),".*?date":"(.*?)".*?"tickerUrl":"(.*?)".*?"guest":{"longname":"(.*?)","result":(.*?),".*?"home":{"longname":"(.*?)","result":(.*?),"',data, re.S)
      504. if matches:
      505. self.games_data = []
      506. if self.select_liga == "bl":
      507. bundesliga = "bundesliga"
      508. elif self.select_liga == "bl2":
      509. bundesliga = "bundesliga2"
      510. elif self.select_liga == "bl3":
      511. bundesliga = "bundesliga3"
      512. elif self.select_liga == "dp":
      513. bundesliga = "dfbpokal"
      514. elif self.select_liga == "cl":
      515. bundesliga = "championsleague"
      516. elif self.select_liga == "uc":
      517. bundesliga = "europaleague"
      518. elif self.select_liga == "wq":
      519. bundesliga = "wmquali"
      520. #for live,id,datum,url,guest,gr,home,hr in matches:
      521. # ('06.03.2015', '20:30', 'no', 'full', '', 'VfB Stuttgart', 'Hertha BSC', '0', '0')
      522. for datum,urhzeit,finished,live_status,current_period,home_id,home,guest_id,guest,hr,gr in matches:
      523. print datum,urhzeit,finished,live_status,current_period,home_id,unix_to_unicode(home),guest_id,unix_to_unicode(guest),hr,gr
      524. #m_regex = '.*?http://ticker.sport1.de/liveticker/fussball/'+bundesliga+'/sport1.de/#/.*?,'+self.gameday+',.*?/'
      525. #print m_regex
      526. #if re.match(m_regex, url, re.S):
      527. match = "%s - %s" % (home,guest)
      528. tore = "%s - %s" % (hr,gr)
      529. datum = "%s %s" % (datum,urhzeit)
      530. #if live_status == "full":
      531. #if current_period == "game-start" or current_period == "second-half-start":
      532. # live = "true"
      533. #else:
      534. # live = "false"
      535. self.games_data.append((current_period,datum,home_id,guest_id,match,tore))
      536. if self.games_data:
      537. self.show_tor = False
      538. self.ticker_games.append(self.display_matches(self.games_data))
      539. self["ticker_matches"].l.setList(self.ticker_games)
      540. if self.isFULLHD:
      541. if config.plugins.sport1ticker.ansicht.value == "untereinander" or config.plugins.sport1ticker.ansicht.value == "icons":
      542. self["ticker_matches"].l.setItemHeight(330)
      543. elif config.plugins.sport1ticker.ansicht.value == "icons_info":
      544. self["ticker_matches"].l.setItemHeight(200)
      545. else:
      546. self["ticker_matches"].l.setItemHeight(100)
      547. self["ticker_matches"].selectionEnabled(0)
      548. else:
      549. if config.plugins.sport1ticker.ansicht.value == "untereinander" or config.plugins.sport1ticker.ansicht.value == "icons":
      550. self["ticker_matches"].l.setItemHeight(180)
      551. elif config.plugins.sport1ticker.ansicht.value == "icons_info":
      552. self["ticker_matches"].l.setItemHeight(200)
      553. else:
      554. self["ticker_matches"].l.setItemHeight(60)
      555. self["ticker_matches"].selectionEnabled(0)
      556. print "[Sport1]: rename data > data_old"
      557. self.games_data_old = self.games_data
      558. # starte updateTimer
      559. self.updateTimer.start(self.update_interval)
      560. def checkin(self, check):
      561. # rebuild list games_data_old
      562. temp_list = []
      563. for each in self.games_data_old:
      564. #temp_list.append(each[1:])
      565. temp_list.append(each[4:])
      566. (c_datum,c_status,c_home_id,c_guest_id,c_match,c_tore) = check
      567. # search in games_data_old
      568. search = (c_match, c_tore)
      569. if search in temp_list:
      570. return False
      571. else:
      572. self.show_tor = True
      573. return True
      574. def display_matches(self, entry):
      575. count = 0
      576. res = [()]
      577. if config.plugins.sport1ticker.ansicht.value == "icons" or config.plugins.sport1ticker.ansicht.value == "icons_info":
      578. e_list = entry[-10:]
      579. else:
      580. e_list = entry[-9:]
      581. for check in e_list:
      582. #current_period,datum,match,home_id,guest_id,tore
      583. (current_period,datum,home_id,guest_id,match,tore) = check
      584. tor = self.checkin(check)
      585. datum_anzeige = ""
      586. # if config.plugins.sport1ticker.select_liga.value == "co19":
      587. # # zeit formatierung
      588. # (datum_raw,uhrzeit) = datum.split(' ')
      589. # (days,month,year) = datum_raw.split('.')
      590. # (std,min) = uhrzeit.split(':')
      591. #
      592. # d = datetime(int(year), month_to_int(month), int(days), int(std), int(min), 0, 0)
      593. # spielbeginn_unixzeit = d.strftime('%s')
      594. # aktuelle_unixzeit = int(time.time())
      595. # if int(spielbeginn_unixzeit) < int(aktuelle_unixzeit):
      596. # continue
      597. # else:
      598. # count += 1
      599. #else:
      600. count += 1
      601. if self.hideDateOnOff and not config.plugins.sport1ticker.ansicht.value == "icons" or config.plugins.sport1ticker.ansicht.value == "icons_info":
      602. # zeit formatierung
      603. # 01.03.2015 17:30
      604. (datum_raw,uhrzeit) = datum.split(' ')
      605. (days,month,year) = datum_raw.split('.')
      606. if uhrzeit == "unknown":
      607. std = 00
      608. min = 00
      609. else:
      610. (std,min) = uhrzeit.split(':')
      611. d = datetime(int(year), month_to_int(month), int(days), int(std), int(min), 0, 0)
      612. spielbeginn_unixzeit = d.strftime('%s')
      613. aktuelle_unixzeit = int(time.time())
      614. # check spielbeginn/aktuelle zeit
      615. if int(spielbeginn_unixzeit) > int(aktuelle_unixzeit):
      616. if config.plugins.sport1ticker.ansicht.value == "icons_info":
      617. datum_anzeige = "%s.%s. %s:%s" % (days,month_to_int(month),std,min)
      618. else:
      619. tore = "%s.%s. %s:%s" % (days,month_to_int(month),std,min)
      620. # fix umlaute - unix_to_unicode
      621. match = unix_to_unicode(match)
      622. if current_period == "game-start":
      623. status_txt = "Live h:1"
      624. status = "true"
      625. elif current_period == "second-half-start":
      626. status_txt = "Live h:2"
      627. status = "true"
      628. elif current_period == "first-half-end":
      629. status_txt = "Halbzeit"
      630. status = "false"
      631. elif current_period == "game-end":
      632. status_txt = "Spielende"
      633. status = "false"
      634. elif current_period == "":
      635. status_txt = datum_anzeige
      636. status = "false"
      637. if self.isFULLHD:
      638. if config.plugins.sport1ticker.ansicht.value == "nebeneinander":
      639. # ansicht nebeneinander
      640. if not tor and status == "false":
      641. self.farbe_tore = self.tor_farbe
      642. elif not tor and status == "true":
      643. self.farbe_tore = self.live_spiel
      644. elif tor:
      645. self.farbe_tore = self.tor_farbe_neu
      646. if int(count) == 1:
      647. res.append(MultiContentEntryText(pos=(20, 0), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      648. res.append(MultiContentEntryText(pos=(490, 0), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      649. elif int(count) == 2:
      650. res.append(MultiContentEntryText(pos=(650, 0), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      651. res.append(MultiContentEntryText(pos=(1120, 0), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      652. elif int(count) == 3:
      653. res.append(MultiContentEntryText(pos=(1300, 0), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      654. res.append(MultiContentEntryText(pos=(1760, 0), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      655. elif int(count) == 4:
      656. res.append(MultiContentEntryText(pos=(20, 35), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      657. res.append(MultiContentEntryText(pos=(490, 35), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      658. elif int(count) == 5:
      659. res.append(MultiContentEntryText(pos=(650, 35), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      660. res.append(MultiContentEntryText(pos=(1120, 35), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      661. elif int(count) == 6:
      662. res.append(MultiContentEntryText(pos=(1300, 35), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      663. res.append(MultiContentEntryText(pos=(1760, 35), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      664. elif int(count) == 7:
      665. res.append(MultiContentEntryText(pos=(20, 70), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      666. res.append(MultiContentEntryText(pos=(490, 70), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      667. elif int(count) == 8:
      668. res.append(MultiContentEntryText(pos=(650, 70), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      669. res.append(MultiContentEntryText(pos=(1120, 70), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      670. elif int(count) == 9:
      671. res.append(MultiContentEntryText(pos=(1300, 70), size=(450, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      672. res.append(MultiContentEntryText(pos=(1760, 70), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      673. elif config.plugins.sport1ticker.ansicht.value == "icons":
      674. # ansicht club icons
      675. (home, guest) = match.split(" - ")
      676. #pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
      677. #pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
      678. pic_blank = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/blank.png"
      679. pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home_id
      680. pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest_id
      681. if fileExists(pic_home):
      682. #png_home = LoadPixmap(pic_home)
      683. png_home = loadPNG(pic_home)
      684. else:
      685. #print "file EXISTIERT NICHT !!!!!"
      686. pic_download_home = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % home_id
      687. downloadPage(pic_download_home, pic_home)
      688. png_home = loadPNG(pic_blank)
      689. if fileExists(pic_guest):
      690. #png_guest = LoadPixmap(pic_guest)
      691. png_guest = loadPNG(pic_guest)
      692. else:
      693. #print "file EXISTIERT NICHT !!!!!"
      694. pic_download_guest = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % guest_id
      695. downloadPage(pic_download_guest, pic_guest)
      696. png_guest = loadPNG(pic_blank)
      697. if not tor and status == "false":
      698. self.farbe_tore = self.tor_farbe
      699. elif not tor and status == "true":
      700. self.farbe_tore = self.live_spiel
      701. elif tor:
      702. self.farbe_tore = self.tor_farbe_neu
      703. if int(count) == 1:
      704. res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 10), size=(50, 50), png = png_home))
      705. res.append(MultiContentEntryText(pos=(55, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      706. res.append(MultiContentEntryPixmapAlphaTest(pos=(140, 10), size=(50, 50), png=png_guest))
      707. elif int(count) == 2:
      708. res.append(MultiContentEntryPixmapAlphaTest(pos=(200, 10), size=(50, 50), png = png_home))
      709. res.append(MultiContentEntryText(pos=(255, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      710. res.append(MultiContentEntryPixmapAlphaTest(pos=(340, 10), size=(50, 50), png=png_guest))
      711. elif int(count) == 3:
      712. res.append(MultiContentEntryPixmapAlphaTest(pos=(400, 10), size=(50, 50), png = png_home))
      713. res.append(MultiContentEntryText(pos=(445, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      714. res.append(MultiContentEntryPixmapAlphaTest(pos=(530, 10), size=(50, 50), png=png_guest))
      715. elif int(count) == 4:
      716. res.append(MultiContentEntryPixmapAlphaTest(pos=(590, 10), size=(50, 50), png = png_home))
      717. res.append(MultiContentEntryText(pos=(635, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      718. res.append(MultiContentEntryPixmapAlphaTest(pos=(720, 10), size=(50, 50), png=png_guest))
      719. elif int(count) == 5:
      720. res.append(MultiContentEntryPixmapAlphaTest(pos=(780, 10), size=(50, 50), png = png_home))
      721. res.append(MultiContentEntryText(pos=(825, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      722. res.append(MultiContentEntryPixmapAlphaTest(pos=(910, 10), size=(50, 50), png=png_guest))
      723. elif int(count) == 6:
      724. res.append(MultiContentEntryPixmapAlphaTest(pos=(970, 10), size=(50, 50), png = png_home))
      725. res.append(MultiContentEntryText(pos=(1015, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      726. res.append(MultiContentEntryPixmapAlphaTest(pos=(1100, 10), size=(50, 50), png=png_guest))
      727. elif int(count) == 7:
      728. res.append(MultiContentEntryPixmapAlphaTest(pos=(1160, 10), size=(50, 50), png = png_home))
      729. res.append(MultiContentEntryText(pos=(1205, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      730. res.append(MultiContentEntryPixmapAlphaTest(pos=(1290, 10), size=(50, 50), png=png_guest))
      731. elif int(count) == 8:
      732. res.append(MultiContentEntryPixmapAlphaTest(pos=(1350, 10), size=(50, 50), png = png_home))
      733. res.append(MultiContentEntryText(pos=(1395, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      734. res.append(MultiContentEntryPixmapAlphaTest(pos=(1480, 10), size=(50, 50), png=png_guest))
      735. elif int(count) == 9:
      736. res.append(MultiContentEntryPixmapAlphaTest(pos=(1540, 10), size=(50, 50), png = png_home))
      737. res.append(MultiContentEntryText(pos=(1585, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      738. res.append(MultiContentEntryPixmapAlphaTest(pos=(1670, 10), size=(50, 50), png=png_guest))
      739. elif int(count) == 10:
      740. res.append(MultiContentEntryPixmapAlphaTest(pos=(1730, 10), size=(50, 50), png = png_home))
      741. res.append(MultiContentEntryText(pos=(1775, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      742. res.append(MultiContentEntryPixmapAlphaTest(pos=(1860, 10), size=(50, 50), png=png_guest))
      743. elif config.plugins.sport1ticker.ansicht.value == "icons_info":
      744. # ansicht club icons
      745. (home, guest) = match.split(" - ")
      746. #pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
      747. #pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
      748. pic_blank = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/blank.png"
      749. pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home_id
      750. pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest_id
      751. if fileExists(pic_home):
      752. #png_home = LoadPixmap(pic_home)
      753. png_home = loadPNG(pic_home)
      754. else:
      755. pic_download_home = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % home_id
      756. print "file EXISTIERT NICHT - Download Vereins-Logo: %s" % pic_download_home
      757. downloadPage(pic_download_home, pic_home)
      758. png_home = loadPNG(pic_blank)
      759. if fileExists(pic_guest):
      760. #png_guest = LoadPixmap(pic_guest)
      761. png_guest = loadPNG(pic_guest)
      762. else:
      763. pic_download_guest = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % guest_id
      764. print "file EXISTIERT NICHT - Download Vereins-Logo: %s" % pic_download_guest
      765. downloadPage(pic_download_guest, pic_guest)
      766. png_guest = loadPNG(pic_blank)
      767. if not tor and status == "false":
      768. self.farbe_tore = self.tor_farbe
      769. elif not tor and status == "true":
      770. self.farbe_tore = self.live_spiel
      771. elif tor:
      772. self.farbe_tore = self.tor_farbe_neu
      773. if int(count) == 1:
      774. res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 10), size=(50, 50), png = png_home))
      775. res.append(MultiContentEntryText(pos=(60, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      776. res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 10), size=(50, 50), png=png_guest))
      777. 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))
      778. elif int(count) == 2:
      779. res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 10), size=(50, 50), png = png_home))
      780. res.append(MultiContentEntryText(pos=(325, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      781. res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 10), size=(50, 50), png=png_guest))
      782. 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))
      783. elif int(count) == 3:
      784. res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 10), size=(50, 50), png = png_home))
      785. res.append(MultiContentEntryText(pos=(590, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      786. res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 10), size=(50, 50), png=png_guest))
      787. 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))
      788. elif int(count) == 4:
      789. res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 10), size=(50, 50), png = png_home))
      790. res.append(MultiContentEntryText(pos=(850, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      791. res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 10), size=(50, 50), png=png_guest))
      792. 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))
      793. elif int(count) == 5:
      794. res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 10), size=(50, 50), png = png_home))
      795. res.append(MultiContentEntryText(pos=(1110, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      796. res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 10), size=(50, 50), png=png_guest))
      797. 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))
      798. elif int(count) == 6:
      799. res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 90), size=(50, 50), png = png_home))
      800. res.append(MultiContentEntryText(pos=(60, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      801. res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 90), size=(50, 50), png=png_guest))
      802. 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))
      803. elif int(count) == 7:
      804. res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 90), size=(50, 50), png = png_home))
      805. res.append(MultiContentEntryText(pos=(325, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      806. res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 90), size=(50, 50), png=png_guest))
      807. 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))
      808. elif int(count) == 8:
      809. res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 90), size=(50, 50), png = png_home))
      810. res.append(MultiContentEntryText(pos=(590, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      811. res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 90), size=(50, 50), png=png_guest))
      812. 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))
      813. elif int(count) == 9:
      814. res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 90), size=(50, 50), png = png_home))
      815. res.append(MultiContentEntryText(pos=(850, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      816. res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 90), size=(50, 50), png=png_guest))
      817. 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))
      818. elif int(count) == 10:
      819. res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 90), size=(50, 50), png = png_home))
      820. res.append(MultiContentEntryText(pos=(1110, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      821. res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 90), size=(50, 50), png=png_guest))
      822. 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))
      823. else:
      824. # ansicht untereinander
      825. if not tor and status == "false":
      826. self.farbe_tore = self.tor_farbe
      827. elif not tor and status == "true":
      828. self.farbe_tore = self.live_spiel
      829. elif tor:
      830. self.farbe_tore = self.tor_farbe_neu
      831. if int(count) == 1:
      832. res.append(MultiContentEntryText(pos=(20, 0), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      833. res.append(MultiContentEntryText(pos=(530, 0), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      834. elif int(count) == 2:
      835. res.append(MultiContentEntryText(pos=(20, 35), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      836. res.append(MultiContentEntryText(pos=(530, 35), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      837. elif int(count) == 3:
      838. res.append(MultiContentEntryText(pos=(20, 70), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      839. res.append(MultiContentEntryText(pos=(530, 70), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      840. elif int(count) == 4:
      841. res.append(MultiContentEntryText(pos=(20, 105), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      842. res.append(MultiContentEntryText(pos=(530, 105), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      843. elif int(count) == 5:
      844. res.append(MultiContentEntryText(pos=(20, 140), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      845. res.append(MultiContentEntryText(pos=(530, 140), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      846. elif int(count) == 6:
      847. res.append(MultiContentEntryText(pos=(20, 175), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      848. res.append(MultiContentEntryText(pos=(530, 175), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      849. elif int(count) == 7:
      850. res.append(MultiContentEntryText(pos=(20, 210), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      851. res.append(MultiContentEntryText(pos=(530, 210), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      852. elif int(count) == 8:
      853. res.append(MultiContentEntryText(pos=(20, 245), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      854. res.append(MultiContentEntryText(pos=(530, 245), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      855. elif int(count) == 9:
      856. res.append(MultiContentEntryText(pos=(20, 280), size=(500, 35), font=3, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      857. res.append(MultiContentEntryText(pos=(530, 280), size=(150, 35), font=3, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      858. else:
      859. if config.plugins.sport1ticker.ansicht.value == "nebeneinander":
      860. # ansicht nebeneinander
      861. if not tor and status == "false":
      862. self.farbe_tore = self.tor_farbe
      863. elif not tor and status == "true":
      864. self.farbe_tore = self.live_spiel
      865. elif tor:
      866. self.farbe_tore = self.tor_farbe_neu
      867. if int(count) == 1:
      868. res.append(MultiContentEntryText(pos=(20, 0), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      869. res.append(MultiContentEntryText(pos=(320, 0), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      870. elif int(count) == 2:
      871. res.append(MultiContentEntryText(pos=(410, 0), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      872. res.append(MultiContentEntryText(pos=(720, 0), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      873. elif int(count) == 3:
      874. res.append(MultiContentEntryText(pos=(810, 0), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      875. res.append(MultiContentEntryText(pos=(1120, 0), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      876. elif int(count) == 4:
      877. res.append(MultiContentEntryText(pos=(20, 20), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      878. res.append(MultiContentEntryText(pos=(320, 20), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      879. elif int(count) == 5:
      880. res.append(MultiContentEntryText(pos=(410, 20), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      881. res.append(MultiContentEntryText(pos=(720, 20), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      882. elif int(count) == 6:
      883. res.append(MultiContentEntryText(pos=(810, 20), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      884. res.append(MultiContentEntryText(pos=(1120, 20), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      885. elif int(count) == 7:
      886. res.append(MultiContentEntryText(pos=(20, 40), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      887. res.append(MultiContentEntryText(pos=(320, 40), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      888. elif int(count) == 8:
      889. res.append(MultiContentEntryText(pos=(410, 40), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      890. res.append(MultiContentEntryText(pos=(720, 40), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      891. elif int(count) == 9:
      892. res.append(MultiContentEntryText(pos=(810, 40), size=(300, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      893. res.append(MultiContentEntryText(pos=(1120, 40), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      894. elif config.plugins.sport1ticker.ansicht.value == "icons":
      895. # ansicht club icons
      896. (home, guest) = match.split(" - ")
      897. #pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
      898. #pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
      899. pic_blank = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/blank.png"
      900. pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home_id
      901. pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest_id
      902. if fileExists(pic_home):
      903. #png_home = LoadPixmap(pic_home)
      904. png_home = loadPNG(pic_home)
      905. else:
      906. #print "file EXISTIERT NICHT !!!!!"
      907. pic_download_home = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % home_id
      908. downloadPage(pic_download_home, pic_home)
      909. png_home = loadPNG(pic_blank)
      910. if fileExists(pic_guest):
      911. #png_guest = LoadPixmap(pic_guest)
      912. png_guest = loadPNG(pic_guest)
      913. else:
      914. #print "file EXISTIERT NICHT !!!!!"
      915. pic_download_guest = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % guest_id
      916. downloadPage(pic_download_guest, pic_guest)
      917. png_guest = loadPNG(pic_blank)
      918. if not tor and status == "false":
      919. self.farbe_tore = self.tor_farbe
      920. elif not tor and status == "true":
      921. self.farbe_tore = self.live_spiel
      922. elif tor:
      923. self.farbe_tore = self.tor_farbe_neu
      924. if int(count) == 1:
      925. res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 10), size=(50, 50), png = png_home))
      926. res.append(MultiContentEntryText(pos=(60, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      927. res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 10), size=(50, 50), png=png_guest))
      928. elif int(count) == 2:
      929. res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 10), size=(50, 50), png = png_home))
      930. res.append(MultiContentEntryText(pos=(330, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      931. res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 10), size=(50, 50), png=png_guest))
      932. elif int(count) == 3:
      933. res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 10), size=(50, 50), png = png_home))
      934. res.append(MultiContentEntryText(pos=(590, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      935. res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 10), size=(50, 50), png=png_guest))
      936. elif int(count) == 4:
      937. res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 10), size=(50, 50), png = png_home))
      938. res.append(MultiContentEntryText(pos=(850, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      939. res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 10), size=(50, 50), png=png_guest))
      940. elif int(count) == 5:
      941. res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 10), size=(50, 50), png = png_home))
      942. res.append(MultiContentEntryText(pos=(1110, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      943. res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 10), size=(50, 50), png=png_guest))
      944. elif int(count) == 6:
      945. res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 80), size=(50, 50), png = png_home))
      946. res.append(MultiContentEntryText(pos=(60, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      947. res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 80), size=(50, 50), png=png_guest))
      948. elif int(count) == 7:
      949. res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 80), size=(50, 50), png = png_home))
      950. res.append(MultiContentEntryText(pos=(330, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      951. res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 80), size=(50, 50), png=png_guest))
      952. elif int(count) == 8:
      953. res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 80), size=(50, 50), png = png_home))
      954. res.append(MultiContentEntryText(pos=(590, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      955. res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 80), size=(50, 50), png=png_guest))
      956. elif int(count) == 9:
      957. res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 80), size=(50, 50), png = png_home))
      958. res.append(MultiContentEntryText(pos=(850, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      959. res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 80), size=(50, 50), png=png_guest))
      960. elif int(count) == 10:
      961. res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 80), size=(50, 50), png = png_home))
      962. res.append(MultiContentEntryText(pos=(1110, 90), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      963. res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 80), size=(50, 50), png=png_guest))
      964. elif config.plugins.sport1ticker.ansicht.value == "icons_info":
      965. # ansicht club icons
      966. (home, guest) = match.split(" - ")
      967. #pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
      968. #pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest.lower().replace(' ','_').replace('ü','ue').replace('ö','oe').replace('Ã','ss')
      969. pic_blank = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/blank.png"
      970. pic_home = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % home_id
      971. pic_guest = "/usr/lib/enigma2/python/Plugins/Extensions/Sport1ticker/images/%s.png" % guest_id
      972. if fileExists(pic_home):
      973. #png_home = LoadPixmap(pic_home)
      974. png_home = loadPNG(pic_home)
      975. else:
      976. pic_download_home = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % home_id
      977. print "file EXISTIERT NICHT - Download Vereins-Logo: %s" % pic_download_home
      978. downloadPage(pic_download_home, pic_home)
      979. png_home = loadPNG(pic_blank)
      980. if fileExists(pic_guest):
      981. #png_guest = LoadPixmap(pic_guest)
      982. png_guest = loadPNG(pic_guest)
      983. else:
      984. pic_download_guest = "http://static.weltsport.net/gfx/emblem/common/50x50/%s.png" % guest_id
      985. print "file EXISTIERT NICHT - Download Vereins-Logo: %s" % pic_download_guest
      986. downloadPage(pic_download_guest, pic_guest)
      987. png_guest = loadPNG(pic_blank)
      988. if not tor and status == "false":
      989. self.farbe_tore = self.tor_farbe
      990. elif not tor and status == "true":
      991. self.farbe_tore = self.live_spiel
      992. elif tor:
      993. self.farbe_tore = self.tor_farbe_neu
      994. if int(count) == 1:
      995. res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 10), size=(50, 50), png = png_home))
      996. res.append(MultiContentEntryText(pos=(60, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      997. res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 10), size=(50, 50), png=png_guest))
      998. 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))
      999. elif int(count) == 2:
      1000. res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 10), size=(50, 50), png = png_home))
      1001. res.append(MultiContentEntryText(pos=(325, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      1002. res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 10), size=(50, 50), png=png_guest))
      1003. 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))
      1004. elif int(count) == 3:
      1005. res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 10), size=(50, 50), png = png_home))
      1006. res.append(MultiContentEntryText(pos=(590, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      1007. res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 10), size=(50, 50), png=png_guest))
      1008. 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))
      1009. elif int(count) == 4:
      1010. res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 10), size=(50, 50), png = png_home))
      1011. res.append(MultiContentEntryText(pos=(850, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      1012. res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 10), size=(50, 50), png=png_guest))
      1013. 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))
      1014. elif int(count) == 5:
      1015. res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 10), size=(50, 50), png = png_home))
      1016. res.append(MultiContentEntryText(pos=(1110, 20), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      1017. res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 10), size=(50, 50), png=png_guest))
      1018. 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))
      1019. elif int(count) == 6:
      1020. res.append(MultiContentEntryPixmapAlphaTest(pos=(10, 90), size=(50, 50), png = png_home))
      1021. res.append(MultiContentEntryText(pos=(60, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      1022. res.append(MultiContentEntryPixmapAlphaTest(pos=(150, 90), size=(50, 50), png=png_guest))
      1023. 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))
      1024. elif int(count) == 7:
      1025. res.append(MultiContentEntryPixmapAlphaTest(pos=(270, 90), size=(50, 50), png = png_home))
      1026. res.append(MultiContentEntryText(pos=(325, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      1027. res.append(MultiContentEntryPixmapAlphaTest(pos=(420, 90), size=(50, 50), png=png_guest))
      1028. 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))
      1029. elif int(count) == 8:
      1030. res.append(MultiContentEntryPixmapAlphaTest(pos=(540, 90), size=(50, 50), png = png_home))
      1031. res.append(MultiContentEntryText(pos=(590, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      1032. res.append(MultiContentEntryPixmapAlphaTest(pos=(680, 90), size=(50, 50), png=png_guest))
      1033. 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))
      1034. elif int(count) == 9:
      1035. res.append(MultiContentEntryPixmapAlphaTest(pos=(800, 90), size=(50, 50), png = png_home))
      1036. res.append(MultiContentEntryText(pos=(850, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      1037. res.append(MultiContentEntryPixmapAlphaTest(pos=(940, 90), size=(50, 50), png=png_guest))
      1038. 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))
      1039. elif int(count) == 10:
      1040. res.append(MultiContentEntryPixmapAlphaTest(pos=(1060, 90), size=(50, 50), png = png_home))
      1041. res.append(MultiContentEntryText(pos=(1110, 100), size=(90, 26), font=7, text=tore, color=self.farbe_tore, flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER))
      1042. res.append(MultiContentEntryPixmapAlphaTest(pos=(1200, 90), size=(50, 50), png=png_guest))
      1043. 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))
      1044. else:
      1045. # ansicht untereinander
      1046. if not tor and status == "false":
      1047. self.farbe_tore = self.tor_farbe
      1048. elif not tor and status == "true":
      1049. self.farbe_tore = self.live_spiel
      1050. elif tor:
      1051. self.farbe_tore = self.tor_farbe_neu
      1052. if int(count) == 1:
      1053. res.append(MultiContentEntryText(pos=(20, 0), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1054. res.append(MultiContentEntryText(pos=(370, 0), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1055. elif int(count) == 2:
      1056. res.append(MultiContentEntryText(pos=(20, 20), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1057. res.append(MultiContentEntryText(pos=(370, 20), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1058. elif int(count) == 3:
      1059. res.append(MultiContentEntryText(pos=(20, 40), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1060. res.append(MultiContentEntryText(pos=(370, 40), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1061. elif int(count) == 4:
      1062. res.append(MultiContentEntryText(pos=(20, 60), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1063. res.append(MultiContentEntryText(pos=(370, 60), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1064. elif int(count) == 5:
      1065. res.append(MultiContentEntryText(pos=(20, 80), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1066. res.append(MultiContentEntryText(pos=(370, 80), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1067. elif int(count) == 6:
      1068. res.append(MultiContentEntryText(pos=(20, 100), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1069. res.append(MultiContentEntryText(pos=(370, 100), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1070. elif int(count) == 7:
      1071. res.append(MultiContentEntryText(pos=(20, 120), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1072. res.append(MultiContentEntryText(pos=(370, 120), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1073. elif int(count) == 8:
      1074. res.append(MultiContentEntryText(pos=(20, 140), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1075. res.append(MultiContentEntryText(pos=(370, 140), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1076. elif int(count) == 9:
      1077. res.append(MultiContentEntryText(pos=(20, 160), size=(350, 20), font=2, text=match, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1078. res.append(MultiContentEntryText(pos=(370, 160), size=(90, 20), font=2, text=tore, color=self.farbe_tore, flags=RT_HALIGN_LEFT|RT_VALIGN_CENTER))
      1079. self.check_show()
      1080. return res
      1081. def check_show(self):
      1082. if self.show_tor:
      1083. print "[Sport1]: show ticker."
      1084. if not self.shown:
      1085. if config.plugins.sport1ticker.hideTimerOnOff.value:
      1086. self.hideTimer.start(self.hideTimer_interval)
      1087. self.show()
      1088. else:
      1089. if config.plugins.sport1ticker.hideTimerOnOff.value:
      1090. self.hideTimer.stop()
      1091. self.hideTimer.start(self.hideTimer_interval)
      1092. else:
      1093. pass
      1094. def ok(self):
      1095. if not self.shown:
      1096. print "[Sport1]: show ticker."
      1097. if config.plugins.sport1ticker.hideTimerOnOff.value:
      1098. self.hideTimer.start(self.hideTimer_interval)
      1099. self.show()
      1100. else:
      1101. print "[Sport1]: hide ticker."
      1102. if config.plugins.sport1ticker.hideTimerOnOff.value:
      1103. self.hideTimer.stop()
      1104. self.hide()
      1105. def up(self):
      1106. self.servicelist = self.session.instantiateDialog(ChannelSelection)
      1107. self.servicelist.moveUp()
      1108. self.session.execDialog(self.servicelist)
      1109. def down(self):
      1110. self.servicelist = self.session.instantiateDialog(ChannelSelection)
      1111. self.servicelist.moveDown()
      1112. self.session.execDialog(self.servicelist)
      1113. def tabelle(self):
      1114. #if self.select_liga == "bl" or self.select_liga == "bl2":
      1115. if config.plugins.sport1ticker.select_liga.value == "co19":
      1116. message = self.session.open(MessageBox, _("Keine Tabelle verfuegbar."), MessageBox.TYPE_INFO, timeout=5)
      1117. elif config.plugins.sport1ticker.select_liga.value == "co33":
      1118. message = self.session.open(MessageBox, _("Keine Tabelle verfuegbar."), MessageBox.TYPE_INFO, timeout=5)
      1119. else:
      1120. self.session.open(Sport1TabelleRe, self.select_liga, self.gameday)
      1121. #else:
      1122. # message = self.session.open(MessageBox, _("Keine Tabelle verfuegbar."), MessageBox.TYPE_INFO, timeout=5)
      1123. def configScreen(self):
      1124. self.session.openWithCallback(self.configClose, sport1SetupRe)
      1125. def configClose(self, result):
      1126. if result:
      1127. self.close(self.session, False)
      1128. def __onClose(self):
      1129. print "[Sport1]: stop timer."
      1130. self.updateTimer.stop()
      1131. if config.plugins.sport1ticker.hideTimerOnOff.value and self.reloadgui:
      1132. self.hideTimer.stop()
      1133. def exit(self):
      1134. self.close(self.session, True)
      1135. def unix_to_unicode(text):
      1136. special = {"\xc4": "Ae", "\xe4": "ae", "\xd6" : "Oe", "\xf6" : "oe", "\xdc" :"Ue", "\xfc" : "ue", "\xdf" : "ss"}
      1137. for key in special.keys():
      1138. text = text.replace(key, special[key])
      1139. return text
      1140. def month_to_int(text):
      1141. 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"}
      1142. for key in special.keys():
      1143. text = text.replace(key, special[key])
      1144. return int(text)
      1145. def main(session, **kwargs):
      1146. session.openWithCallback(check_close,sport1TickerRe)
      1147. def check_close(session, result):
      1148. if not result:
      1149. print "[Sport1]: screen reload.."
      1150. session.openWithCallback(check_close,sport1TickerRe)
      1151. def Plugins(**kwargs):
      1152. return [
      1153. PluginDescriptor(name="Sport1 Ticker", description="Sport1 Live Ticker", where = [PluginDescriptor.WHERE_EXTENSIONSMENU], fnc=main),
      1154. PluginDescriptor(name="Sport1 Ticker", description="Sport1 Live Ticker", where = [PluginDescriptor.WHERE_PLUGINMENU], fnc=main, icon="plugin.png")
      1155. ]
      Alles anzeigen
      Dateien

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Flo79 ()