use WTTR_IP2LOCATION_KEY_FILE ot override ip2location key location

pull/456/head
Igor Chubin 5 years ago
parent fbf4aad445
commit 64322d7b61

@ -83,7 +83,9 @@ PLAIN_TEXT_AGENTS = [
PLAIN_TEXT_PAGES = [':help', ':bash.function', ':translation', ':iterm2']
_IP2LOCATION_KEY_FILE = os.environ['HOME'] + '/.ip2location.key'
_IP2LOCATION_KEY_FILE = os.environ.get(
"WTTR_IP2LOCATION_KEY_FILE",
os.environ['HOME'] + '/.ip2location.key')
IP2LOCATION_KEY = None
if os.path.exists(_IP2LOCATION_KEY_FILE):
IP2LOCATION_KEY = open(_IP2LOCATION_KEY_FILE, 'r').read().strip()

Loading…
Cancel
Save