当前位置: 首页>>代码示例>>Python>>正文


Python PutGetXML.put_text_element方法代码示例

本文整理汇总了Python中Modules.Utilities.xml_tools.PutGetXML.put_text_element方法的典型用法代码示例。如果您正苦于以下问题:Python PutGetXML.put_text_element方法的具体用法?Python PutGetXML.put_text_element怎么用?Python PutGetXML.put_text_element使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Modules.Utilities.xml_tools.PutGetXML的用法示例。


在下文中一共展示了PutGetXML.put_text_element方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _write_one_node_xml

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
 def _write_one_node_xml(p_node_obj):
     l_entry = XmlConfigTools.write_base_object_xml('Node', 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)
     l_entry.append(Xml._write_interfaces_xml(p_node_obj.NodeInterfaces))
     return l_entry
开发者ID:,项目名称:,代码行数:9,代码来源:

示例2: write_interface_xml

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.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
开发者ID:,项目名称:,代码行数:9,代码来源:

示例3: _write_thermostat_data

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.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
开发者ID:,项目名称:,代码行数:9,代码来源:

示例4: _write_one_light_schedule

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.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_int_element(p_entry, 'Rate', p_schedule_obj.Rate)
     PutGetXML.put_text_element(p_entry, 'RoomName', p_schedule_obj.RoomName)
开发者ID:,项目名称:,代码行数:10,代码来源:

示例5: _write_one_zone

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.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_int_element(l_xml, 'Duration', p_obj.Duration)
     return l_xml
开发者ID:,项目名称:,代码行数:11,代码来源:

示例6: _write_one_base_schedule

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
 def _write_one_base_schedule(p_schedule_obj):
     """
     """
     l_entry = XmlConfigTools.write_base_object_xml('Schedule', p_schedule_obj)
     PutGetXML.put_text_element(l_entry, 'ScheduleType', p_schedule_obj.ScheduleType)
     PutGetXML.put_text_element(l_entry, 'Time', p_schedule_obj.Time)
     PutGetXML.put_int_element(l_entry, 'DayOfWeek', int(p_schedule_obj.DOW))
     PutGetXML.put_int_element(l_entry, 'Mode', p_schedule_obj.Mode)
     return l_entry
开发者ID:,项目名称:,代码行数:11,代码来源:

示例7: _write_one_system

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.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_object_xml('IrrigationSystem', p_obj)
     PutGetXML.put_text_element(l_xml, 'Comment', p_obj.Comment)
     for l_obj in p_obj.Zones.itervalues():
         l_zone = Xml._write_one_zone(l_obj)
         l_xml.append(l_zone)
     return l_xml
开发者ID:,项目名称:,代码行数:13,代码来源:

示例8: write_one_room

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
 def write_one_room(p_room_object):
     l_entry = XmlConfigTools.write_base_object_xml('Room', p_room_object)
     PutGetXML.put_text_element(l_entry, 'Comment', p_room_object.Comment)
     PutGetXML.put_text_element(l_entry, 'Corner', p_room_object.Corner)
     PutGetXML.put_text_element(l_entry, 'Floor', p_room_object.Floor)
     PutGetXML.put_text_element(l_entry, 'Size', p_room_object.Size)
     return l_entry
开发者ID:,项目名称:,代码行数:9,代码来源:

示例9: write_internet

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.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.itervalues():
             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
开发者ID:,项目名称:,代码行数:19,代码来源:

示例10: write_xml

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
 def write_xml(self, p_obj):
     l_xml = ET.Element('EmailSection')
     try:
         l_obj = p_obj.Computer.Email
         PutGetXML.put_text_element(l_xml, 'EmailFromAddress', l_obj.EmailFromAddress)
         PutGetXML.put_text_element(l_xml, 'EmailToAddress', l_obj.EmailToAddress)
         PutGetXML.put_text_element(l_xml, 'GmailLogin', l_obj.GmailLogin)
         PutGetXML.put_text_element(l_xml, 'GmailPassword', l_obj.GmailPassword)
     except AttributeError as e_err:
         LOG.error('ERROR in mqtt_xml.write_xml() - {}'.format(e_err))
     return l_xml
开发者ID:,项目名称:,代码行数:13,代码来源:

示例11: WriteXml

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
 def WriteXml(p_out_xml, p_device):
     """
     @param p_xml_out: is a parent element to which the Insteon Specific information is appended.
     """
     PutGetXML.put_text_element(p_out_xml, 'InsteonAddress', conversions.int2dotted_hex(p_device.InsteonAddress, 3))
     PutGetXML.put_int_element(p_out_xml, 'DevCat', conversions.int2dotted_hex(p_device.DevCat, 2))
     PutGetXML.put_text_element(p_out_xml, 'GroupList', p_device.GroupList)
     PutGetXML.put_int_element(p_out_xml, 'GroupNumber', p_device.GroupNumber)
     PutGetXML.put_text_element(p_out_xml, 'ProductKey', conversions.int2dotted_hex(p_device.ProductKey, 3))
     PutGetXML.put_int_element(p_out_xml, 'Version', p_device.Version)
     return p_out_xml
开发者ID:,项目名称:,代码行数:13,代码来源:

示例12: write_base_device_object_xml

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_text_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
开发者ID:,项目名称:,代码行数:24,代码来源:

示例13: _write_locates_xml

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
 def _write_locates_xml(p_internet_obj):
     l_xml = ET.Element('LocaterUrlSection')
     for l_url in p_internet_obj.LocateUrls.itervalues():
         PutGetXML.put_text_element(l_xml, 'LocateUrl', l_url)
     return l_xml
开发者ID:,项目名称:,代码行数:7,代码来源:

示例14: _write_derived_xml

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
 def _write_derived_xml(p_internet_obj, p_xml):
     PutGetXML.put_text_element(p_xml, 'ExternalIPv4', p_internet_obj.ExternalIPv4)
     PutGetXML.put_text_element(p_xml, 'ExternalIPv6', p_internet_obj.ExternalIPv6)
     PutGetXML.put_text_element(p_xml, 'LastChanged', p_internet_obj.LastChanged)
开发者ID:,项目名称:,代码行数:6,代码来源:

示例15: _write_one_interface_xml

# 需要导入模块: from Modules.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_text_element [as 别名]
 def _write_one_interface_xml(p_interface_obj):
     l_entry = XmlConfigTools.write_base_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)
     return l_entry
开发者ID:,项目名称:,代码行数:8,代码来源:


注:本文中的Modules.Utilities.xml_tools.PutGetXML.put_text_element方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。