本文整理汇总了Python中Modules.Core.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.Core.Utilities.xml_tools.PutGetXML
的用法示例。
在下文中一共展示了PutGetXML.get_bool_from_xml方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: read_interface_xml
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.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_pandora_section_xml
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_bool_from_xml [as 别名]
def read_pandora_section_xml(p_pyhouse_obj):
"""
This has to:
Fill in an entry in Entertainment Plugins
@param p_pyhouse_obj: containing an XML Element for the <PandoraSection>
@return: a EntertainmentPluginData object filled in.
"""
l_plugin_obj = p_pyhouse_obj.House.Entertainment.Plugins[SECTION]
l_plugin_obj.Name = SECTION
l_xml = XmlConfigTools.find_section(p_pyhouse_obj, 'HouseDivision/EntertainmentSection/PandoraSection')
if l_xml is None:
return l_plugin_obj
l_count = 0
try:
l_plugin_obj.Active = PutGetXML.get_bool_from_xml(l_xml, 'Active')
l_plugin_obj.Type = PutGetXML.get_text_from_xml(l_xml, 'Type')
for l_device_xml in l_xml.iterfind('Device'):
l_device_obj = XML._read_device(l_device_xml)
l_device_obj.Key = l_count
l_plugin_obj.Devices[l_count] = l_device_obj
LOG.info('Loaded {} Device {}'.format(SECTION, l_plugin_obj.Name))
l_count += 1
l_plugin_obj.Count = l_count
except AttributeError as e_err:
LOG.error('ERROR if getting {} Device Data - {}'.format(SECTION, e_err))
p_pyhouse_obj.House.Entertainment.Plugins[SECTION] = l_plugin_obj
LOG.info('Loaded {} {} Devices.'.format(l_count, SECTION))
return l_plugin_obj
示例3: _read_one_irrigation_system
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_bool_from_xml [as 别名]
def _read_one_irrigation_system(p_xml):
"""
May contain zero or more zones.
In general each zone is controlled by a solenoid controlled valve.
"""
l_sys = IrrigationSystemData()
l_count = 0
XmlConfigTools.read_base_UUID_object_xml(l_sys, p_xml)
try:
l_sys.Comment = PutGetXML.get_text_from_xml(p_xml, 'Comment')
l_sys.FirstZone = PutGetXML.get_int_from_xml(p_xml, 'FirstZone')
l_sys.UsesMasterValve = PutGetXML.get_bool_from_xml(p_xml, 'MasterValve')
l_sys.UsesPumpStartRelay = PutGetXML.get_bool_from_xml(p_xml, 'PumpRelay')
l_sys.Type = PutGetXML.get_text_from_xml(p_xml, 'Type')
for l_zone in p_xml.iterfind(ZONE):
l_obj = Xml._read_one_zone(l_zone)
l_sys.Zones[l_count] = l_obj
l_count += 1
except AttributeError as e_err:
LOG.error('Zone: {}'.format(e_err))
return l_sys
示例4: _read_light_data
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_bool_from_xml [as 别名]
def _read_light_data(_p_pyhouse_obj, p_obj, p_xml):
p_obj.Comment = PutGetXML.get_text_from_xml(p_xml, 'Comment')
if (p_xml.find('Brightness') != None):
p_obj.BrightnessPct = PutGetXML.get_int_from_xml(p_xml, 'Brightness', 44)
else:
p_obj.BrightnessPct = PutGetXML.get_int_from_xml(p_xml, 'CurLevel', 45)
p_obj.IsDimmable = PutGetXML.get_bool_from_xml(p_xml, 'IsDimmable', False)
p_obj.DeviceType = PutGetXML.get_int_from_xml(p_xml, 'DeviceType', 41)
p_obj.DeviceSubType = PutGetXML.get_int_from_xml(p_xml, 'DeviceSubType', 43)
p_obj.RoomName = PutGetXML.get_text_from_xml(p_xml, 'RoomName')
p_obj.RoomUUID = PutGetXML.get_uuid_from_xml(p_xml, 'RoomUUID')
p_obj.RoomCoords = PutGetXML.get_coords_from_xml(p_xml, 'RoomCoords')
return p_obj # for testing
示例5: read_samsung_section_xml
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_bool_from_xml [as 别名]
def read_samsung_section_xml(p_pyhouse_obj):
l_xml = XmlConfigTools.find_section(p_pyhouse_obj, 'HouseDivision/EntertainmentSection/SamsungSection')
l_entertain_obj = p_pyhouse_obj.House.Entertainment
l_plugin_obj = l_entertain_obj.Plugins[SECTION]
l_plugin_obj.Name = SECTION
l_plugin_obj.Active = PutGetXML.get_bool_from_xml(l_xml, 'Active')
l_count = 0
if l_xml is None:
return l_plugin_obj
try:
l_plugin_obj.Type = PutGetXML.get_text_from_xml(l_xml, 'Type')
for l_device_xml in l_xml.iterfind('Device'):
l_device_obj = XML._read_device(l_device_xml)
l_device_obj.Key = l_count
l_plugin_obj.Devices[l_count] = l_device_obj
LOG.info('Loaded {} Device {}'.format(SECTION, l_plugin_obj.Name))
l_count += 1
l_plugin_obj.Count = l_count
except AttributeError as e_err:
LOG.error('ERROR if getting {} Device Data - {}'.format(SECTION, e_err))
p_pyhouse_obj.House.Entertainment.Plugins[SECTION] = l_plugin_obj
LOG.info('Loaded {} {} Device(s).'.format(l_count, SECTION))
return l_plugin_obj