本文整理匯總了Python中Modules.Utilities.xml_tools.PutGetXML.get_bool_from_xml方法的典型用法代碼示例。如果您正苦於以下問題:Python PutGetXML.get_bool_from_xml方法的具體用法?Python PutGetXML.get_bool_from_xml怎麽用?Python PutGetXML.get_bool_from_xml使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Modules.Utilities.xml_tools.PutGetXML
的用法示例。
在下文中一共展示了PutGetXML.get_bool_from_xml方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: read_interface_xml
# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import get_bool_from_xml [as 別名]
def read_interface_xml(p_controller_entry):
l_serial = SerialControllerData()
l_serial.BaudRate = PutGetXML.get_int_from_xml(p_controller_entry, "BaudRate", 19200)
l_serial.ByteSize = PutGetXML.get_int_from_xml(p_controller_entry, "ByteSize", 8)
l_serial.DsrDtr = PutGetXML.get_bool_from_xml(p_controller_entry, "DsrDtr", False)
l_serial.Parity = PutGetXML.get_text_from_xml(p_controller_entry, "Parity", "N")
l_serial.RtsCts = PutGetXML.get_bool_from_xml(p_controller_entry, "RtsCts", False)
l_serial.StopBits = PutGetXML.get_float_from_xml(p_controller_entry, "StopBits", 1.0)
l_serial.Timeout = PutGetXML.get_float_from_xml(p_controller_entry, "Timeout", 1.0)
l_serial.XonXoff = PutGetXML.get_bool_from_xml(p_controller_entry, "XonXoff", False)
return l_serial
示例2: read_base_device_object_xml
# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import get_bool_from_xml [as 別名]
def read_base_device_object_xml(p_obj, p_xml):
"""
Get the BaseObject entries from the XML element.
@param p_obj: is the object we wish to populate with data
@param p_xml: is the element we will extract data from (including children).
"""
try:
p_obj.Name = PutGetXML.get_text_from_xml(p_xml, "Name", "Missing Name")
p_obj.Key = PutGetXML.get_int_from_xml(p_xml, "Key", 0)
p_obj.Active = PutGetXML.get_bool_from_xml(p_xml, "Active", False)
p_obj.Comment = PutGetXML.get_text_from_xml(p_xml, "Comment")
p_obj.DeviceFamily = PutGetXML.get_text_from_xml(p_xml, "DeviceFamily")
p_obj.DeviceType = PutGetXML.get_int_from_xml(p_xml, "DeviceType")
p_obj.DeviceSubType = PutGetXML.get_int_from_xml(p_xml, "DeviceSubType")
p_obj.RoomCoords = PutGetXML.get_coords_from_xml(p_xml, "RoomCoords")
p_obj.RoomName = PutGetXML.get_text_from_xml(p_xml, "RoomName")
p_obj.UUID = PutGetXML.get_uuid_from_xml(p_xml, "UUID")
except Exception as e_err:
LOG.warn("ERROR in xml_tools.read_base_obj_xml() - {}".format(e_err))
print(e_err)
return p_obj
示例3: test_05_FalseDirect
# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import get_bool_from_xml [as 別名]
def test_05_FalseDirect(self):
result = PutGetXML.get_bool_from_xml(self.m_fields, 'BoolField2')
self.assertFalse(result)
示例4: _read_light_data
# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import get_bool_from_xml [as 別名]
def _read_light_data(p_obj, p_xml, p_version):
p_obj.CurLevel = PutGetXML.get_int_from_xml(p_xml, 'CurLevel', 0)
p_obj.IsDimmable = PutGetXML.get_bool_from_xml(p_xml, 'IsDimmable', False)
return p_obj # for testing