Exemple #1
0
 def read_location_xml(p_pyhouse_obj):
     """
     @param p_house_xml: is the config file xml for a house.
     """
     l_obj = LocationData()
     l_obj.RiseSet = RiseSetData()
     p_pyhouse_obj.House.Location = l_obj
     try:
         l_xml = p_pyhouse_obj.Xml.XmlRoot.find('HouseDivision')
         if l_xml is None:
             return l_obj
         l_xml = l_xml.find('LocationSection')
         if l_xml is None:
             return l_obj
         l_obj.Street = PutGetXML.get_text_from_xml(l_xml, 'Street', 'Main')
         l_obj.City = PutGetXML.get_text_from_xml(l_xml, 'City', 'Gotham')
         l_obj.State = PutGetXML.get_text_from_xml(l_xml, 'State', 'Confusion')
         l_obj.ZipCode = PutGetXML.get_text_from_xml(l_xml, 'ZipCode', '99999')
         l_obj.Region = PutGetXML.get_text_from_xml(l_xml, 'Region', 'America')
         l_obj.Phone = PutGetXML.get_text_from_xml(l_xml, 'Phone', '800-555-1212')
         l_obj.Latitude = PutGetXML.get_float_from_xml(l_xml, 'Latitude', 40.0)
         l_obj.Longitude = PutGetXML.get_float_from_xml(l_xml, 'Longitude', 100.0)
         l_obj.Elevation = PutGetXML.get_float_from_xml(l_xml, 'Elevation', 10.0)
         l_obj.TimeZoneName = PutGetXML.get_text_from_xml(l_xml, 'TimeZoneName', 'America/New_York')
     except AttributeError as e_err:
         LOG.error('ERROR getting location Data - {}'.format(e_err))
     p_pyhouse_obj.House.Location = l_obj
     LOG.info('Loaded location information.')
     return l_obj
Exemple #2
0
 def read_location_xml(p_pyhouse_obj):
     """
     @param p_house_xml: is the config file xml for a house.
     """
     l_obj = LocationData()
     l_obj.RiseSet = RiseSetData()
     p_pyhouse_obj.House.Location = l_obj
     try:
         l_xml = p_pyhouse_obj.Xml.XmlRoot.find('HouseDivision')
         if l_xml is None:
             return l_obj
         l_xml = l_xml.find('LocationSection')
         if l_xml is None:
             return l_obj
         l_obj.Street = PutGetXML.get_text_from_xml(l_xml, 'Street')
         l_obj.City = PutGetXML.get_text_from_xml(l_xml, 'City')
         l_obj.State = PutGetXML.get_text_from_xml(l_xml, 'State')
         l_obj.ZipCode = PutGetXML.get_text_from_xml(l_xml, 'ZipCode', '99999')
         l_obj.Region = PutGetXML.get_text_from_xml(l_xml, 'Region', 'America')
         l_obj.Phone = PutGetXML.get_text_from_xml(l_xml, 'Phone')
         l_obj.Latitude = PutGetXML.get_float_from_xml(l_xml, 'Latitude')
         l_obj.Longitude = PutGetXML.get_float_from_xml(l_xml, 'Longitude')
         l_obj.Elevation = PutGetXML.get_float_from_xml(l_xml, 'Elevation', 10)
         l_obj.TimeZoneName = PutGetXML.get_text_from_xml(l_xml, 'TimeZoneName', 'America/New_York')
     except AttributeError as e_err:
         LOG.error('ERROR getting location Data - {}'.format(e_err))
     p_pyhouse_obj.House.Location = l_obj
     LOG.info('Loaded location information.')
     return l_obj
 def load_earth(p_pyhouse_obj):
     l_loc = LocationData()
     l_loc.Region = TESTING_LOCATION_REGION
     l_loc.Latitude = float(TESTING_LOCATION_LATITUDE)
     l_loc.Longitude = float(TESTING_LOCATION_LONGITUDE)
     l_loc.TimeZoneName = TESTING_LOCATION_TIME_ZONE_NAME
     l_loc.Elevation = float(TESTING_LOCATION_ELEVATION)
     p_pyhouse_obj.House.Location = l_loc
     p_pyhouse_obj.House.Name = TESTING_HOUSE_NAME
     return p_pyhouse_obj
Exemple #4
0
 def load_earth(p_pyhouse_obj):
     l_loc = LocationData()
     l_loc.Region = T_REGION
     l_loc.Latitude = T_LATITUDE
     l_loc.Longitude = T_LONGITUDE
     l_loc.TimeZoneName = T_TIMEZONE_NAME
     l_loc.Elevation = T_ELEVATION
     p_pyhouse_obj.House.Location = l_loc
     p_pyhouse_obj.House.Name = T_NAME
     return p_pyhouse_obj
 def load_earth(p_pyhouse_obj):
     l_loc = LocationData()
     l_loc.Region = T_REGION
     l_loc.Latitude = T_LATITUDE
     l_loc.Longitude = T_LONGITUDE
     l_loc.TimeZoneName = T_TIMEZONE_NAME
     l_loc.Elevation = T_ELEVATION
     p_pyhouse_obj.House.Location = l_loc
     p_pyhouse_obj.House.Name = T_NAME
     return p_pyhouse_obj