本文整理汇总了Python中Modules.Core.Utilities.xml_tools.PutGetXML.put_text_element方法的典型用法代码示例。如果您正苦于以下问题:Python PutGetXML.put_text_element方法的具体用法?Python PutGetXML.put_text_element怎么用?Python PutGetXML.put_text_element使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modules.Core.Utilities.xml_tools.PutGetXML
的用法示例。
在下文中一共展示了PutGetXML.put_text_element方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_interface_xml
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def write_interface_xml(p_xml, p_controller_obj):
try:
PutGetXML.put_int_element(p_xml, 'PortNumber', p_controller_obj.PortNumber)
PutGetXML.put_text_element(p_xml, 'Protocol', p_controller_obj.Protocol)
except Exception:
pass
return p_xml
示例2: _write_thermostat_data
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def _write_thermostat_data(p_out_xml, p_obj):
PutGetXML.put_float_element(p_out_xml, 'CoolSetPoint', p_obj.CoolSetPoint)
PutGetXML.put_float_element(p_out_xml, 'HeatSetPoint', p_obj.HeatSetPoint)
PutGetXML.put_text_element(p_out_xml, 'ThermostatMode', p_obj.ThermostatMode)
PutGetXML.put_text_element(p_out_xml, 'ThermostatScale', p_obj.ThermostatScale)
PutGetXML.put_float_element(p_out_xml, 'CurrentTemperature', p_obj.CurrentTemperature)
return p_out_xml
示例3: _write_one_node_xml
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def _write_one_node_xml(p_node_obj):
l_entry = XmlConfigTools.write_base_UUID_object_xml(NODE_ATTR, p_node_obj)
PutGetXML.put_text_element(l_entry, 'ConnectionAddressV4', p_node_obj.ConnectionAddr_IPv4)
PutGetXML.put_text_element(l_entry, 'ConnectionAddressV6', p_node_obj.ConnectionAddr_IPv6)
PutGetXML.put_int_element(l_entry, 'NodeRole', p_node_obj.NodeRole)
PutGetXML.put_date_time_element(l_entry, 'LastUpdate', p_node_obj.LastUpdate)
l_entry.append(Xml._write_interfaces_xml(p_node_obj.NodeInterfaces))
return l_entry
示例4: _write_one_system
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def _write_one_system(p_obj):
"""
@param p_obj: is one irrigation system object.
@return: the XML for one complete IrrigationSystem
"""
l_xml = XmlConfigTools.write_base_UUID_object_xml('IrrigationSystem', p_obj)
PutGetXML.put_text_element(l_xml, 'Comment', p_obj.Comment)
for l_obj in p_obj.Zones.values():
l_zone = Xml._write_one_zone(l_obj)
l_xml.append(l_zone)
return l_xml
示例5: write_interface_xml
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def write_interface_xml(p_xml, p_controller_obj):
try:
PutGetXML.put_int_element(p_xml, 'BaudRate', p_controller_obj.BaudRate)
PutGetXML.put_int_element(p_xml, 'ByteSize', p_controller_obj.ByteSize)
PutGetXML.put_bool_element(p_xml, 'DsrDtr', p_controller_obj.DsrDtr)
PutGetXML.put_text_element(p_xml, 'Parity', p_controller_obj.Parity)
PutGetXML.put_bool_element(p_xml, 'RtsCts', p_controller_obj.RtsCts)
PutGetXML.put_float_element(p_xml, 'StopBits', p_controller_obj.StopBits)
PutGetXML.put_float_element(p_xml, 'Timeout', p_controller_obj.Timeout)
PutGetXML.put_bool_element(p_xml, 'XonXoff', p_controller_obj.XonXoff)
except Exception as e_err:
LOG.error('Error writing XML - {}'.format(e_err))
return p_xml
示例6: _write_one_interface_xml
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def _write_one_interface_xml(p_interface_obj):
l_entry = XmlConfigTools.write_base_UUID_object_xml('Interface', p_interface_obj)
PutGetXML.put_text_element(l_entry, 'MacAddress', p_interface_obj.MacAddress)
PutGetXML.put_text_element(l_entry, 'IPv4Address', p_interface_obj.V4Address)
PutGetXML.put_text_element(l_entry, 'IPv6Address', p_interface_obj.V6Address)
PutGetXML.put_text_element(l_entry, 'InterfaceType', p_interface_obj.NodeInterfaceType)
return l_entry
示例7: _write_one_zone
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def _write_one_zone(p_obj):
"""
@param p_obj: is one zone object
@return the XML for one Zone
"""
l_xml = XmlConfigTools.write_base_object_xml('Zone', p_obj)
PutGetXML.put_text_element(l_xml, 'Comment', p_obj.Comment)
PutGetXML.put_time_element(l_xml, 'Duration', p_obj.Duration)
PutGetXML.put_int_element(l_xml, 'EmitterCount', p_obj.EmitterCount)
PutGetXML.put_int_element(l_xml, 'EmitterType', p_obj.EmitterType)
PutGetXML.put_int_element(l_xml, 'NextZone', p_obj.Next)
PutGetXML.put_int_element(l_xml, 'PrevZone', p_obj.Previous)
PutGetXML.put_int_element(l_xml, 'Rate', p_obj.Rate)
PutGetXML.put_time_element(l_xml, 'StartTime', p_obj.StartTime)
return l_xml
示例8: write_onkyo_section_xml
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def write_onkyo_section_xml(p_pyhouse_obj):
""" Create the entire OnkyoSection of the XML.
@param p_pyhouse_obj: containing an object with onkyo
"""
l_active = p_pyhouse_obj.House.Entertainment.Plugins[SECTION].Count > 0
l_xml = ET.Element('OnkyoSection', attrib={'Active': str(l_active)})
l_count = 0
l_obj = p_pyhouse_obj.House.Entertainment.Plugins[SECTION]
PutGetXML.put_text_element(l_xml, 'Type', l_obj.Type)
for l_device_object in l_obj.Devices.values():
l_device_object.Key = l_count
l_entry = XML._write_device(l_device_object)
l_xml.append(l_entry)
l_count += 1
LOG.info('Saved {} Onkyo device(s) XML'.format(l_count))
return l_xml
示例9: _write_device
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def _write_device(p_obj):
l_xml = XmlConfigTools.write_base_UUID_object_xml('Device', p_obj)
PutGetXML.put_ip_element(l_xml, 'IPv4', p_obj.IPv4)
PutGetXML.put_int_element(l_xml, 'Port', p_obj.Port)
PutGetXML.put_text_element(l_xml, 'RoomName', p_obj.RoomName)
PutGetXML.put_text_element(l_xml, 'RoomUUID', p_obj.RoomUUID)
PutGetXML.put_text_element(l_xml, 'Type', p_obj.Type)
PutGetXML.put_text_element(l_xml, 'Volume', p_obj.Volume)
return l_xml
示例10: write_internet
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def write_internet(self, p_house_obj):
"""Create a sub tree for 'Internet' - the sub elements do not have to be present.
@return: a sub tree ready to be appended to "something"
"""
l_internet_xml = ET.Element('Internet')
PutGetXML.put_text_attribute(l_internet_xml, 'ExternalIP', p_house_obj.Internet.ExternalIP)
PutGetXML.put_int_attribute(l_internet_xml, 'ExternalDelay', p_house_obj.Internet.ExternalDelay)
PutGetXML.put_text_attribute(l_internet_xml, 'ExternalUrl', p_house_obj.Internet.ExternalUrl)
try:
for l_dyndns_obj in p_house_obj.Internet.DynDns.values():
l_entry = self.write_base_object_xml('DynamicDNS', l_dyndns_obj)
PutGetXML.put_int_element(l_entry, 'UpdateInterval', l_dyndns_obj.UpdateInterval)
PutGetXML.put_text_element(l_entry, 'UpdateUrl', l_dyndns_obj.UpdateUrl)
l_internet_xml.append(l_entry)
except AttributeError:
pass
return l_internet_xml
示例11: _write_light_data
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def _write_light_data(p_obj, p_xml):
PutGetXML.put_text_element(p_xml, 'Comment', p_obj.Comment)
PutGetXML.put_text_element(p_xml, 'Brightness', p_obj.BrightnessPct)
PutGetXML.put_text_element(p_xml, 'IsDimmable', p_obj.IsDimmable)
PutGetXML.put_int_element(p_xml, 'DeviceType', p_obj.DeviceType)
PutGetXML.put_int_element(p_xml, 'DeviceSubType', p_obj.DeviceSubType)
PutGetXML.put_text_element(p_xml, 'RoomName', p_obj.RoomName)
PutGetXML.put_uuid_element(p_xml, 'RoomUUID', p_obj.RoomUUID)
PutGetXML.put_coords_element(p_xml, 'RoomCoords', p_obj.RoomCoords)
return p_xml
示例12: _write_one_light_schedule
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def _write_one_light_schedule(p_schedule_obj, p_entry):
"""
Shove our entries in.
"""
PutGetXML.put_int_element(p_entry, 'Level', p_schedule_obj.Level)
PutGetXML.put_text_element(p_entry, 'LightName', p_schedule_obj.LightName)
PutGetXML.put_text_element(p_entry, 'LightUUID', p_schedule_obj.LightUUID)
PutGetXML.put_int_element(p_entry, 'Rate', p_schedule_obj.Rate)
PutGetXML.put_text_element(p_entry, 'RoomName', p_schedule_obj.RoomName)
PutGetXML.put_text_element(p_entry, 'RoomUUID', p_schedule_obj.RoomUUID)
示例13: write_pandora_section_xml
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def write_pandora_section_xml(p_pyhouse_obj):
""" Create the <PandoraSection> portion of the <EntertainmentSection>
@param p_pyhouse_obj: containing an object with pandora data filled in.
@return: An Element of the tree which can be appended to the EntertainmentSection
"""
l_entertain_obj = p_pyhouse_obj.House.Entertainment
l_plugin_obj = l_entertain_obj.Plugins[SECTION]
l_active = l_plugin_obj.Active
l_xml = ET.Element('PandoraSection', attrib={'Active': str(l_active)})
PutGetXML.put_text_element(l_xml, 'Type', l_plugin_obj.Type)
l_count = 0
for l_pandora_object in l_plugin_obj.Devices.values():
l_pandora_object.Key = l_count
l_entry = XML._write_device(l_pandora_object)
l_xml.append(l_entry)
l_count += 1
LOG.info('Saved {} Pandora device(s) XML'.format(l_count))
return l_xml
示例14: _write_one_base_schedule
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def _write_one_base_schedule(p_schedule_obj):
"""
"""
l_entry = XmlConfigTools.write_base_UUID_object_xml(SCHEDULE_ATTR, p_schedule_obj)
PutGetXML.put_int_element(l_entry, 'DayOfWeek', int(p_schedule_obj.DOW))
PutGetXML.put_text_element(l_entry, 'ScheduleMode', p_schedule_obj.ScheduleMode)
PutGetXML.put_text_element(l_entry, 'ScheduleType', p_schedule_obj.ScheduleType)
PutGetXML.put_text_element(l_entry, 'Time', p_schedule_obj.Time)
return l_entry
示例15: write_one_room
# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
def write_one_room(p_room_object):
l_entry = XmlConfigTools.write_base_UUID_object_xml('Room', p_room_object)
PutGetXML.put_text_element(l_entry, 'Comment', p_room_object.Comment)
PutGetXML.put_coords_element(l_entry, 'Corner', p_room_object.Corner)
PutGetXML.put_text_element(l_entry, 'Floor', p_room_object.Floor)
PutGetXML.put_date_time_element(l_entry, 'LastUpdate', p_room_object.LastUpdate)
PutGetXML.put_coords_element(l_entry, 'Size', p_room_object.Size)
PutGetXML.put_text_element(l_entry, 'RoomType', p_room_object.RoomType)
return l_entry