aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Schneider <nils@nilsschneider.net>2014-03-30 13:19:54 +0200
committerNils Schneider <nils@nilsschneider.net>2014-03-30 13:20:15 +0200
commitfbc5c636dfc978877503bd67e14bc445edbb6fb6 (patch)
tree937c4d71d0aa6b8600ea36ec565845ded5f66d13
parentd6bd31f8d0c2fdca0c4b23434d4854d93b15fe50 (diff)
alfred.py: ignore non-parseable locations
-rwxr-xr-xalfred.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/alfred.py b/alfred.py
index 086ebc7..c92bc12 100755
--- a/alfred.py
+++ b/alfred.py
@@ -13,7 +13,10 @@ class alfred:
for mac,node in alfred_data.items():
node_alias = {}
if 'location' in node:
- node_alias['gps'] = str(node['location']['latitude']) + ' ' + str(node['location']['longitude'])
+ try:
+ node_alias['gps'] = str(node['location']['latitude']) + ' ' + str(node['location']['longitude'])
+ except:
+ pass
try:
node_alias['firmware'] = node['software']['firmware']['release']