def __parse_loc_data(loc_data, result):
result[DATA] = {ATTRIBUTION: ATTRIBUTION_INFO,<EOL>FORECAST: [],<EOL>PRECIPITATION_FORECAST: None}<EOL>for key, [value, func] in SENSOR_TYPES.items():<EOL><INDENT>result[DATA][key] = None<EOL>try:<EOL><INDENT>from buienradar.buienradar import condition_from_code<EOL>sens_data = loc_data[value]<EOL>if key == CONDITION:<EOL><INDENT>code = sens_data[__BRID][:<NUM_LIT:1>]<EOL>result[DATA][CONDITION] = condition_from_code(code)<EOL>result[DATA][CONDITION][IMAGE] = sens_data[__BRTEXT]<EOL><DEDENT>else:<EOL><INDENT>if key == STATIONNAME:<EOL><INDENT>name = sens_data[__BRTEXT].replace("<STR_LIT>", "<STR_LIT>")<EOL>name = name.strip()<EOL>name += "<STR_LIT>" % loc_data[__BRSTATIONCODE]<EOL>result[DATA][key] = name<EOL><DEDENT>else:<EOL><INDENT>if func is not None:<EOL><INDENT>result[DATA][key] = func(sens_data)<EOL><DEDENT>else:<EOL><INDENT>result[DATA][key] = sens_data<EOL><DEDENT><DEDENT><DEDENT><DEDENT>except KeyError:<EOL><INDENT>if result[MESSAGE] is None:<EOL><INDENT>result[MESSAGE] = "<STR_LIT>"<EOL><DEDENT>result[MESSAGE] += "<STR_LIT>" % value<EOL>log.warning("<STR_LIT>"<EOL>"<STR_LIT>", key)<EOL><DEDENT><DEDENT>result[SUCCESS] = True<EOL>return result<EOL>
Parse the xml data from selected weatherstation.