Refactor app configuration to use rattail.config.make_config().

Yay, one step closer to removing edbob completely.
This commit is contained in:
Lance Edgar 2015-08-16 19:54:27 -05:00
parent 673fcaed97
commit f5b22b1256

View file

@ -31,11 +31,10 @@ import logging
import sqlalchemy as sa
import edbob
from edbob.pyramid.forms.formalchemy import TemplateEngine
import rattail.db
from rattail.config import RattailConfig
from rattail.config import make_config
from rattail.exceptions import ConfigurationError
from rattail.db.util import get_engines
from rattail.db.continuum import configure_versioning
@ -66,9 +65,7 @@ def make_rattail_config(settings):
if not path or not os.path.exists(path):
raise ConfigurationError("Please set 'edbob.config' in [app:main] section of config "
"to the path of your config file. Lame, but necessary.")
edbob.init('rattail', path)
log.info("using rattail config file: {0}".format(path))
rattail_config = RattailConfig(edbob.config)
rattail_config = make_config(path)
settings['rattail_config'] = rattail_config
rattail_engines = settings.get('rattail_engines')
@ -91,7 +88,6 @@ def make_rattail_config(settings):
# Configure (or not) Continuum versioning.
configure_versioning(rattail_config)
return rattail_config