Beispiel #1
0
def Main():
    CheckVersion()
    vpn.CheckUsername()

    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 = 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()
    for country in countries:
        thumbnail = os.path.join(IMAGES, country[2].lower() + '.png')
        addDir(country[0],
               mode,
               abrv=country[1],
               thumbnail=thumbnail,
               isFolder=isFolder)
Beispiel #2
0
def process(option, params):
    import sys
    addon = xbmcaddon.Addon(ADDONID)
    path = addon.getAddonInfo('path')
    sys.path.insert(0, path)

    import vpn
    import browser
    country = browser.getCountry('plugin.program.vpnicity', vpn.GetCountries())
    vpn.BestVPN(country)
Beispiel #3
0
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
Beispiel #4
0
def Main():
    CheckVersion()
    vpn.CheckUsername()

    addDir('-- Configure %s' % utils.TITLE, _SETTINGS, isFolder=False)

    if xbmcgui.Window(10000).getProperty('VPNICITY_RUNNING') == 'True':
        addDir('-- Disable %s' % utils.TITLE, _KILL, isFolder=False)

    countries = vpn.GetCountries()
    for country in countries:
        thumbnail = os.path.join(IMAGES, country[2].lower() + '.png')
        addDir(country[0], _COUNTRY, abrv=country[1], thumbnail=thumbnail)
Beispiel #5
0
def manual():
    import vpn
    import browser
    country = browser.getCountry(ADDONID, vpn.GetCountries())
    vpn.BestVPN(country)
Beispiel #6
0
#
#       Copyright (C) 2015
#       Sean Poyser ([email protected]) and Richard Dean ([email protected])
#
#  This Program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
#
#  This Program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with XBMC; see the file COPYING.  If not, write to
#  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#  http://www.gnu.org/copyleft/gpl.html
#

import vpn
import browser
import vpn_utils as utils

country = browser.getCountry(utils.ADDONID, vpn.GetCountries())
vpn.BestVPN(country)