本文整理汇总了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)
示例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)
示例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
示例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