當前位置: 首頁>>代碼示例>>Python>>正文


Python PutGetXML.put_int_element方法代碼示例

本文整理匯總了Python中Modules.Utilities.xml_tools.PutGetXML.put_int_element方法的典型用法代碼示例。如果您正苦於以下問題:Python PutGetXML.put_int_element方法的具體用法?Python PutGetXML.put_int_element怎麽用?Python PutGetXML.put_int_element使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Modules.Utilities.xml_tools.PutGetXML的用法示例。


在下文中一共展示了PutGetXML.put_int_element方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: write_interface_xml

# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_int_element [as 別名]
 def write_interface_xml(p_xml, p_controller_obj):
     try:
         PutGetXML.put_int_element(p_xml, 'Product', p_controller_obj.Product)
         PutGetXML.put_int_element(p_xml, 'Vendor', p_controller_obj.Vendor)
     except Exception:
         pass
     return p_xml
開發者ID:,項目名稱:,代碼行數:9,代碼來源:

示例2: _write_one_node_xml

# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_int_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,代碼來源:

示例3: _write_one_light_schedule

# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_int_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,代碼來源:

示例4: _write_one_base_schedule

# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_int_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,代碼來源:

示例5: _write_one_zone

# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_int_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_internet

# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_int_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,代碼來源:

示例7: WriteXml

# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_int_element [as 別名]
 def WriteXml(p_out_xml, p_device_obj):
     try:
         PutGetXML.put_int_element(p_out_xml, 'UPBAddress', p_device_obj.UPBAddress)
         PutGetXML.put_int_element(p_out_xml, 'UPBNetworkID', p_device_obj.UPBNetworkID)
         PutGetXML.put_int_element(p_out_xml, 'UPBPassword', p_device_obj.UPBPassword)
     except AttributeError as e_err:
         LOG.error('InsertDeviceXML ERROR {}'.format(e_err))
開發者ID:,項目名稱:,代碼行數:9,代碼來源:

示例8: write_base_device_object_xml

# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_int_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,代碼來源:

示例9: _write_port

# 需要導入模塊: from Modules.Utilities.xml_tools import PutGetXML [as 別名]
# 或者: from Modules.Utilities.xml_tools.PutGetXML import put_int_element [as 別名]
 def _write_port(p_obj, p_xml):
     """
     @param p_obj: is the Computer.Web object
     """
     l_xml = PutGetXML.put_int_element(p_xml, 'Port', p_obj.WebPort)
     return l_xml
開發者ID:,項目名稱:,代碼行數:8,代碼來源:


注:本文中的Modules.Utilities.xml_tools.PutGetXML.put_int_element方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。