当前位置: 首页>>代码示例>>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;未经允许,请勿转载。