当前位置: 首页>>代码示例>>Python>>正文


Python ProxyServer.error方法代码示例

本文整理汇总了Python中proxy_server.ProxyServer.error方法的典型用法代码示例。如果您正苦于以下问题:Python ProxyServer.error方法的具体用法?Python ProxyServer.error怎么用?Python ProxyServer.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在proxy_server.ProxyServer的用法示例。


在下文中一共展示了ProxyServer.error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: authenticate_user

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [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))
开发者ID:fspaolo,项目名称:code,代码行数:27,代码来源:user_storage.py

示例2: set_assignment

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def set_assignment(self, user_name, role_names):
        """Save the roles assigned to a user."""

        try:
            ProxyServer.set_assignment(user_name, role_names, ProxyServer.key)
        except Exception, e:
            raise PolicyStorageError(ProxyServer.error(e))
开发者ID:archcidburnziso,项目名称:apptools,代码行数:9,代码来源:policy_storage.py

示例3: is_empty

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def is_empty(self):
        """See if the database is empty."""

        try:
            return ProxyServer.is_empty_policy()
        except Exception, e:
            raise PolicyStorageError(ProxyServer.error(e))
开发者ID:archcidburnziso,项目名称:apptools,代码行数:9,代码来源:policy_storage.py

示例4: get_assignment

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def get_assignment(self, user_name):
        """Return the details of the assignment for the given user name."""

        try:
            return ProxyServer.get_assignment(user_name, ProxyServer.key)
        except Exception, e:
            raise PolicyStorageError(ProxyServer.error(e))
开发者ID:archcidburnziso,项目名称:apptools,代码行数:9,代码来源:policy_storage.py

示例5: delete_user

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def delete_user(self, name):
        """Delete a new user."""

        try:
            ProxyServer.delete_user(name, ProxyServer.key)
        except Exception, e:
            raise UserStorageError(ProxyServer.error(e))
开发者ID:fspaolo,项目名称:code,代码行数:9,代码来源:user_storage.py

示例6: delete_role

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def delete_role(self, name):
        """Delete a role."""

        try:
            ProxyServer.delete_role(name, ProxyServer.key)
        except Exception, e:
            raise PolicyStorageError(ProxyServer.error(e))
开发者ID:archcidburnziso,项目名称:apptools,代码行数:9,代码来源:policy_storage.py

示例7: all_roles

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def all_roles(self):
        """Return a list of all roles."""

        try:
            return ProxyServer.all_roles(ProxyServer.key)
        except Exception, e:
            raise PolicyStorageError(ProxyServer.error(e))
开发者ID:archcidburnziso,项目名称:apptools,代码行数:9,代码来源:policy_storage.py

示例8: add_role

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def add_role(self, name, description, perm_ids):
        """Add a new role."""

        try:
            ProxyServer.add_role(name, description, perm_ids, ProxyServer.key)
        except Exception, e:
            raise PolicyStorageError(ProxyServer.error(e))
开发者ID:archcidburnziso,项目名称:apptools,代码行数:9,代码来源:policy_storage.py

示例9: add_user

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def add_user(self, name, description, password):
        """Add a new user."""

        try:
            ProxyServer.add_user(name, description, password, ProxyServer.key)
        except Exception, e:
            raise UserStorageError(ProxyServer.error(e))
开发者ID:fspaolo,项目名称:code,代码行数:9,代码来源:user_storage.py

示例10: modify_role

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def modify_role(self, name, description, perm_ids):
        """Update the description and permissions for the given role."""

        try:
            ProxyServer.modify_role(name, description, perm_ids, ProxyServer.key)
        except Exception, e:
            raise PolicyStorageError(ProxyServer.error(e))
开发者ID:pombredanne,项目名称:apptools,代码行数:9,代码来源:policy_storage.py

示例11: modify_user

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def modify_user(self, name, description, password):
        """Update the description and password for the given user."""

        try:
            ProxyServer.modify_user(name, description, password,
                    ProxyServer.key)
        except Exception, e:
            raise UserStorageError(ProxyServer.error(e))
开发者ID:fspaolo,项目名称:code,代码行数:10,代码来源:user_storage.py

示例12: matching_roles

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def matching_roles(self, name):
        """Return the full name, description and permissions of all the roles
        that match the given name."""

        try:
            return ProxyServer.matching_roles(name, ProxyServer.key)
        except Exception, e:
            raise PolicyStorageError(ProxyServer.error(e))
开发者ID:archcidburnziso,项目名称:apptools,代码行数:10,代码来源:policy_storage.py

示例13: matching_users

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def matching_users(self, name):
        """Return the full name and description of all the users that match the
        given name."""

        try:
            return ProxyServer.matching_users(name, ProxyServer.key)
        except Exception, e:
            raise UserStorageError(ProxyServer.error(e))
开发者ID:fspaolo,项目名称:code,代码行数:10,代码来源:user_storage.py

示例14: unauthenticate_user

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def unauthenticate_user(self, user):
        """Unauthenticate the given user."""

        if ProxyServer.key is None:
            ok = True
        else:
            try:
                ok = ProxyServer.unauthenticate_user(ProxyServer.key)
            except Exception, e:
                raise UserStorageError(ProxyServer.error(e))
开发者ID:fspaolo,项目名称:code,代码行数:12,代码来源:user_storage.py

示例15: update_password

# 需要导入模块: from proxy_server import ProxyServer [as 别名]
# 或者: from proxy_server.ProxyServer import error [as 别名]
    def update_password(self, name, password):
        """Update the password for the given user."""

        # If the remote server disappeared after the capabilities were read but
        # before the user was authenticated then we could get here.
        if ProxyServer.key is None:
            raise UserStorageError("It is not possible to change password "
                    "when disconnected from the permissions server.")

        try:
            ProxyServer.update_password(name, password, ProxyServer.key)
        except Exception, e:
            raise UserStorageError(ProxyServer.error(e))
开发者ID:fspaolo,项目名称:code,代码行数:15,代码来源:user_storage.py


注:本文中的proxy_server.ProxyServer.error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。