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


Python reader.DocumentReader类代码示例

本文整理汇总了Python中suds.reader.DocumentReader的典型用法代码示例。如果您正苦于以下问题:Python DocumentReader类的具体用法?Python DocumentReader怎么用?Python DocumentReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: __download

 def __download(self, url, loaded_schemata, options):
     """Download the schema."""
     try:
         reader = DocumentReader(options)
         d = reader.open(url)
         root = d.root()
         root.set("url", url)
         return self.schema.instance(root, url, loaded_schemata, options)
     except TransportError:
         msg = "import schema (%s) at (%s), failed" % (self.ns[1], url)
         log.error("%s, %s", self.id, msg, exc_info=True)
         raise Exception(msg)
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:12,代码来源:sxbasic.py

示例2: download

    def download(self, options):
        """ download the schema """
        try:
            reader = DocumentReader(options)
            d = yield reader.open(self.url)
            root = d.root()
            root.set('url', self.url)

            schema = yield self.build_schema(root, options)
            defer.returnValue(schema)
        except TransportError:
            msg = 'imported schema (%s) at (%s), failed' % (self.ns[1], self.url)
            log.error('%s, %s', self.id, msg, exc_info=True)
            raise Exception(msg)
开发者ID:abierbaum,项目名称:twisted-suds,代码行数:14,代码来源:sxbasic.py

示例3: download

 def download(self, options):
     """ download the schema """
     url = self.location
     try:
         if "://" not in url:
             url = urljoin(self.schema.baseurl, url)
         reader = DocumentReader(options)
         d = reader.open(url)
         root = d.root()
         root.set("url", url)
         return self.schema.instance(root, url, options)
     except TransportError:
         msg = "imported schema (%s) at (%s), failed" % (self.ns[1], url)
         log.error("%s, %s", self.id, msg, exc_info=True)
         raise Exception(msg)
开发者ID:JasonSupena,项目名称:suds,代码行数:15,代码来源:sxbasic.py

示例4: download

 def download(self, options):
     """ download the schema """
     url = self.location
     try:
         if '://' not in url:
             url = urljoin(self.schema.baseurl, url)
         reader = DocumentReader(options)
         d = reader.open(url)
         root = d.root()
         root.set('url', url)
         self.__applytns(root)
         return self.schema.instance(root, url, options)
     except TransportError:
         msg = 'include schema at (%s), failed' % url
         log.error('%s, %s', self.id, msg, exc_info=True)
         raise Exception(msg)
开发者ID:mosquito,项目名称:suds,代码行数:16,代码来源:sxbasic.py

示例5: __init__

 def __init__(self, url, options, already_imported=None):
     """
     @param url: A URL to the WSDL.
     @type url: str
     @param options: An options dictionary.
     @type options: L{options.Options}
     @param already_imported: The list of urls of already imported wsdls
     @type already_imported: list of strings
     """
     log.debug('reading wsdl at: %s ...', url)
     if not already_imported:
         top_level = True
         already_imported = [url]
     else:
         top_level = False
     reader = DocumentReader(options)
     d = reader.open(url)
     root = d.root()
     WObject.__init__(self, root)
     self.id = objid(self)
     self.options = options
     self.url = url
     self.tns = self.mktns(root)
     self.types = []
     self.schema = None
     self.children = []
     self.imports = []
     self.messages = {}
     self.port_types = {}
     self.bindings = {}
     self.services = []
     self.add_children(self.root)
     pmd = self.__metadata__.__print__
     pmd.excludes.append('children')
     pmd.excludes.append('wsdl')
     pmd.wrappers['schema'] = repr
     self.open_imports(already_imported)
     if not top_level:
         return
     self.children.sort()
     self.resolve()
     self.build_schema()
     self.set_wrapped()
     for s in self.services:
         self.add_methods(s)
     log.debug("wsdl at '%s' loaded:\n%s", url, self)
开发者ID:Polyconseil,项目名称:suds,代码行数:46,代码来源:wsdl.py

示例6: build

 def build(self):
     log.debug('reading wsdl at: %s ...', self.url)
     reader = DocumentReader(self.options)
     d = yield reader.open(self.url)
     root = d.root()
     WObject.__init__(self, root)
     self.root = root
     self.tns = self.mktns(root)
     self.add_children(self.root)
     self.children.sort()
     yield self.open_imports()
     self.resolve()
     yield self.build_schema()
     self.set_wrapped()
     for s in self.services:
         self.add_methods(s)
     log.debug("wsdl at '%s' loaded:\n%s", self.url, self)
开发者ID:abierbaum,项目名称:twisted-suds,代码行数:17,代码来源:wsdl.py

示例7: __init__

    def __init__(self, url, options):
        """
        @param url: A URL to the WSDL.
        @type url: str
        @param options: An options dictionary.
        @type options: L{options.Options}
        """
        log.debug('reading wsdl at: %s ...', url)
        reader = DocumentReader(options)
        d = reader.open(url)
        root = d.root()
        WObject.__init__(self, root)
        self.id = objid(self)
        self.options = options
        self.url = url
        self.tns = self.mktns(root)
        self.types = []
        self.schema = None
        self.children = []
        self.imports = []
        self.messages = {}
        self.port_types = {}
        self.bindings = {}
        self.services = []
        self.add_children(self.root)
        self.children.sort()
        pmd = self.__metadata__.__print__
        pmd.excludes.append('children')
        pmd.excludes.append('wsdl')
        pmd.wrappers['schema'] = repr
        self.open_imports()
        self.resolve()
        self.build_schema()
        self.set_wrapped()
        for s in self.services:
            self.add_methods(s)
        log.debug("wsdl at '%s' loaded:\n%s", url, self)

        # Reset schema recursion
        Schema.PROCESSED_IMPORT_DEPTH = {}
        Schema.PROCESSED_IMPORTS_CACHE = {}
开发者ID:SUNET,项目名称:python-suds,代码行数:41,代码来源:wsdl.py

示例8: __init__

    def __init__(self, url, options, imported_definitions=None):
        """
        @param url: A URL to the WSDL.
        @type url: str
        @param options: An options dictionary.
        @type options: L{options.Options}

        """
        log.debug("reading WSDL at: %s ...", url)
        reader = DocumentReader(options)
        d = reader.open(url)
        root = d.root()
        WObject.__init__(self, root)
        self.id = objid(self)
        self.options = options
        self.url = url
        self.tns = self.mktns(root)
        self.types = []
        self.schema = None
        self.children = []
        self.imports = []
        self.messages = {}
        self.port_types = {}
        self.bindings = {}
        self.services = []
        self.add_children(self.root)
        self.children.sort()
        pmd = self.__metadata__.__print__
        pmd.excludes.append("children")
        pmd.excludes.append("wsdl")
        pmd.wrappers["schema"] = repr
        if imported_definitions is None:
            imported_definitions = {}
        imported_definitions[url] = self
        self.open_imports(imported_definitions)
        self.resolve()
        self.build_schema()
        self.set_wrapped()
        for s in self.services:
            self.add_methods(s)
        log.debug("WSDL at '%s' loaded:\n%s", url, self)
开发者ID:IvarsKarpics,项目名称:edna-mx,代码行数:41,代码来源:wsdl.py


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