Пример #1
0
def _table_rows(datapoints):
    def format_row(result, value):
        return result + ("|{:>" + str(CELL_SIZE) + "}").format(value)

    return [
        reduce(format_row, [
            pick_hour(dp['instant']) + 'h',
            symbol_for(dp['symbol']),
            str(dp['temperature']) + '°',
            space_for_zero(dp['precip']['value']),
            bar_for(dp['precip']['min']) + bar_for(dp['precip']['value']) +
            bar_for(dp['precip']['max']),
            str(dp['wind']['speed']) + arrow_for(dp['wind']['direction'])
        ], '') for dp in datapoints
    ]
Пример #2
0
def _table_rows(datapoints):
    def format_row(result, value):
        return result + ("|{:>" + str(CELL_SIZE) + "}").format(value)

    return [
        reduce(
            format_row,
            [
                pick_hour(dp["instant"]) + "h",
                symbol_for(dp["symbol"]),
                str(dp["temperature"]) + "°",
                space_for_zero(dp["precip"]["value"]),
                bar_for(dp["precip"]["min"]) + bar_for(dp["precip"]["value"]) + bar_for(dp["precip"]["max"]),
                str(dp["wind"]["speed"]) + arrow_for(dp["wind"]["direction"]),
            ],
            "",
        )
        for dp in datapoints
    ]
Пример #3
0
def symbol_row(datapoints, columns):
    return [
        format_row([symbol_for(dp['symbol']) + ' ' for dp in datapoints],
                   columns)
    ]
Пример #4
0
def symbol_row(datapoints, columns):
    return [format_row([symbol_for(dp["symbol"]) + " " for dp in datapoints], columns)]