Encapsulate settings as a class. Make a singleton available.

This commit is contained in:
James Muscat committed 2015-04-14 00:30:22 +01:00
1 parent 074f24bc52
commit da426c1d89
3 files changed
+22 -18

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ import urlparse
import zlib
import zmq.green as zmq
from datetime import datetime
from eddn.conf import Settings
from eddn.conf.Settings import Settings
from eddn.Validator import Validator, ValidationSeverity
from gevent import monkey
+1 -1
View File
@@ -13,7 +13,7 @@ import gevent
import simplejson
import zmq.green as zmq
from bottle import get, run as bottle_run
from eddn.conf import Settings
from eddn.conf.Settings import Settings
from gevent import monkey
monkey.patch_all()
+20 -16
View File
@@ -6,28 +6,32 @@ Created on 15 Nov 2014
from eddn import __version__ as version
EDDN_VERSION = version
class _Settings(object):
###############################################################################
# Relay settings
###############################################################################
EDDN_VERSION = version
RELAY_RECEIVER_BINDINGS = ["tcp://localhost:8500"]
###############################################################################
# Relay settings
###############################################################################
RELAY_SENDER_BINDINGS = ["tcp://*:9500"]
RELAY_RECEIVER_BINDINGS = ["tcp://localhost:8500"]
RELAY_DECOMPRESS_MESSAGES = False
RELAY_SENDER_BINDINGS = ["tcp://*:9500"]
###############################################################################
# Gateway settings
###############################################################################
RELAY_DECOMPRESS_MESSAGES = False
GATEWAY_SENDER_BINDINGS = ["tcp://*:8500"]
###############################################################################
# Gateway settings
###############################################################################
GATEWAY_IP_KEY_SALT = None
GATEWAY_SENDER_BINDINGS = ["tcp://*:8500"]
GATEWAY_JSON_SCHEMAS = {
"http://schemas.elite-markets.net/eddn/commodity/1": "../schemas/commodity-v0.1.json",
"http://schemas.elite-markets.net/eddn/commodity/1/test": "../schemas/commodity-v0.1.json"
}
GATEWAY_IP_KEY_SALT = None
GATEWAY_JSON_SCHEMAS = {
"http://schemas.elite-markets.net/eddn/commodity/1": "../schemas/commodity-v0.1.json",
"http://schemas.elite-markets.net/eddn/commodity/1/test": "../schemas/commodity-v0.1.json"
}
Settings = _Settings()