def __parse_fc_data(fc_data):
    """Parse the forecast data from the xml section."""
    from buienradar.buienradar import condition_from_code
    fc = []
    for daycnt in range(1, 6):
        daysection = __BRDAYFC % daycnt
        if daysection in fc_data:
            tmpsect = fc_data[daysection]
            fcdatetime = datetime.now(pytz.timezone(__TIMEZONE))
            fcdatetime = fcdatetime.replace(hour=12,
                                            minute=0,
                                            second=0,
                                            microsecond=0)
            # add daycnt days
            fcdatetime = fcdatetime + timedelta(days=daycnt)
            code = tmpsect.get(__BRICOON, []).get(__BRID)
            fcdata = {
                CONDITION: condition_from_code(code),
                TEMPERATURE: __get_float(tmpsect, __BRMAXTEMP),
                MIN_TEMP: __get_float(tmpsect, __BRMINTEMP),
                MAX_TEMP: __get_float(tmpsect, __BRMAXTEMP),
                SUN_CHANCE: __get_int(tmpsect, __BRKANSZON),
                RAIN_CHANCE: __get_int(tmpsect, __BRKANSREGEN),
                RAIN: __get_float(tmpsect, __BRMAXMMREGEN),
                SNOW: __get_float(tmpsect, __BRSNEEUWCMS),
                WINDFORCE: __get_int(tmpsect, __BRWINDKRACHT),
                DATETIME: fcdatetime,
            }
            fcdata[CONDITION][IMAGE] = tmpsect.get(__BRICOON, []).get(__BRTEXT)

            fc.append(fcdata)
    return fc
def __parse_fc_data ( fc_data ) : from buienradar . buienradar import condition_from_code fc = [ ] for daycnt in range ( 1 , 6 ) : daysection = __BRDAYFC % daycnt if daysection in fc_data : tmpsect = fc_data [ daysection ] fcdatetime = datetime . now ( pytz . timezone ( __TIMEZONE ) ) fcdatetime = fcdatetime . replace ( hour = 12 , minute = 0 , second = 0 , microsecond = 0 ) fcdatetime = fcdatetime + timedelta ( days = daycnt ) code = tmpsect . get ( __BRICOON , [ ] ) . get ( __BRID ) fcdata = { CONDITION : condition_from_code ( code ) , TEMPERATURE : __get_float ( tmpsect , __BRMAXTEMP ) , MIN_TEMP : __get_float ( tmpsect , __BRMINTEMP ) , MAX_TEMP : __get_float ( tmpsect , __BRMAXTEMP ) , SUN_CHANCE : __get_int ( tmpsect , __BRKANSZON ) , RAIN_CHANCE : __get_int ( tmpsect , __BRKANSREGEN ) , RAIN : __get_float ( tmpsect , __BRMAXMMREGEN ) , SNOW : __get_float ( tmpsect , __BRSNEEUWCMS ) , WINDFORCE : __get_int ( tmpsect , __BRWINDKRACHT ) , DATETIME : fcdatetime , } fcdata [ CONDITION ] [ IMAGE ] = tmpsect . get ( __BRICOON , [ ] ) . get ( __BRTEXT ) fc . append ( fcdata ) return fc
Parse the forecast data from the xml section.