Files
galaxy/scripts/galaxy_messaging/server/xml_helper.py
T
Ramkrishna Chakrabarty 3d72267f44 sample tracking data transfer mechanism streamlined.
- eliminated the transfer_datasets.ini config file
- eliminated the data transfer user
- now the admin user initiating the data transfer is used as the data transfer user.
- the admin user is provided the add_library_item permission before data transfer if they dont have it
- sample update & data transfer amqp messages now includes api_key
2010-11-07 19:46:59 -05:00

28 lines
786 B
Python

#======= XML helper methods ====================================================
import xml.dom.minidom
def get_value( dom, tag_name ):
'''
This method extracts the tag value from the xml message
'''
nodelist = dom.getElementsByTagName( tag_name )[ 0 ].childNodes
rc = ""
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc = rc + node.data
return rc
def get_value_index( dom, tag_name, dataset_id ):
'''
This method extracts the tag value from the xml message
'''
try:
nodelist = dom.getElementsByTagName( tag_name )[ dataset_id ].childNodes
except:
return None
rc = ""
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc = rc + node.data
return rc