def PopupWindow(elements): # Create a window instance. window = pyxbmct.AddonDialogWindow(elements[0]) # Set window width, height and grid resolution. window.setGeometry(700, 250, 2, 1) textbox = pyxbmct.TextBox(textColor='0xFFFFFFFF') window.placeControl(textbox, 0, 0,2,1) textbox.setText(elements[1] + " " + elements[2]+ " " + elements[3]) # label = pyxbmct.Label(elements[1], alignment=pyxbmct.ALIGN_LEFT) # label2 = pyxbmct.Label(elements[2], alignment=pyxbmct.ALIGN_LEFT) # label3 = pyxbmct.Label(elements[3], alignment=pyxbmct.ALIGN_LEFT) # window.placeControl(label, 0, 0, columnspan=1) # window.placeControl(label2, 1, 0, columnspan=1) # window.placeControl(label3, 2, 0, columnspan=1) # Create a button. button = pyxbmct.Button('Close') # Place the button on the window grid. window.placeControl(button, 2, 0) # Set initial focus on the button. window.setFocus(button) # Connect the button to a function. window.connect(button, window.close) # Connect a key action to a function. window.connect(pyxbmct.ACTION_NAV_BACK, window.close) # Show the created window. window.doModal() # Delete the window instance when it is no longer used. del window
def list_epg_item(pid, SESSION, pg_hash): url = 'https://zattoo.com/zapi/v2/cached/program/power_details/%s?program_ids=%s&complete=True' % ( pg_hash, pid) json_data = get_json_data(url, SESSION) program_info = json.loads(json_data)['programs'][0] channel_name = program_info['channel_name'] cid = program_info['cid'] countries = program_info['country'].replace('|', ', ') genres = ', '.join(program_info['g']) categories = ', '.join(program_info['c']) directors = ', '.join([d for d in program_info['cr']['director']]) actors = ', '.join([a for a in program_info['cr']['actor']]) desc = program_info['d'] subtitle = (program_info['et'] or '') thumb = program_info['i'] title = program_info['t'] if subtitle: title = '%s: %s' % (title, subtitle) year = program_info['year'] text = '' if desc: text += '[COLOR blue]Plot:[/COLOR] %s\n\n' % desc if categories: text += '[COLOR blue]Kategorien:[/COLOR] %s' % categories if genres: text += '\n[COLOR blue]Genre:[/COLOR] %s' % genres if countries: text += '\n[COLOR blue]Produktionsland:[/COLOR] %s' % countries if directors: text += '\n[COLOR blue]Direktoren:[/COLOR] %s' % directors if actors: text += '\n[COLOR blue]Schauspieler:[/COLOR] %s' % actors if text: title = '[B][COLOR blue]%s[/COLOR][/B] %s' % (channel_name, title) if year: title = '%s (%i)' % (title, year) window = pyxbmct.AddonDialogWindow(title) window.connect(pyxbmct.ACTION_NAV_BACK, window.close) window.setGeometry(1000, 700, 1, 1) box = pyxbmct.TextBox() window.placeControl(box, 0, 0) box.setText(text) window.doModal() del window
def __init__(self, title, width=800, height=500, saveCallback=None, hideTabs=False, showButtons=True): self.title = title self.width = width self.height = height self.saveCallback = saveCallback self.hideTabs = hideTabs self.window = pyxbmct.AddonDialogWindow(title) self.window.setGeometry(width, height, 14, 10) if showButtons: self.createButtons() else: self.buttonRow = None self.tabs = [] self.onSaveCallbacks = [] self.currentPage = None
net = net.Net() addon_id = 'plugin.video.pldfreetotal' selfAddon = xbmcaddon.Addon(id=addon_id) skintheme=selfAddon.getSetting('skin') artpath='/resources/'+skintheme icon = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id, 'ico.png')) fanart = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id, 'fanart.jpg')) button_quit= xbmc.translatePath(os.path.join('special://home/addons/' + addon_id + artpath, 'power.png')) button_quit_focus= xbmc.translatePath(os.path.join('special://home/addons/' + addon_id + artpath, 'power_focus.png')) button_focus = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id + artpath, 'button_focus2.png')) button_no_focus = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id + artpath, 'button_no_focus2.png')) button_focus1 = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id + artpath, 'button_focus1.png')) button_no_focus1 = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id + artpath, 'button_no_focus1.png')) bg = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id + artpath, 'main-bg2.png')) logos = os.path.join('logos') window = pyxbmct.AddonDialogWindow('') window.setGeometry(1240, 650, 100, 50) background=pyxbmct.Image(bg) window.placeControl(background, -5, 0, 125, 51) addon = Addon(addon_id, sys.argv) mode = addon.queries.get('mode', '') def START(): global Entertainment global Movies global Music global News global Sport global Docs global Kids global Food
state = 1 else: state = 0 socketdata = [housecode, switch, state] socketdatas.append(socketdata) socketdict = dict(zip(socketnames, socketdatas)) return socketdict urlwebinterface = ip + path sockets = scrapeWebinterface(urlwebinterface) numofsockets = len(sockets.keys()) # Create a window instance. window = pyxbmct.AddonDialogWindow(plugin) height = 100 + numofsockets * 50 rows = 1 + numofsockets # Set the window width, height and the grid resolution: 5 rows, 3 columns. window.setGeometry(400, height, rows, 3) clickcount = 1 def moveup(): global clickcount global count global position if clickcount <= count: position = count - clickcount