summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLV-426 <lv-426@taproot.org.il>2014-12-02 02:20:17 +0200
committerLV-426 <lv-426@taproot.org.il>2014-12-02 02:34:35 +0200
commite97ade2d8cf8c0a927cd96bd07380ea35b499d98 (patch)
tree78a0a8474310c9b3c7e042a6ab56ee83e14578a9
parentc041805dcfc7907a4d129bb0e89ddbe764c5f0d8 (diff)
simplify config loading, allow missing config values
-rw-r--r--src-py/rhizi_server.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/src-py/rhizi_server.py b/src-py/rhizi_server.py
index cef57f36..bda762a3 100644
--- a/src-py/rhizi_server.py
+++ b/src-py/rhizi_server.py
@@ -27,10 +27,16 @@ class Config(object):
#
# TODO: config option documentation
#
- ret.neo4j_url = cfg['neo4j_url']
- ret.listen_address = cfg['listen_address']
- ret.listen_port = cfg['listen_port']
+ # htpasswd_path
+ # listen_address
+ # listen_port
+ # neo4j_url
+ # root_path
+ for k, v in cfg.items():
+ ret.__setattr__(k, v)
+
+ ret.__setattr__('config_dir', os.path.dirname(file_path)) # bypass prop restriction
return ret
@property
@@ -41,6 +47,14 @@ class Config(object):
def tx_api_path(self):
return '/db/data/transaction'
+ @property
+ def config_dir_path(self):
+ return self.config_dir
+
+ @property
+ def secret_key(self):
+ return self.SECRET_KEY
+
def init_logging():
log = logging.getLogger('rhizi')