summaryrefslogtreecommitdiffstats
path: root/examples/weather
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-05 19:52:40 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-05 19:52:40 +0200
commitf5e57cdda39dec514e012b3c6a9fb07e5d7c9c80 (patch)
treebbc5dfdde73a70296d05844f3a6081e08203c7b0 /examples/weather
parentsupport more than 64 monitors with randr (diff)
downloadblueshift-f5e57cdda39dec514e012b3c6a9fb07e5d7c9c80.tar.gz
blueshift-f5e57cdda39dec514e012b3c6a9fb07e5d7c9c80.tar.bz2
blueshift-f5e57cdda39dec514e012b3c6a9fb07e5d7c9c80.tar.xz
fix m bug
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--examples/weather9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/weather b/examples/weather
index 3fac3e4..e65d0cf 100644
--- a/examples/weather
+++ b/examples/weather
@@ -60,10 +60,11 @@ if metar is not None:
for condition in conditions:
if condition in modifiers:
dayness *= modifiers[condition]
- _bound, visibility = metar[1]
- if (visibility_max is not None) and (visibility is not None):
- if visibility < visibility_max:
- dayness *= visibility / visibility_max
+ if metar[1] is not None:
+ _bound, visibility = metar[1]
+ if (visibility_max is not None) and (visibility is not None):
+ if visibility < visibility_max:
+ dayness *= visibility / visibility_max
# Calculation of the colour temperature.
temp = temperature_day * dayness + temperature_night * (1 - dayness)