in theory that part of cfg file should be totally ignored if commented out
i changed this part a bit (removed print that separated sections and added strip() to deal with cases where the value is padded with spaces for whatever reason and ruins formatting
Code:
for (k,xml) in data:
for x in xml.findall( k ):
for ln in format[k]:
print ln[0].format( *[ x.findtext( './/'+i ).strip() for i in ln[1] ] )
with this:
Code:
# current weather
! .//current_observation
[CYAN]Location:[END] [B][GREEN]{display_location/full}[END]
[CYAN]Time:[END] [B][GREEN]{observation_time_rfc822}[END]
[CYAN]Conditions:[END] [B][YELLOW]{weather}[END]
[CYAN]Temperature:[END] [B][YELLOW]{temp_c}°C[END], feels like [B][YELLOW]{feelslike_c}°C[END]
[CYAN]Wind:[END] [B][YELLOW]{wind_kph} km/h[END], from the {wind_dir}
[CYAN]Precipitation:[END] [B][YELLOW]{precip_1hr_metric} mm[END] in 1hr, [B][YELLOW]{precip_today_metric} mm[END] today
[CYAN]Pressure:[END] [B][YELLOW]{pressure_mb} hPa[END]
[CYAN]Humidity:[END] [B][YELLOW]{relative_humidity}[END]
[CYAN]Dew point:[END] [B][YELLOW]{dewpoint_c}°C[END]
[CYAN]Visibility:[END] [B][YELLOW]{visibility_km} km[END]
# forecast in text format
#! .//txt_forecast/forecastdays/forecastday
#[CYAN]{title}:[END]
# {fcttext_metric}
# forecast in simple format
! .//simpleforecast/forecastdays/forecastday
[YELLOW]{weekday}, {date/monthname} {date/day}, {date/year}:[END]
[BLUE]{conditions}, high {high/celsius}°C, low {low/celsius}°C
Winds {avewind/kph} km/h from the {avewind/dir}, max {maxwind/kph} km/h[END]
i get this, obviously in bold/color:
Code:
Location: Falun, Sweden
Time: Sun, 06 Oct 2013 18:47:04 +0200
Conditions: Clear
Temperature: 12.4°C, feels like 12.4°C
Wind: 3.2 km/h, from the SE
Precipitation: 0 mm in 1hr, 0 mm today
Pressure: 1012 hPa
Humidity: 74%
Dew point: 8°C
Visibility: 10.0 km
Sunday, October 6, 2013:
Partly Cloudy, high 14°C, low 7°C
Winds 13 km/h from the SW, max 14 km/h
Monday, October 7, 2013:
Mostly Cloudy, high 16°C, low 10°C
Winds 11 km/h from the WSW, max 16 km/h
Tuesday, October 8, 2013:
Rain, high 15°C, low 8°C
Winds 14 km/h from the SW, max 18 km/h
Wednesday, October 9, 2013:
Overcast, high 14°C, low 3°C
Winds 16 km/h from the SW, max 22 km/h
Bookmarks