diff options
| author | LV-426 <lv-426@taproot.org.il> | 2014-12-02 02:20:17 +0200 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2014-12-02 02:34:35 +0200 |
| commit | e97ade2d8cf8c0a927cd96bd07380ea35b499d98 (patch) | |
| tree | 78a0a8474310c9b3c7e042a6ab56ee83e14578a9 /src-py | |
| parent | c041805dcfc7907a4d129bb0e89ddbe764c5f0d8 (diff) | |
simplify config loading, allow missing config values
Diffstat (limited to 'src-py')
| -rw-r--r-- | src-py/rhizi_server.py | 20 |
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') |
