Use absolute path for config.json

This commit is contained in:
Adam Goldsmith 2018-08-13 15:46:00 -04:00
parent 7650ff4179
commit 848520f327

View File

@ -1,6 +1,7 @@
import csv import csv
import json import json
import urllib3 import urllib3
import os
import sys import sys
from io import StringIO from io import StringIO
from xml.etree import ElementTree as ET from xml.etree import ElementTree as ET
@ -11,7 +12,8 @@ from passwords import *
# it's fine, ssl certs are for losers anyway # it's fine, ssl certs are for losers anyway
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
config = json.load(open("config.json")) config = json.load(
open(os.path.dirname(os.path.abspath(__file__)) + "/config.json"))
ET.register_namespace("hid", "http://www.hidglobal.com/VertX") ET.register_namespace("hid", "http://www.hidglobal.com/VertX")
ET.register_namespace("hid", "http://www.hidcorp.com/VertX") ET.register_namespace("hid", "http://www.hidcorp.com/VertX")