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


Python ProtocolBase.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from spyne.protocol import ProtocolBase [as 别名]
# 或者: from spyne.protocol.ProtocolBase import __init__ [as 别名]
    def __init__(self, app=None, validator=None, xml_declaration=True,
                                                    cleanup_namespaces=False):
        ProtocolBase.__init__(self, app, validator)
        self.xml_declaration = xml_declaration
        self.cleanup_namespaces = cleanup_namespaces

        self.serialization_handlers = cdict({
            AnyXml: xml_to_parent_element,
            Alias: alias_to_parent_element,
            Fault: fault_to_parent_element,
            AnyDict: dict_to_parent_element,
            EnumBase: enum_to_parent_element,
            ModelBase: base_to_parent_element,
            ByteArray: binary_to_parent_element,
            Attachment: binary_to_parent_element,
            ComplexModelBase: complex_to_parent_element,
        })

        self.deserialization_handlers = cdict({
            AnyXml: xml_from_element,
            Fault: fault_from_element,
            AnyDict: dict_from_element,
            EnumBase: enum_from_element,
            ModelBase: base_from_element,
            Unicode: unicode_from_element,
            ByteArray: binary_from_element,
            Attachment: binary_from_element,
            ComplexModelBase: complex_from_element,

            Iterable: iterable_from_element,
            Array: array_from_element,
        })

        self.log_messages = (logger.level == logging.DEBUG)
开发者ID:shaung,项目名称:spyne,代码行数:36,代码来源:_base.py

示例2: __init__

# 需要导入模块: from spyne.protocol import ProtocolBase [as 别名]
# 或者: from spyne.protocol.ProtocolBase import __init__ [as 别名]
    def __init__(self, app=None, validator=None, mime_type=None,
            ignore_uncap=False, ignore_wrappers=True, complex_as=dict,
                                                                ordered=False):
        ProtocolBase.__init__(self, app, validator, mime_type, ignore_uncap)

        self.ignore_wrappers = ignore_wrappers
        self.complex_as = complex_as
        self.ordered = ordered
        if ordered:
            raise NotImplementedError('ordered == False')

        self.stringified_types = (DateTime, Date, Time, Uuid, Duration,
                                                                AnyXml, AnyHtml)
开发者ID:dmugtasimov,项目名称:spyne,代码行数:15,代码来源:dictdoc.py

示例3: __init__

# 需要导入模块: from spyne.protocol import ProtocolBase [as 别名]
# 或者: from spyne.protocol.ProtocolBase import __init__ [as 别名]
    def __init__(
        self,
        app=None,
        validator=None,
        xml_declaration=True,
        cleanup_namespaces=True,
        encoding="UTF-8",
        pretty_print=False,
    ):
        ProtocolBase.__init__(self, app, validator)
        self.xml_declaration = xml_declaration
        self.cleanup_namespaces = cleanup_namespaces
        self.encoding = encoding
        self.pretty_print = pretty_print

        self.serialization_handlers = cdict(
            {
                AnyXml: xml_to_parent_element,
                Alias: alias_to_parent_element,
                Fault: fault_to_parent_element,
                AnyDict: dict_to_parent_element,
                AnyHtml: html_to_parent_element,
                EnumBase: enum_to_parent_element,
                ModelBase: base_to_parent_element,
                ByteArray: byte_array_to_parent_element,
                Attachment: attachment_to_parent_element,
                ComplexModelBase: complex_to_parent_element,
            }
        )

        self.deserialization_handlers = cdict(
            {
                AnyXml: xml_from_element,
                Fault: fault_from_element,
                AnyDict: dict_from_element,
                EnumBase: enum_from_element,
                ModelBase: base_from_element,
                Unicode: unicode_from_element,
                ByteArray: byte_array_from_element,
                Attachment: attachment_from_element,
                ComplexModelBase: complex_from_element,
                Alias: alias_from_element,
                Iterable: iterable_from_element,
                Array: array_from_element,
            }
        )

        self.log_messages = logger.level == logging.DEBUG
        self.parser = etree.XMLParser(remove_comments=True)
开发者ID:specialunderwear,项目名称:spyne,代码行数:51,代码来源:_base.py

示例4: __init__

# 需要导入模块: from spyne.protocol import ProtocolBase [as 别名]
# 或者: from spyne.protocol.ProtocolBase import __init__ [as 别名]
    def __init__(self, app=None, validator=None):
        """Protocol that returns the response object as a html microformat. See
        https://en.wikipedia.org/wiki/Microformats for more info.

        The simple flavour is like the XmlDocument protocol, but returns data in
        <div> or <span> tags.

        :param app: A spyne.application.Application instance.
        :param validator: The validator to use. Ignored.
        :param root_tag: The type of the root tag that encapsulates the return
            data.
        :param child_tag: The type of the tag that encapsulates the fields of
            the returned object.
        :param field_name_attr: The name of the attribute that will contain the
            field names of the complex object children.
        :param field_type_attr: The name of the attribute that will contain the
            type names of the complex object children.
        """

        ProtocolBase.__init__(self, app, validator)
开发者ID:KetothXupack,项目名称:spyne,代码行数:22,代码来源:html.py

示例5: __init__

# 需要导入模块: from spyne.protocol import ProtocolBase [as 别名]
# 或者: from spyne.protocol.ProtocolBase import __init__ [as 别名]
    def __init__(self, app=None, validator=None, skip_depth=0):
        """Protocol that returns the response object as a html microformat. See
        https://en.wikipedia.org/wiki/Microformats for more info.

        The simple flavour is like the XmlDocument protocol, but returns data in
        <div> or <span> tags.

        :param app: A spyne.application.Application instance.
        :param validator: The validator to use. Ignored.
        :param root_tag: The type of the root tag that encapsulates the return
            data.
        :param child_tag: The type of the tag that encapsulates the fields of
            the returned object.
        :param field_name_attr: The name of the attribute that will contain the
            field names of the complex object children.
        :param field_type_attr: The name of the attribute that will contain the
            type names of the complex object children.
        :param skip_depth: Number of wrapper classes to ignore. This is
            typically one of (0, 1, 2) but higher numbers may also work for your
            case.
        """

        ProtocolBase.__init__(self, app, validator, skip_depth=skip_depth)
开发者ID:drowolath,项目名称:spyne,代码行数:25,代码来源:html.py

示例6: __init__

# 需要导入模块: from spyne.protocol import ProtocolBase [as 别名]
# 或者: from spyne.protocol.ProtocolBase import __init__ [as 别名]
    def __init__(self, app=None, validator=None, xml_declaration=True,
                cleanup_namespaces=True, encoding=None, pretty_print=False,
                attribute_defaults=False,
                dtd_validation=False,
                load_dtd=False,
                no_network=True,
                ns_clean=False,
                recover=False,
                remove_blank_text=False,
                remove_pis=True,
                strip_cdata=True,
                resolve_entities=False,
                huge_tree=False,
                compact=True
            ):
        ProtocolBase.__init__(self, app, validator)
        self.xml_declaration = xml_declaration
        self.cleanup_namespaces = cleanup_namespaces
        if encoding is None:
            self.encoding = 'UTF-8'
        else:
            self.encoding = encoding

        self.pretty_print = pretty_print

        self.serialization_handlers = cdict({
            AnyXml: xml_to_parent_element,
            Alias: alias_to_parent_element,
            Fault: fault_to_parent_element,
            AnyDict: dict_to_parent_element,
            AnyHtml: html_to_parent_element,
            EnumBase: enum_to_parent_element,
            ModelBase: base_to_parent_element,
            ByteArray: byte_array_to_parent_element,
            Attachment: attachment_to_parent_element,
            XmlAttribute: xmlattribute_to_parent_element,
            ComplexModelBase: complex_to_parent_element,
        })

        self.deserialization_handlers = cdict({
            AnyXml: xml_from_element,
            Fault: fault_from_element,
            AnyDict: dict_from_element,
            EnumBase: enum_from_element,
            ModelBase: base_from_element,
            Unicode: unicode_from_element,
            ByteArray: byte_array_from_element,
            Attachment: attachment_from_element,
            ComplexModelBase: complex_from_element,

            Alias: alias_from_element,
            Iterable: iterable_from_element,
            Array: array_from_element,
        })

        self.log_messages = (logger.level == logging.DEBUG)
        self.parser_kwargs = dict(
            attribute_defaults=attribute_defaults,
            dtd_validation=dtd_validation,
            load_dtd=load_dtd,
            no_network=no_network,
            ns_clean=ns_clean,
            recover=recover,
            remove_blank_text=remove_blank_text,
            remove_comments=True,
            remove_pis=remove_pis,
            strip_cdata=strip_cdata,
            resolve_entities=resolve_entities,
            huge_tree=huge_tree,
            compact=compact,
            encoding=encoding,
        )
开发者ID:dmugtasimov,项目名称:spyne,代码行数:74,代码来源:_base.py

示例7: __init__

# 需要导入模块: from spyne.protocol import ProtocolBase [as 别名]
# 或者: from spyne.protocol.ProtocolBase import __init__ [as 别名]
    def __init__(self, app=None, validator=None, mime_type=None, tmp_dir=None,
                                                      tmp_delete_on_close=True):
        ProtocolBase.__init__(self, app, validator, mime_type)

        self.tmp_dir = tmp_dir
        self.tmp_delete_on_close = tmp_delete_on_close
开发者ID:shaung,项目名称:spyne,代码行数:8,代码来源:http.py

示例8: __init__

# 需要导入模块: from spyne.protocol import ProtocolBase [as 别名]
# 或者: from spyne.protocol.ProtocolBase import __init__ [as 别名]
    def __init__(self, app=None):
        ProtocolBase.__init__(self, app, validator=None)

        self.length = 500 # if you change this, you should re-scale the svg file
开发者ID:Bernie,项目名称:spyne,代码行数:6,代码来源:protocol.py


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