本文整理汇总了Python中spyne.model.fault.Fault.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Fault.__init__方法的具体用法?Python Fault.__init__怎么用?Python Fault.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spyne.model.fault.Fault
的用法示例。
在下文中一共展示了Fault.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self):
Fault.__init__(self,
faultcode="Documented",
faultstring="A documented fault",
faultactor='http://faultactor.example.com',
detail=etree.Element('something')
)
示例2: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self, username):
# TODO: self.transport.http.resp_code = HTTP_401
Fault.__init__(
self,
faultcode='Client.LoginUnsupported',
faultstring='Login Unsupported for non free user %r' % username)
示例3: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self, user_name):
# TODO: self.transport.http.resp_code = HTTP_401
Fault.__init__(self,
faultcode='Client.AuthenticationError',
faultstring='Invalid authentication request for %r' % user_name
)
示例4: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self, obj, custom_msg='The value %r could not be validated.'):
s = repr(obj)
if len(s) > MAX_STRING_FIELD_LENGTH:
s = s[:MAX_STRING_FIELD_LENGTH] + "(...)"
Fault.__init__(self, 'Client.ValidationError', custom_msg % s)
示例5: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self, error):
Fault.__init__(self, 'Server', "InternalError: An unknown error has occured.")
示例6: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self, faultstring):
Fault.__init__(self, 'Client.ValidationError',
'The value %r could not be validated.' % faultstring)
示例7: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self):
Fault.__init__(
self,
faultcode="ElbeNotLoggedIn",
faultstring="Not authenticated ! "
"Cant let you perform this command.")
示例8: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self, faultstring):
Fault.__init__(self, 'Client.SchemaValidationError', faultstring)
示例9: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self):
Fault.__init__(self,
faultcode="Documented",
faultstring="A documented fault",
faultactor='http://faultactor.example.com',
)
示例10: __init__
# 需要导入模块: from spyne.model.fault import Fault [as 别名]
# 或者: from spyne.model.fault.Fault import __init__ [as 别名]
def __init__(self, data=None):
Fault.__init__(self, "Client.MessagePackDecodeError", data)