Use absolute path for config file so it works with apps like Hazel

This commit is contained in:
Jaisen Mathai 2015-10-12 19:40:20 -07:00
parent 3ac3b1a624
commit c47c043e76
1 changed files with 3 additions and 2 deletions

View File

@ -7,11 +7,12 @@ def reverse_lookup(lat, lon):
if(lat is None or lon is None): if(lat is None or lon is None):
return 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 return None
config = ConfigParser() config = ConfigParser()
config.read('./config.ini') config.read(config_file)
if('MapQuest' not in config.sections()): if('MapQuest' not in config.sections()):
return None return None