vpnapi.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:script.tvguide.fullscreen 作者: primaeval 项目源码 文件源码
def connectToValidated(self, connection, wait):
        # Given the number of a validated connection, connect to it.  Return True when the connection has happened 
        # or False if there's a problem connecting (or there's not a VPN connection available for this connection 
        # number).  Return True without messing with the connection if the current VPN is the same as the VPN being
        # requested.  The wait parameter will determine if the function returns once the connection has been made, 
        # or if it's fire and forget (in which case True will be returned regardless)
        if not self.isVPNSetUp(): return False
        if connection < 1 or connection > 10: return False
        connection = connection - 1
        self.refreshLists()
        if self.primary_vpns[connection] == "": return False
        if self.getConnected() == self.primary_vpns[connection]: return True
        xbmc.log(msg="VPN Mgr API : Connecting to " + self.primary_vpns[connection], level=xbmc.LOGDEBUG)
        self.setAPICommand(self.primary_vpns[connection])
        if wait: return self.waitForConnection(self.primary_vpns[connection])
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号