本文整理汇总了Python中lxml.objectify.Element.is_active方法的典型用法代码示例。如果您正苦于以下问题:Python Element.is_active方法的具体用法?Python Element.is_active怎么用?Python Element.is_active使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lxml.objectify.Element
的用法示例。
在下文中一共展示了Element.is_active方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
with closing(self.server.odb.session()) as session:
params = _get_params(kwargs.get('payload'), ['cluster_id'], 'data.')
definition_list = Element('definition_list')
definitions = job_list(session, params['cluster_id'])
for definition in definitions:
definition_elem = Element('definition')
definition_elem.id = definition.id
definition_elem.name = definition.name
definition_elem.is_active = definition.is_active
definition_elem.job_type = definition.job_type
definition_elem.start_date = definition.start_date
definition_elem.extra = definition.extra.decode('utf-8')
definition_elem.service_id = definition.service_id
definition_elem.service_name = definition.service_name.decode('utf-8')
definition_elem.weeks = definition.weeks if definition.weeks else ''
definition_elem.days = definition.days if definition.days else ''
definition_elem.hours = definition.hours if definition.hours else ''
definition_elem.minutes = definition.minutes if definition.minutes else ''
definition_elem.seconds = definition.seconds if definition.seconds else ''
definition_elem.repeats = definition.repeats if definition.repeats else ''
definition_elem.cron_definition = (definition.cron_definition.decode('utf-8') if
definition.cron_definition else '')
definition_list.append(definition_elem)
return ZATO_OK, etree.tostring(definition_list)
示例2: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
params = _get_params(kwargs.get('payload'), ['cluster_id'], 'data.')
with closing(self.server.odb.session()) as session:
item_list = Element('item_list')
db_items = out_amqp_list(session, params['cluster_id'])
for db_item in db_items:
item = Element('item')
item.id = db_item.id
item.name = db_item.name
item.is_active = db_item.is_active
item.delivery_mode = db_item.delivery_mode
item.priority = db_item.priority
item.content_type = db_item.content_type
item.content_encoding = db_item.content_encoding
item.expiration = db_item.expiration
item.user_id = db_item.user_id
item.app_id = db_item.app_id
item.def_name = db_item.def_name
item.def_id = db_item.def_id
item_list.append(item)
return ZATO_OK, etree.tostring(item_list)
示例3: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
params = _get_params(kwargs.get('payload'), ['cluster_id', 'connection', 'transport'], 'data.')
with closing(self.server.odb.session()) as session:
item_list = Element('item_list')
db_items = http_soap_list(session, params['cluster_id'], params['connection'], params['transport'])
for db_item in db_items:
item = Element('item')
item.id = db_item.id
item.name = db_item.name
item.is_active = db_item.is_active
item.is_internal = db_item.is_internal
item.url_path = db_item.url_path
item.method = db_item.method
item.soap_action = db_item.soap_action
item.soap_version = db_item.soap_version
item.service_id = db_item.service_id
item.service_name = db_item.service_name
item.security_id = db_item.security_id
item.security_name = db_item.security_name
item.security_def_type = db_item.security_def_type
item_list.append(item)
return ZATO_OK, etree.tostring(item_list)
示例4: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
params = _get_params(kwargs.get('payload'), ['id', 'cluster_id'], 'data.')
with closing(self.server.odb.session()) as session:
db_item = service(session, params['cluster_id'], params['id'])
item = Element('item')
item.id = db_item.id
item.name = db_item.name
item.is_active = db_item.is_active
item.impl_name = db_item.impl_name
item.is_internal = db_item.is_internal
item.usage_count = 'TODO getbyid'
return ZATO_OK, etree.tostring(item)
示例5: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
with closing(self.server.odb.session()) as session:
definition_list = Element("definition_list")
params = _get_params(kwargs.get("payload"), ["cluster_id"], "data.")
definitions = tech_acc_list(session, params["cluster_id"])
for definition in definitions:
definition_elem = Element("definition")
definition_elem.id = definition.id
definition_elem.name = definition.name
definition_elem.is_active = definition.is_active
definition_list.append(definition_elem)
return ZATO_OK, etree.tostring(definition_list)
示例6: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
params = _get_params(kwargs.get('payload'), ['cluster_id'], 'data.')
with closing(self.server.odb.session()) as session:
definition_list = Element('definition_list')
definitions = basic_auth_list(session, params['cluster_id'])
for definition in definitions:
definition_elem = Element('definition')
definition_elem.id = definition.id
definition_elem.name = definition.name
definition_elem.is_active = definition.is_active
definition_elem.username = definition.username
definition_elem.domain = definition.domain
definition_list.append(definition_elem)
return ZATO_OK, etree.tostring(definition_list)
示例7: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
params = _get_params(kwargs.get('payload'), ['cluster_id'], 'data.')
with closing(self.server.odb.session()) as session:
item_list = Element('item_list')
db_items = out_s3_list(session, params['cluster_id'])
for db_item in db_items:
item = Element('item')
item.id = db_item.id
item.name = db_item.name
item.is_active = db_item.is_active
item.prefix_ = db_item.prefix
item.separator = db_item.separator
item.key_sync_timeout = db_item.key_sync_timeout
item_list.append(item)
return ZATO_OK, etree.tostring(item_list)
示例8: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
params = _get_params(kwargs.get('payload'), ['cluster_id'], 'data.')
with closing(self.server.odb.session()) as session:
item_list = Element('item_list')
db_items = channel_zmq_list(session, params['cluster_id'])
for db_item in db_items:
item = Element('item')
item.id = db_item.id
item.name = db_item.name
item.is_active = db_item.is_active
item.address = db_item.address
item.socket_type = db_item.socket_type
item.sub_key = db_item.sub_key
item.service_name = db_item.service_name
item_list.append(item)
return ZATO_OK, etree.tostring(item_list)
示例9: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
with closing(self.server.odb.session()) as session:
params = _get_params(kwargs.get('payload'), ['cluster_id'], 'data.')
definition_list = Element('definition_list')
definitions = wss_list(session, params['cluster_id'])
for definition in definitions:
definition_elem = Element('definition')
definition_elem.id = definition.id
definition_elem.name = definition.name
definition_elem.is_active = definition.is_active
definition_elem.password_type = definition.password_type
definition_elem.username = definition.username
definition_elem.reject_empty_nonce_ts = definition.reject_empty_nonce_ts
definition_elem.reject_stale_username = definition.reject_stale_username
definition_elem.expiry_limit = definition.expiry_limit
definition_elem.nonce_freshness = definition.nonce_freshness
definition_list.append(definition_elem)
return ZATO_OK, etree.tostring(definition_list)
示例10: handle
# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import is_active [as 别名]
def handle(self, *args, **kwargs):
params = _get_params(kwargs.get('payload'), ['cluster_id'], 'data.')
with closing(self.server.odb.session()) as session:
item_list = Element('item_list')
db_items = out_ftp_list(session, params['cluster_id'])
for db_item in db_items:
item = Element('item')
item.id = db_item.id
item.name = db_item.name
item.is_active = db_item.is_active
item.host = db_item.host
item.port = db_item.port
item.user = db_item.user
item.acct = db_item.acct
item.timeout = db_item.timeout
item.dircache = db_item.dircache
item_list.append(item)
return ZATO_OK, etree.tostring(item_list)