本文整理汇总了Python中openprovider.modules.E.array方法的典型用法代码示例。如果您正苦于以下问题:Python E.array方法的具体用法?Python E.array怎么用?Python E.array使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openprovider.modules.E
的用法示例。
在下文中一共展示了E.array方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _records
# 需要导入模块: from openprovider.modules import E [as 别名]
# 或者: from openprovider.modules.E import array [as 别名]
def _records(records):
items = []
for rec in records:
if rec.get('prio') and rec.get('ttl'):
item = E.item(E.type(rec.get('type')), E.name(rec.get('name')), E.value(rec.get('value')), E.prio(rec.get('prio')), E.ttl(rec.get('ttl')))
elif not rec.get('prio') and rec.get('ttl'):
item = E.item(E.type(rec.get('type')), E.name(rec.get('name')), E.value(rec.get('value')), E.ttl(rec.get('ttl')))
elif not rec.get('prio') and not rec.get('ttl'):
item = E.item(E.type(rec.get('type')), E.name(rec.get('name')), E.value(rec.get('value')))
items.append(item)
return E.records(E.array(*items))
示例2: check_domain_request
# 需要导入模块: from openprovider.modules import E [as 别名]
# 或者: from openprovider.modules.E import array [as 别名]
def check_domain_request(self, domains):
"""
Return the availability of one or more domain names.
The availability is a model containing a domain and a status. It can also have a premium
attribute in case the domain has non-default costs.
"""
request = E.checkDomainRequest(
E.domains(
E.array(
*[E.item(
E.name(domain.split(".")[0]),
E.extension(domain.split(".")[1])
) for domain in domains]
)
)
)
response = self.request(request)
return [Model(item) for item in response.data.array.item]
示例3: _dnssec_keys
# 需要导入模块: from openprovider.modules import E [as 别名]
# 或者: from openprovider.modules.E import array [as 别名]
def _dnssec_keys(keys):
items = [E.item(E.flags(key.flags), E.alg(key.alg), E.protocol(getattr(key, 'protocol', 3)), E.pubKey(key.pubkey)) for key in keys]
return E.array(*items)
示例4: _nameservers
# 需要导入模块: from openprovider.modules import E [as 别名]
# 或者: from openprovider.modules.E import array [as 别名]
def _nameservers(nameservers):
items = [E.item(E.name(ns.name), OE('ip', ns.ip), OE('ip6', ns.ip6)) for ns in nameservers]
return E.array(*items)