summaryrefslogtreecommitdiff
path: root/opendc/util
diff options
context:
space:
mode:
authorLeon Overweel <l.overweel@gmail.com>2017-01-25 16:26:05 +0100
committerGitHub <noreply@github.com>2017-01-25 16:26:05 +0100
commit1b942d9e9d5b2c08d09fb8f294437ea99a889962 (patch)
treeecce75c171445755e20e2930682b1c78bbd9e15e /opendc/util
parent8a8279ec685311ceffd2aadb1dc7c76e8637f043 (diff)
parent532ecf39611113ac59b084935f68016bd353e73f (diff)
Merge pull request #1 from sacheendra/master
New static file locations. Config file location from command line. Port binding.
Diffstat (limited to 'opendc/util')
-rw-r--r--opendc/util/database.py3
-rw-r--r--opendc/util/rest.py2
2 files changed, 3 insertions, 2 deletions
diff --git a/opendc/util/database.py b/opendc/util/database.py
index 16fff5f0..2ef8b982 100644
--- a/opendc/util/database.py
+++ b/opendc/util/database.py
@@ -1,9 +1,10 @@
from datetime import datetime
import json
import sqlite3
+import sys
# Get keys from config file
-with open('/var/www/opendc.ewi.tudelft.nl/web-server/config/keys.json') as file:
+with open(sys.argv[1]) as file:
KEYS = json.load(file)
DATETIME_STRING_FORMAT = '%Y-%m-%dT%H:%M:%S'
diff --git a/opendc/util/rest.py b/opendc/util/rest.py
index a52b0082..65747762 100644
--- a/opendc/util/rest.py
+++ b/opendc/util/rest.py
@@ -7,7 +7,7 @@ from oauth2client import client, crypt
from opendc.util import exceptions, parameter_checker
-with open('/var/www/opendc.ewi.tudelft.nl/web-server/config/keys.json') as file:
+with open(sys.argv[1]) as file:
KEYS = json.load(file)
class Request(object):