本文整理汇总了Python中proxy_server.ProxyServer.authenticate_user方法的典型用法代码示例。如果您正苦于以下问题:Python ProxyServer.authenticate_user方法的具体用法?Python ProxyServer.authenticate_user怎么用?Python ProxyServer.authenticate_user使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类proxy_server.ProxyServer
的用法示例。
在下文中一共展示了ProxyServer.authenticate_user方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: authenticate_user
# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import authenticate_user [as 别名]
def authenticate_user(self, name, password):
"""Return the tuple of the user name, description, and blob if the user
was successfully authenticated."""
try:
key, name, description, blob = ProxyServer.authenticate_user(name,
password)
# We don't save the cache because we should be about to read the
# real permission ids and we do it then.
ProxyServer.cache = description, blob, []
except Exception, e:
# See if we couldn't connect to the server.
if not isinstance(e, socket.error):
raise UserStorageError(ProxyServer.error(e))
err, _ = e.args
if err != errno.ECONNREFUSED:
raise UserStorageError(ProxyServer.error(e))
try:
ok = ProxyServer.read_cache()
except Exception, e:
raise UserStorageError(str(e))