def onURL(self, evt): # all URL mouse events trigger this if evt.GetMouseEvent().GetEventType() == wx.wxEVT_LEFT_DOWN: # left button down, now we need the URL start = evt.GetURLStart() end = evt.GetURLEnd() url = self.txt_in.GetRange(start, end) if config.isWindows(): # this works very reliable subprocess.Popen(('cmd /c start %s' % url).split(), creationflags=0x08000000) else: # FIXME: is this the way to go? better make it a config option. subprocess.Popen(('/etc/alternatives/x-www-browser %s' % url).split()) else: evt.Skip()
def onURL(self, evt): # all URL mouse events trigger this if evt.GetMouseEvent().GetEventType() == wx.wxEVT_LEFT_DOWN: # left button down, now we need the URL start = evt.GetURLStart() end = evt.GetURLEnd() url = self.txt_in.GetRange(start, end) if config.isWindows(): # this works very reliable subprocess.Popen(('cmd /c start %s' % url).split(), creationflags=0x08000000) else: # FIXME: is this the way to go? better make it a config option. subprocess.Popen( ('/etc/alternatives/x-www-browser %s' % url).split()) else: evt.Skip()
def getConnector(cls, countryName='', cityName='', serverAddress='', custom=False): Logger.log( "Operating System Configured:%s custom:%s Country:%s city:%s server:%s" % (config.getOS(), custom, countryName, cityName, serverAddress)) if config.isAndroid(): Logger.log("Creating AndroidVPNConnector ...") return AndroidVPNConnector(countryName, cityName, serverAddress, custom) elif config.isLinux(): Logger.log("Creating LinuxVPNConnector ...") return LinuxVPNConnector(countryName, cityName, serverAddress, custom) elif config.isWindows(): Logger.log("Creating windowsVPNConnector ...") return WindowsVPNConnector(countryName, cityName, serverAddress, custom) elif config.isOpenElec(): Logger.log("Creating OpenElecVPNConnector ...") return OpenElecVPNConnector(countryName, cityName, serverAddress, custom) elif config.isRaspBMC(): Logger.log("Creating RaspBMCVPNConnector ...") return RaspBMCVPNConnector(countryName, cityName, serverAddress, custom) raise Exception("Platform %s not supported" % config.getOS())
def getConnector(cls, countryName = '', cityName = '', serverAddress = ''): Logger.log("Operating System Configured:%s Country:%s city:%s server:%s" % (config.getOS(),countryName, cityName, serverAddress) ) if config.isAndroid(): Logger.log("Creating AndroidVPNConnector ...") return AndroidVPNConnector(countryName, cityName, serverAddress) elif config.isLinux(): Logger.log("Creating LinuxVPNConnector ...") return LinuxVPNConnector(countryName, cityName, serverAddress) elif config.isWindows(): Logger.log("Creating windowsVPNConnector ...") return WindowsVPNConnector(countryName, cityName, serverAddress) elif config.isOpenElec(): Logger.log("Creating OpenElecVPNConnector ...") return OpenElecVPNConnector(countryName, cityName, serverAddress) elif config.isRaspBMC(): Logger.log("Creating RaspBMCVPNConnector ...") return RaspBMCVPNConnector(countryName, cityName, serverAddress) raise Exception("Platform %s not supported" % config.getOS())