当前位置: 首页>>代码示例>>Python>>正文


Python Element.name方法代码示例

本文整理汇总了Python中lxml.objectify.Element.name方法的典型用法代码示例。如果您正苦于以下问题:Python Element.name方法的具体用法?Python Element.name怎么用?Python Element.name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lxml.objectify.Element的用法示例。


在下文中一共展示了Element.name方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [as 别名]
    def handle(self, *args, **kwargs):
        
        params = _get_params(kwargs.get('payload'), ['id', 'cluster_id'], 'data.')
        
        with closing(self.server.odb.session()) as session:

            definition = def_jms_wmq(session, params['cluster_id'], params['id'])
            
            definition_elem = Element('definition')
            
            definition_elem.id = definition.id
            definition_elem.name = definition.name
            definition_elem.host = definition.host
            definition_elem.port = definition.port
            definition_elem.queue_manager = definition.queue_manager
            definition_elem.channel = definition.channel
            definition_elem.cache_open_send_queues = definition.cache_open_send_queues
            definition_elem.cache_open_receive_queues = definition.cache_open_receive_queues
            definition_elem.use_shared_connections = definition.use_shared_connections
            definition_elem.ssl = definition.ssl
            definition_elem.ssl_cipher_spec = definition.ssl_cipher_spec
            definition_elem.ssl_key_repository = definition.ssl_key_repository
            definition_elem.needs_mcd = definition.needs_mcd
            definition_elem.max_chars_printed = definition.max_chars_printed
    
            return ZATO_OK, etree.tostring(definition_elem)
开发者ID:brtsz,项目名称:zato,代码行数:28,代码来源:jms_wmq.py

示例2: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:29,代码来源:amqp.py

示例3: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:33,代码来源:scheduler.py

示例4: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:30,代码来源:http_soap.py

示例5: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:19,代码来源:service.py

示例6: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:19,代码来源:tech_account.py

示例7: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:22,代码来源:basic_auth.py

示例8: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:23,代码来源:s3.py

示例9: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:24,代码来源:zmq.py

示例10: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:25,代码来源:wss.py

示例11: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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')

            pairs = (('basic_auth', basic_auth_list), 
                     ('tech_acc', tech_acc_list), 
                     ('wss_username_password', wss_list))
            
            for def_type, meth in pairs:
                
                definitions = meth(session, params['cluster_id'])
                for definition in definitions:
        
                    definition_elem = Element('definition')
                    definition_elem.id = definition.id
                    definition_elem.name = definition.name
                    definition_elem.def_type = def_type
        
                    definition_list.append(definition_elem)
    
            return ZATO_OK, etree.tostring(definition_list)
开发者ID:brtsz,项目名称:zato,代码行数:25,代码来源:__init__.py

示例12: handle

# 需要导入模块: from lxml.objectify import Element [as 别名]
# 或者: from lxml.objectify.Element import name [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)
开发者ID:brtsz,项目名称:zato,代码行数:26,代码来源:ftp.py


注:本文中的lxml.objectify.Element.name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。