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


Python PutGetXML.get_int_from_xml方法代码示例

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


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

示例1: read_interface_xml

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def read_interface_xml(p_controller_xml):
     l_usb = USBControllerData()
     try:
         l_usb.Product = PutGetXML.get_int_from_xml(p_controller_xml, 'Product')
         l_usb.Vendor = PutGetXML.get_int_from_xml(p_controller_xml, 'Vendor')
     except Exception as e_err:
         LOG.error('Read Interface - {}'.format(e_err))
     return l_usb
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:10,代码来源:USB_xml.py

示例2: _read_ports

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def _read_ports(p_xml):
     """
     @param p_xml: is the web section
     @return: the Port Number
     """
     l_port = PutGetXML.get_int_from_xml(p_xml, 'WebPort', 8580)
     l_secure = PutGetXML.get_int_from_xml(p_xml, 'SecurePort', 8580)
     l_socket = PutGetXML.get_int_from_xml(p_xml, 'SocketPort', 8580)
     return l_port, l_secure, l_socket
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:11,代码来源:web_xml.py

示例3: read_interface_xml

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

示例4: _read_one_lighting_schedule

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def _read_one_lighting_schedule(p_schedule_element):
     """Extract schedule information from a schedule xml element.
     """
     l_obj = ScheduleLightData()
     l_obj.Level = PutGetXML.get_int_from_xml(p_schedule_element, 'Level')
     l_obj.LightName = PutGetXML.get_text_from_xml(p_schedule_element, 'LightName')
     l_obj.LightUUID = PutGetXML.get_uuid_from_xml(p_schedule_element, 'LightUUID')
     l_obj.Rate = PutGetXML.get_int_from_xml(p_schedule_element, 'Rate')
     l_obj.RoomName = PutGetXML.get_text_from_xml(p_schedule_element, 'RoomName')
     l_obj.RoomUUID = PutGetXML.get_uuid_from_xml(p_schedule_element, 'RoomUUID')
     return l_obj
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:13,代码来源:schedule_xml.py

示例5: _read_device

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def _read_device(p_xml):
     l_device = SamsungDeviceData()
     XmlConfigTools.read_base_UUID_object_xml(l_device, p_xml)
     l_device.Installed = PutGetXML.get_text_from_xml(p_xml, 'Installed')
     l_device.IPv4 = PutGetXML.get_ip_from_xml(p_xml, 'IPv4')
     # l_device.Model = PutGetXML.get_text_from_xml(p_xml, 'Model')
     l_device.Port = PutGetXML.get_int_from_xml(p_xml, 'Port', 55000)
     l_device.RoomName = PutGetXML.get_text_from_xml(p_xml, 'RoomName')
     l_device.RoomUUID = PutGetXML.get_uuid_from_xml(p_xml, 'RoomUUID')
     l_device.Type = PutGetXML.get_text_from_xml(p_xml, 'Type')
     l_device.Volume = PutGetXML.get_int_from_xml(p_xml, 'Volume')
     return l_device
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:14,代码来源:samsung.py

示例6: ReadXml

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def ReadXml(p_device_obj, p_in_xml):
     """
     @param p_in_xml: is the e-tree XML house object
     @param p_house: is the text name of the House.
     @return: a dict of the entry to be attached to a house object.
     """
     l_obj = UPBData()
     l_obj.UPBAddress = PutGetXML.get_int_from_xml(p_in_xml, 'UPBAddress', 255)
     l_obj.UPBNetworkID = PutGetXML.get_int_from_xml(p_in_xml, 'UPBNetworkID')
     l_obj.UPBPassword = PutGetXML.get_int_from_xml(p_in_xml, 'UPBPassword')
     stuff_new_attrs(p_device_obj, l_obj)
     return l_obj  # for testing
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:14,代码来源:UPB_xml.py

示例7: _read_light_data

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

示例8: _read_device

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
    def _read_device(p_xml):
        """ Read an entire <Device> section of XML and fill in the OnkyoDeviceData Object

        @return: a completed OnkyoDeviceData object
        """
        l_device = OnkyoDeviceData()
        XmlConfigTools.read_base_UUID_object_xml(l_device, p_xml)
        l_device.IPv4 = PutGetXML.get_ip_from_xml(p_xml, 'IPv4')
        l_device.Port = PutGetXML.get_int_from_xml(p_xml, 'Port')
        l_device.RoomName = PutGetXML.get_text_from_xml(p_xml, 'RoomName')
        l_device.RoomUUID = PutGetXML.get_uuid_from_xml(p_xml, 'RoomUUID')
        l_device.Type = PutGetXML.get_text_from_xml(p_xml, 'Type')
        l_device.Volume = PutGetXML.get_int_from_xml(p_xml, 'Volume')
        return l_device
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:16,代码来源:onkyo.py

示例9: _read_device

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def _read_device(p_entry_xml):
     """
     @param p_entry_xml: Element <Device> within <PandoraSection>
     @return: a PandoraDeviceData object
     """
     l_obj = PandoraDeviceData()
     XmlConfigTools.read_base_object_xml(l_obj, p_entry_xml)
     l_obj.Host = PutGetXML.get_ip_from_xml(p_entry_xml, 'Host')
     l_obj.ConnectionFamily = PutGetXML.get_text_from_xml(p_entry_xml, 'ConnectionFamily')
     l_obj.ConnectionName = PutGetXML.get_text_from_xml(p_entry_xml, 'ConnectionName').lower()
     l_obj.InputName = PutGetXML.get_text_from_xml(p_entry_xml, 'InputName')
     l_obj.InputCode = PutGetXML.get_text_from_xml(p_entry_xml, 'InputCode')
     l_obj.MaxPlayTime = PutGetXML.get_int_from_xml(p_entry_xml, 'MaxPlayTime')
     l_obj.Type = PutGetXML.get_text_from_xml(p_entry_xml, 'Type')
     l_obj.Volume = PutGetXML.get_int_from_xml(p_entry_xml, 'Volume')
     return l_obj
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:18,代码来源:pandora.py

示例10: read_base_device_object_xml

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def read_base_device_object_xml(p_pyhouse_obj, p_obj, p_xml):
     """
     Get the BaseUUIDObject 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).
     """
     XmlConfigTools.read_base_UUID_object_xml(p_obj, p_xml)
     try:
         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')
         utils.read_room_reference_xml(p_obj, p_xml)
     except Exception as e_err:
         LOG.error('ERROR in xml_tools.read_base_obj_xml() - {}'.format(e_err))
     return p_obj
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:18,代码来源:device_tools.py

示例11: read_internet_xml

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def read_internet_xml(self, p_house_obj, p_house_xml):
     """
     """
     p_house_obj.Internet = InternetData()
     l_sect = p_house_xml.find('Internet')
     try:
         self.m_external_ip = PutGetXML.get_text_from_xml(p_house_xml, 'ExternalIP')
         self.m_external_delay = PutGetXML.get_int_from_xml(l_sect, 'ExternalDelay')
     except AttributeError:
         LOG.error('internet section missing - using defaults.')
         self.m_external_ip = None
         self.m_external_url = None
         self.m_external_delay = 600
     # Design change - one of these two should work
     try:
         self.m_external_url = PutGetXML.get_text_from_xml(l_sect, 'ExternalUrl')
     except:
         self.m_external_url = PutGetXML.get_text_from_xml(l_sect, 'UrlExternalIP')
     p_house_obj.Internet.ExternalIP = self.m_external_ip
     p_house_obj.Internet.ExternalUrl = self.m_external_url
     p_house_obj.Internet.ExternalDelay = self.m_external_delay
     LOG.debug("Got external IP params.  URL:{}, Delay:{}".format(self.m_external_url, self.m_external_delay))
     try:
         l_list = l_sect.iterfind('DynamicDNS')
     except AttributeError:
         l_list = []
     l_count = 0
     for l_entry in l_list:
         l_dyndns = self.extract_dyn_dns(l_entry)
         l_dyndns.Key = l_count  # Renumber
         p_house_obj.Internet.DynDns[l_count] = l_dyndns
         l_count += 1
     LOG.info('Loaded UpdateUrl:{}, Delay:{}'.format(self.m_external_url, self.m_external_delay))
     return p_house_obj.Internet
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:36,代码来源:upnp.py

示例12: _read_one_zone

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def _read_one_zone(p_xml):
     """
     @param p_xml: XML information for one Zone.
     @return: an IrrigationZone object filled in with data from the XML passed in
     """
     l_obj = IrrigationZoneData()
     XmlConfigTools.read_base_object_xml(l_obj, p_xml)  # Name, Key, Active
     l_obj.Comment = PutGetXML.get_text_from_xml(p_xml, 'Comment')
     l_obj.Duration = PutGetXML.get_time_from_xml(p_xml, 'Duration')
     l_obj.EmitterCount = PutGetXML.get_int_from_xml(p_xml, 'EmitterCount', 0)
     l_obj.EmitterType = PutGetXML.get_text_from_xml(p_xml, 'EmitterType')
     l_obj.Next = PutGetXML.get_int_from_xml(p_xml, 'NextZone', 0)
     l_obj.Previous = PutGetXML.get_int_from_xml(p_xml, 'PrevZone', 0)
     l_obj.Rate = PutGetXML.get_float_from_xml(p_xml, 'Rate', 0.0)
     l_obj.StartTime = PutGetXML.get_time_from_xml(p_xml, 'StartTime')
     #  Expand with much more control data
     return l_obj
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:19,代码来源:irrigation_xml.py

示例13: _read_one_irrigation_schedule

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def _read_one_irrigation_schedule(p_schedule_element):
     """Extract schedule information from a schedule xml element.
     """
     l_obj = ScheduleIrrigationData()
     l_obj.System = PutGetXML.get_text_from_xml(p_schedule_element, 'System')
     l_obj.SystemUUID = None
     l_obj.Duration = PutGetXML.get_int_from_xml(p_schedule_element, 'Duration')
     return l_obj
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:10,代码来源:schedule_xml.py

示例14: extract_dyn_dns

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
 def extract_dyn_dns(self, p_internet_xml):
     l_dyndns_obj = DynDnsData()
     self.read_base_object_xml(l_dyndns_obj, p_internet_xml)
     l_dyndns_obj.UpdateInterval = PutGetXML.get_int_from_xml(p_internet_xml, 'UpdateInterval')
     l_dyndns_obj.UpdateUrl = PutGetXML.get_text_from_xml(p_internet_xml, 'UpdateUrl')
     if g_debug >= 1:
         LOG.debug("internet.extract_dyn_dns() - Name:{}, UpdateInterval:{}, UpdateUrl:{};".format(
                         l_dyndns_obj.Name, l_dyndns_obj.UpdateInterval, l_dyndns_obj.UpdateUrl))
     return l_dyndns_obj
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:11,代码来源:upnp.py

示例15: _read_one_base_schedule

# 需要导入模块: from Modules.Core.Utilities.xml_tools import PutGetXML [as 别名]
# 或者: from Modules.Core.Utilities.xml_tools.PutGetXML import get_int_from_xml [as 别名]
    def _read_one_base_schedule(p_schedule_element):
        """Extract schedule information from a Base schedule xml element.

        ScheduleBaseData()
        """
        l_obj = ScheduleBaseData()
        XmlConfigTools.read_base_UUID_object_xml(l_obj, p_schedule_element)
        l_obj.DOW = PutGetXML.get_int_from_xml(p_schedule_element, 'DayOfWeek', '127')
        l_obj.ScheduleMode = PutGetXML.get_text_from_xml(p_schedule_element, 'ScheduleMode', 'Default Mode')
        l_obj.ScheduleType = PutGetXML.get_text_from_xml(p_schedule_element, 'ScheduleType')
        l_obj.Time = PutGetXML.get_text_from_xml(p_schedule_element, 'Time')
        # if l_obj.ScheduleType == 'LightingDevice':
        #    l_obj.ScheduleType = 'Lighting'
        return l_obj
开发者ID:DBrianKimmel,项目名称:PyHouse,代码行数:16,代码来源:schedule_xml.py


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