From c47c043e76ac037456b8e966a5f9d60a151e3120 Mon Sep 17 00:00:00 2001 From: Jaisen Mathai Date: Mon, 12 Oct 2015 19:40:20 -0700 Subject: [PATCH] Use absolute path for config file so it works with apps like Hazel --- elodie/geolocation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/elodie/geolocation.py b/elodie/geolocation.py index a7a25f6..b0b6ee4 100644 --- a/elodie/geolocation.py +++ b/elodie/geolocation.py @@ -7,11 +7,12 @@ def reverse_lookup(lat, lon): if(lat is None or lon is None): return None - if not path.exists('./config.ini'): + config_file = '%s/config.ini' % path.dirname(path.dirname(path.abspath(__file__))) + if not path.exists(config_file): return None config = ConfigParser() - config.read('./config.ini') + config.read(config_file) if('MapQuest' not in config.sections()): return None