def Main(): import message message.check() utils.checkVersion() CheckPlugin() vpn.CheckUsername() if not vpn.validToRun(): utils.log('Login Error') return # utils.checkOS() addDir('-- Configure %s' % TITLE, _SETTINGS, isFolder=False) current = xbmcgui.Window(10000).getProperty('VPNICITY_LABEL') if len(current) > 0: abrv = xbmcgui.Window(10000).getProperty('VPNICITY_ABRV') thumbnail = utils.DISABLE #'os.path.join(IMAGES, abrv.lower()+'.png') addDir('-- Disable %s %s' % (current, TITLE), _KILL, thumbnail=thumbnail, isFolder=False) mode = _COUNTRY isFolder = True if ADDON.getSetting('AUTO') == 'true': mode = _VPN isFolder = False countries = vpn.GetCountries() CreateFile('-Remove-') for country in countries: label = country[0] menu = [] menu.append((ENABLEAUTO % label, 'XBMC.RunPlugin(%s?mode=%d&abrv=%s)' % (sys.argv[0], _AUTO, urllib.quote_plus(country[2])))) thumbnail = os.path.join(IMAGES, country[2].lower() + '.png') addDir(label, mode, abrv=country[1], thumbnail=thumbnail, isFolder=isFolder, menu=menu) try: CreateFile(country[0], country[1]) except: pass
def _handle_client_tcp(self, saved_conn): conn, addr = saved_conn['conn'], saved_conn['addr'] nick = addr while True: data = conn.recv(config.BUF_SIZE) if not data: # client disconnected print('TCP: Client {} disconnected'.format(addr)) self.conlock.acquire() self.connections.remove(saved_conn) self.conlock.release() return data = str(data, 'utf-8') if message.check(message.CHANGE_NICK, data): nick = message.extract(data) else: self.conlock.acquire() msg = '{}: {}'.format(nick, data).encode('utf-8') for c in self.connections: if c['addr'] != addr: c['conn'].sendall(msg) self.conlock.release()
def run(self): while True: msg, addr = self.udp_serv_socket.recvfrom(config.UDP_BUF_SIZE) if msg == self.magic: break msg = str(msg, 'utf-8') if message.check(message.CHANGE_NICK, msg): print('UDP: changenick ', addr) nick = message.extract(msg) self.conlock.acquire() self.connections[addr] = nick self.conlock.release() else: self.conlock.acquire() nick = self.connections[addr] for toaddr, _ in self.connections.items(): if addr != toaddr: self.udp_serv_socket.sendto( '{}:'.format(nick).encode('utf-8'), toaddr) self.udp_serv_socket.sendto(msg.encode('utf-8'), toaddr) self.conlock.release()
def main(doLogin=True): dixie.CheckUsername() import message message.check() CheckChanXML() CheckSkin() CheckLogos() dixie.ShowBusy() import buggalo import gui buggalo.GMAIL_RECIPIENT = '*****@*****.**' try: if not dixie.validToRun(): dixie.notify('Failed to obtain a response from On-Tapp.TV') return CheckVersion() CheckSkinVersion() CheckLogoVersion() CheckIniVersion() CheckFilmOn() CheckForUpdate() CheckForChannels() dixie.log('****** OnTapp.TV - All OK *******') dixie.CloseBusy() xbmcgui.Window(10000).setProperty('OTT_RUNNING', 'True') xbmc.executebuiltin('XBMC.ActivateWindow(home)') w = gui.TVGuide() CopyKeymap() w.doModal() RemoveKeymap() del w xbmcgui.Window(10000).clearProperty('OTT_RUNNING') except Exception: buggalo.onExceptionRaised()
def Main(): import message message.check() utils.checkVersion() vpn.CheckUsername() path.getPath(utils.ADDON.getSetting('OS'), silent=True) CheckPlugin() if not vpn.validToRun(): utils.log('Login Error') return # utils.checkOS() addDir('-- Configure %s' % TITLE, _SETTINGS, isFolder=False) current = xbmcgui.Window(10000).getProperty('VPNICITY_LABEL') if len(current) > 0: abrv = xbmcgui.Window(10000).getProperty('VPNICITY_ABRV') thumbnail = utils.DISABLE #'os.path.join(IMAGES, abrv.lower()+'.png') addDir('-- Disable %s %s' % (current, TITLE), _KILL, thumbnail=thumbnail, isFolder=False) mode = _COUNTRY isFolder = True if ADDON.getSetting('AUTO') == 'true': mode = _VPN isFolder = False countries = vpn.GetCountries() CreateFile('-Remove-') for country in countries: label = country[0] menu = [] menu.append((ENABLEAUTO % label, 'XBMC.RunPlugin(%s?mode=%d&abrv=%s)' % (sys.argv[0], _AUTO, urllib.quote_plus(country[2])))) thumbnail = os.path.join(IMAGES, country[2].lower()+'.png') addDir(label, mode, abrv=country[1], thumbnail=thumbnail, isFolder=isFolder, menu=menu) try: CreateFile(country[0], country[1]) except: pass
def main(doLogin=True): import message dixie.CheckUsername() dixie.ShowBusy() CheckChanXML() import gui try: if not dixie.validToRun(): dixie.CloseBusy() dixie.notify('Failed to obtain a response from On-Tapp.TV') return CheckPlugin() CheckVersion() CheckIniVersion() CheckFilmOn() CheckForUpdate() CheckForChannels() dixie.log('****** On-Tapp.EPG - All OK *******') message.check() dixie.CloseBusy() xbmcgui.Window(10000).setProperty('OTT_RUNNING', 'True') w = gui.TVGuide() CopyKeymap() w.doModal() RemoveKeymap() del w xbmcgui.Window(10000).clearProperty('OTT_RUNNING') xbmcgui.Window(10000).clearProperty('OTT_WINDOW') except Exception: raise