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


Python Factory.create方法代碼示例

本文整理匯總了Python中suds.xsd.sxbuiltin.Factory.create方法的典型用法代碼示例。如果您正苦於以下問題:Python Factory.create方法的具體用法?Python Factory.create怎麽用?Python Factory.create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在suds.xsd.sxbuiltin.Factory的用法示例。


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

示例1: execute

# 需要導入模塊: from suds.xsd.sxbuiltin import Factory [as 別名]
# 或者: from suds.xsd.sxbuiltin.Factory import create [as 別名]
 def execute(self, schema):
     """
     Execute this query using the specified schema.
     @param schema: The schema associated with the query.  The schema
         is used by the query to search for items.
     @type schema: L{schema.Schema}
     @return: The item matching the search criteria.
     @rtype: L{sxbase.SchemaObject}
     """
     if schema.builtin(self.ref):
         name = self.ref[0]
         b = Factory.create(schema, name)
         log.debug('%s, found builtin (%s)', self.id, name)
         return b
     result = None
     for d in (schema.elements, schema.types):
         result = d.get(self.ref)
         if self.filter(result):
             result = None
         else:
             break
     if result is None:
         eq = ElementQuery(self.ref)
         eq.history = self.history
         result = eq.execute(schema)
     return self.result(result)
開發者ID:tic-ull,項目名稱:defensatfc-proto,代碼行數:28,代碼來源:query.py

示例2: execute

# 需要導入模塊: from suds.xsd.sxbuiltin import Factory [as 別名]
# 或者: from suds.xsd.sxbuiltin.Factory import create [as 別名]
 def execute(self, schema):
     if schema.builtin(self.ref):
         name = self.ref[0]
         b = Factory.create(schema, name)
         log.debug('%s, found builtin (%s)', self.id, name)
         return b
     result = schema.types.get(self.ref)
     if self.filter(result):
         result = None
     return self.result(result)
開發者ID:mnach,項目名稱:suds-py3k,代碼行數:12,代碼來源:query.py

示例3: test_create_custom_mapped_builtin_type_schema_objects

# 需要導入模塊: from suds.xsd.sxbuiltin import Factory [as 別名]
# 或者: from suds.xsd.sxbuiltin.Factory import create [as 別名]
def test_create_custom_mapped_builtin_type_schema_objects(xsd_type_name,
        monkeypatch):
    """User code can add or update built-in XSD type registrations."""
    _monkeypatch_builtin_XSD_type_registry(monkeypatch)
    class MockType:
        def __init__(self, schema, name):
            self.schema = schema
            self.name = name
    schema = _Dummy()
    Factory.maptag(xsd_type_name, MockType)
    xsd_object = Factory.create(schema, xsd_type_name)
    assert xsd_object.__class__ is MockType
    assert xsd_object.name == xsd_type_name
    assert xsd_object.schema is schema
開發者ID:codingkevin,項目名稱:suds,代碼行數:16,代碼來源:test_xsd_builtins.py

示例4: test_create_builtin_type_schema_objects

# 需要導入模塊: from suds.xsd.sxbuiltin import Factory [as 別名]
# 或者: from suds.xsd.sxbuiltin.Factory import create [as 別名]
def test_create_builtin_type_schema_objects(xsd_type_name, xsd_type):
    schema = _create_dummy_schema()
    xsd_object = Factory.create(schema, xsd_type_name)
    assert xsd_object.__class__ is xsd_type
    assert xsd_object.name == xsd_type_name
    assert xsd_object.schema is schema
開發者ID:codingkevin,項目名稱:suds,代碼行數:8,代碼來源:test_xsd_builtins.py


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