def get_main_dirs(): ##CONSTANTS PARTS## MAIN_URL = XBMCUtils.getSettingFromContext(sys.argv[1], "remote_repository") BROWSE_CHANNELS = "browse_channels" ICON = XBMCUtils.getAddonFilePath('icon.png') #draw welcome menu add_dir(XBMCUtils.getString(10001), MAIN_URL, 1, ICON, '', 0) add_dir(XBMCUtils.getString(10010), BROWSE_CHANNELS, 3, '', ICON, 0) try: from window.ImageWindow import windowImage # teletext window library add_dir(name=XBMCUtils.getString(10012), url='teletext', mode=4, provider='teletext', page=0, thumbnailImage="", iconimage=ICON) except: logger.info("No PIL module installed (needs Pillow 3.4.2 or less)") pass add_dir(XBMCUtils.getString(10014), 'paidonline', 3, "", 'paidonline', 0) add_dir(XBMCUtils.getString(10015), 'programsonline', 3, "", 'programsonline', 0) try: if updater.isUpdatable(): add_dir(XBMCUtils.getString(10011), '', 0, ICON, 0) except: logger.error("Couldn't add update option: probably server is down!") pass
def getListsUrls(url,icon=XBMCUtils.getAddonFilePath('icon.png'),provider='',finalTarget=1): #logger.debug("using url: "+url) html = Downloader.getContentFromUrl(url) if url.endswith(".xml") or ('<items>' in html or '<item>' in html): #main channels, it's a list to browse drawXml(html,icon=icon,finalTarget=finalTarget,provider=provider) elif url.endswith(".xspf"): drawXspf(html,icon) else: #it's the final list channel, split drawBruteChannels(html,icon)
from providers.spliveappcom import Spliveappcom except: logger.error( "Crypto-problems detected, probably you need a better platform") pass from window.DefaultWindow import DefaultWindow #papernews window library try: from window.ImageWindow import windowImage #teletext window library except: logger.info( "No module named PIL was found in the system, hidding teletext library." ) pass icon = XBMCUtils.getAddonFilePath('icon.png') def drawFilmon(page): jsonChannels = Filmoncom.getChannelsJSON() for itemFirst in jsonChannels: if page == "0": add_dir(itemFirst["title"], "http://www.filmon.com/tv/" + itemFirst["alias"], 4, icon, "filmoncom", itemFirst["title"]) elif (page == itemFirst["title"]) and itemFirst.has_key("channels"): for item in itemFirst["channels"]: add_dir(item["title"], "http://www.filmon.com/tv/" + item["alias"], 5, item["logo"], "filmoncom", item["title"]) else:
def __init__(self, noteType='t', noteMessage='', noteImage='', L=140, T=110, W=1000, H=500, Font='font14', TxtColor='0xFF64d1ff', logo='', firstButtonText="Ok", secondButtonText="Cancel"): if len(noteImage) == 0: noteImage = DefaultWindow.DefaultNoteImage if (noteType.lower() == 'text') or (noteType.lower() == 't'): noteType = 't' elif (noteType.lower() == 'image') or (noteType.lower() == 'i'): noteType = 'i' self.noteType = noteType self.noteMessage = noteMessage self.noteImage = noteImage self.Font = Font self.TxtColor = TxtColor self.background = XBMCUtils.getAddonFilePath( 'resources/images/ContentPanel.png') self.BG = xbmcgui.ControlImage(L, T, W, H, self.background, aspectRatio=0, colorDiffuse='0xFF3030FF') if logo == '': logo = XBMCUtils.getAddonFilePath('icon.png') iLogoW = 68 iLogoH = 68 self.iLogo = xbmcgui.ControlImage((L + (W / 2)) - (iLogoW / 2), T + 10, iLogoW, iLogoH, logo, aspectRatio=0) L2 = 200 T2 = 200 W2 = 880 H2 = 340 L3 = L2 + 5 T3 = T2 + 60 W3 = W2 - 18 H3 = H2 - 5 - 60 self.ImgMessage = xbmcgui.ControlImage(L2, T2, W2, H2, self.noteImage, aspectRatio=0) self.TxtMessage = xbmcgui.ControlTextBox(L2 + 5, T2, W2 - 10, H2, font=self.Font, textColor=self.TxtColor) focus = XBMCUtils.getAddonFilePath( 'resources/images/button-focus_lightblue.png') nofocus = XBMCUtils.getAddonFilePath( 'resources/images/button-focus_grey.png') w1 = 120 h1 = 35 w2 = 160 h2 = 35 spacing1 = 20 l2 = L + W - spacing1 - w2 t2 = T + H - h2 - spacing1 l1 = L + W - spacing1 - w2 - spacing1 - w1 t1 = T + H - h1 - spacing1 self.firstButton = xbmcgui.ControlButton(l1, t1, w1, h1, firstButtonText, textColor="0xFF000000", focusedColor="0xFF000000", alignment=2, focusTexture=focus, noFocusTexture=nofocus) self.secondButton = xbmcgui.ControlButton(l2, t2, w2, h2, secondButtonText, textColor="0xFF000000", focusedColor="0xFF000000", alignment=2, focusTexture=focus, noFocusTexture=nofocus) for z in [ self.BG, self.ImgMessage, self.TxtMessage, self.iLogo, self.secondButton, self.firstButton ]: self.addControl(z) for z in [ self.BG, self.ImgMessage, self.TxtMessage, self.iLogo, self.secondButton, self.firstButton ]: z.setAnimations([('WindowOpen', 'effect=fade delay=0 time=1000 start=0 end=100'), ('WindowClose', 'effect=slide delay=0 time=1000 start=0 end=0,' + str(0 - (H + T + 10)))]) self.secondButton.controlLeft(self.firstButton) self.secondButton.controlRight(self.firstButton) self.firstButton.controlLeft(self.secondButton) self.firstButton.controlRight(self.secondButton) self.TxtMessage.setText(self.noteMessage) self.TxtMessage.autoScroll( 20000, 2500, 15000 ) #all in ms -> delay, scroll speed (less is faster), repeat time self.setFocus(self.secondButton)