• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python query.ElementQuery类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: headpart_types

 def headpart_types(self, method, input=True):
     """
     Get a list of I{parameter definitions} (pdef) defined for the specified method.
     Each I{pdef} is a tuple (I{name}, L{xsd.sxbase.SchemaObject})
     @param method: A service method.
     @type method: I{service.Method}
     @param input: Defines input/output message.
     @type input: boolean
     @return:  A list of parameter definitions
     @rtype: [I{pdef},]
     """
     result = []
     if input:
         headers = method.soap.input.headers
     else:
         headers = method.soap.output.headers
     for header in headers:
         part = header.part
         if part.element is not None:
             query = ElementQuery(part.element)
         else:
             query = TypeQuery(part.type)
         pt = query.execute(self.schema())
         if pt is None:
             raise TypeNotFound(query.ref)
         if part.type is not None:
             pt = PartElement(part.name, pt)
         if input:
             if pt.name is None:
                 result.append((part.name, pt))
             else:
                 result.append((pt.name, pt))
         else:
             result.append(pt)
     return result
开发者ID:propars,项目名称:python-suds,代码行数:35,代码来源:binding.py


示例2: bodypart_types

 def bodypart_types(method, schema, input=True):
     """
     This returns the types of a soap body.
     This is basically copied from the suds source code (suds.bindings.binding)
     """
     result = []
     if input:
         parts = method.soap.input.body.parts
     else:
         parts = method.soap.output.body.parts
     for p in parts:
         if p.element is not None:
             query = ElementQuery(p.element)
         else:
             query = TypeQuery(p.type)
         pt = query.execute(schema)
         if pt is None:
             raise TypeNotFound(query.ref)
         if p.type is not None:
             pt = TypeNotFound(p.name, pt)
         if input:
             if pt.name is None:
                 result.append((p.name, pt))
             else:
                 result.append((pt.name, pt))
         else:
             result.append(pt)
     return result
开发者ID:liboz,项目名称:suds-lxml,代码行数:28,代码来源:lxmlclient.py


示例3: marshal_exception

    def marshal_exception(self, exc, method):

        raise NotImplementedError("cannot yet handle exceptions")

        # The following code is very much unfinished and there is no
        # guaranty that it is correct or even makes sense
        # Currently it finds the fault return types (there should only
        # be one AFAICT). How to get from there and to to a fault body
        # is still open.

        from suds import TypeNotFound
        from suds.bindings.binding import PartElement
        from suds.xsd.query import TypeQuery, ElementQuery

        rtypes = []

        for f in method.unwrapped_.soap.faults:
            for p in f.parts:
                if p.element is not None:
                    query = ElementQuery(p.element)
                else:
                    query = TypeQuery(p.type)
                pt = query.execute(method.binding.output.schema())
                if pt is None:
                    raise TypeNotFound(query.ref)
                if p.type is not None:
                    pt = PartElement(p.name, pt)
                rtypes.append(pt)

        return rtypes
开发者ID:BandwidthOnDemand,项目名称:OpenNSA,代码行数:30,代码来源:sudsservice.py


示例4: dependencies

 def dependencies(self):
     deps = []
     midx = None
     if self.ref is not None:
         query = ElementQuery(self.ref)
         e = query.execute(self.schema)
         if e is None:
             log.debug(self.schema)
             raise TypeNotFound(self.ref)
         deps.append(e)
         midx = 0
     return (midx, deps)
开发者ID:chatoooo,项目名称:suds-ng,代码行数:12,代码来源:sxbasic.py


示例5: set_wrapped

 def set_wrapped(self):
     """ set (wrapped|bare) flag on messages """
     for b in list(self.bindings.values()):
         for op in list(b.operations.values()):
             for body in (op.soap.input.body, op.soap.output.body):
                 body.wrapped = False
                 if len(body.parts) != 1:
                     continue
                 for p in body.parts:
                     if p.element is None:
                         continue
                     query = ElementQuery(p.element)
                     pt = query.execute(self.schema)
                     if pt is None:
                         raise TypeNotFound(query.ref)
                     resolved = pt.resolve()
                     if resolved.builtin():
                         continue
                     body.wrapped = True
开发者ID:HenryKeiter,项目名称:suds3,代码行数:19,代码来源:wsdl.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python sxbasic.Factory类代码示例发布时间:2022-05-27
下一篇:
Python query.BlindQuery类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap