當前位置: 首頁>>代碼示例>>Python>>正文


Python sax.Namespace類代碼示例

本文整理匯總了Python中suds.sax.Namespace的典型用法代碼示例。如果您正苦於以下問題:Python Namespace類的具體用法?Python Namespace怎麽用?Python Namespace使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Namespace類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: getprefixes

 def getprefixes(self):
     """
     Add prefixes foreach namespace referenced by parameter types.
     """
     namespaces = []
     for l in (self.params, self.types):
         for t, r in l:
             ns = r.namespace()
             if ns[1] is None:
                 continue
             if ns[1] in namespaces:
                 continue
             if Namespace.xs(ns) or Namespace.xsd(ns):
                 continue
             namespaces.append(ns[1])
             if t == r:
                 continue
             ns = t.namespace()
             if ns[1] is None:
                 continue
             if ns[1] in namespaces:
                 continue
             namespaces.append(ns[1])
     namespaces.sort()
     for u in namespaces:
         p = self.nextprefix()
         ns = (p, u)
         self.prefixes.append(ns)
開發者ID:EquipmentShare,項目名稱:suds-py3,代碼行數:28,代碼來源:servicedefinition.py

示例2: parsed

 def parsed(self, context):
     node = context.document
     # xsd root
     if node.name == 'schema' and Namespace.xsd(node.namespace()):
         self.examine(node)
         return
     # look deeper
     context = DocumentContext()
     for child in node:
         context.document = child
         self.parsed(context)
開發者ID:Djiit,項目名稱:suds-recursive,代碼行數:11,代碼來源:doctor.py

示例3: skip

 def skip(attr):
     """
     Get whether to skip (filter-out) the specified attribute.
     @param attr: An attribute.
     @type attr: I{Attribute}
     @return: True if should be skipped.
     @rtype: bool
     """
     ns = attr.namespace()
     skip = (
         Namespace.xmlns[1],
         'http://schemas.xmlsoap.org/soap/encoding/',
         'http://schemas.xmlsoap.org/soap/envelope/',
         'http://www.w3.org/2003/05/soap-envelope',
     )
     return ( Namespace.xs(ns) or ns[1] in skip )
開發者ID:dvska,項目名稱:suds-htj,代碼行數:16,代碼來源:attrlist.py

示例4: qualify

 def qualify(self):
     """
     Convert attribute values, that are references to other
     objects, into I{qref}.  Qualified using the default document namespace.
     Since many WSDLs are written improperly: when the document does
     not define its default namespace, the schema target namespace is used
     to qualify references.
     """
     defns = self.root.defaultNamespace()
     if Namespace.none(defns):
         defns = self.schema.tns
     for a in self.autoqualified():
         ref = getattr(self, a)
         if ref is None:
             continue
         if isqref(ref):
             continue
         qref = qualify(ref, self.root, defns)
         log.debug('%s, convert %s="%s" to %s', self.id, a, ref, qref)
         setattr(self, a, qref)
開發者ID:Djiit,項目名稱:suds-recursive,代碼行數:20,代碼來源:sxbase.py

示例5: parsed

 def parsed(self, context):
     root = context.root
     if Namespace.xsd(root.namespace()):
         self.examine(root)
     else:
         pass
開發者ID:chalkchisel,項目名稱:suds,代碼行數:6,代碼來源:doctor.py


注:本文中的suds.sax.Namespace類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。