Add an Environment class

This commit is contained in:
Rafa de la Torre
2016-09-30 11:21:35 +02:00
parent 3a6cc4c364
commit 1e6ee8d5c1

View File

@@ -0,0 +1,13 @@
class Environment:
def __init__(self, server_config_storage):
self._server_config_storage = server_config_storage
def get(self):
server_config = self._server_config_storage.get('server_conf')
if not server_config or 'environment' not in server_config:
environment = 'development'
else:
environment = server_config['environment']
return environment