本文整理匯總了Python中Modules.Utilities.xml_tools.PutGetXML.put_coords_element方法的典型用法代碼示例。如果您正苦於以下問題:Python PutGetXML.put_coords_element方法的具體用法?Python PutGetXML.put_coords_element怎麽用?Python PutGetXML.put_coords_element使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Modules.Utilities.xml_tools.PutGetXML
的用法示例。
在下文中一共展示了PutGetXML.put_coords_element方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: write_base_device_object_xml
# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_coords_element [as 別名]
def write_base_device_object_xml(p_element_tag, p_obj):
"""
@param p_element_tag: is the element name that we are going to create.
@param p_obj: is the object that contains the device data for which we will output the XML
@return: the XML element with children that we will create.
"""
l_elem = ET.Element(p_element_tag)
PutGetXML.put_text_attribute(l_elem, "Name", p_obj.Name)
PutGetXML.put_int_attribute(l_elem, "Key", p_obj.Key)
PutGetXML.put_bool_attribute(l_elem, "Active", p_obj.Active)
# add sub elements
try:
PutGetXML.put_uuid_element(l_elem, "UUID", p_obj.UUID)
except AttributeError:
PutGetXML.put_uuid_element(l_elem, "UUID", "No UUID Given")
PutGetXML.put_text_element(l_elem, "Comment", p_obj.Comment)
PutGetXML.put_text_element(l_elem, "DeviceFamily", p_obj.DeviceFamily)
PutGetXML.put_int_element(l_elem, "DeviceType", p_obj.DeviceType)
PutGetXML.put_int_element(l_elem, "DeviceSubType", p_obj.DeviceSubType)
PutGetXML.put_coords_element(l_elem, "RoomCoords", p_obj.RoomCoords)
PutGetXML.put_text_element(l_elem, "RoomName", p_obj.RoomName)
return l_elem