Use absolute path for config file so it works with apps like Hazel
This commit is contained in:
parent
3ac3b1a624
commit
c47c043e76
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue