mirror of
https://github.com/EDCD/EDDN.git
synced 2026-11-20 01:42:25 +03:00
Allow overriding settings with config file.
This commit is contained in:
1 parent
da426c1d89
commit
f178fec08d
1 file changed
+8
@@ -4,6 +4,7 @@ Created on 15 Nov 2014
|
||||
@author: james
|
||||
'''
|
||||
|
||||
import simplejson
|
||||
from eddn import __version__ as version
|
||||
|
||||
|
||||
@@ -34,4 +35,11 @@ class _Settings(object):
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1/test": "../schemas/commodity-v0.1.json"
|
||||
}
|
||||
|
||||
def loadFrom(self, fileName):
|
||||
f = open(fileName, 'r')
|
||||
conf = simplejson.load(f)
|
||||
for key, value in conf:
|
||||
if key in self.__dict__:
|
||||
self.__dict__[key] = value
|
||||
|
||||
Settings = _Settings()
|
||||
Reference in new issue
Block a user