Commit 979ce95c authored by chrissi^'s avatar chrissi^

Adapt stand-alone desktop use

Signed-off-by: chrissi^'s avatarChris Fiege <>
parent c0c13a98
/home/chris/Projekte/wetterbaer/ > /dev/null
......@@ -6,21 +6,24 @@ import json
from requests.packages.urllib3.exceptions import InsecureRequestWarning
src = ""
src = "/home/chris/Projekte/wetterbaer/cache.json"
weather = json.loads(requests.get(src, verify=False).text)
with open(src) as fh:
weather = json.load(fh)
flags = ""
if weather["percipitation_rate"]["value"] > 0:
flags += u" 🌧"
print u"{}°C, {}%rH {}".format(weather["t_curr"]["value"], weather["h_curr"]["value"], flags).encode('utf-8')
print u"{}°C {}".format(weather["t_curr"]["value"], flags).encode('utf-8')
except requests.exceptions.SSLError:
print "SSLError!"
except requests.exceptions.ConnectionError:
print "ConnError!"
except KeyError:
print "JsonError"
except IOError:
print "IOError"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment