Changeset - beb8568e564b
[Not reviewed]
0 2 0
Lance Edgar - 9 years ago 2015-12-04 00:27:37
ledgar@sacfoodcoop.com
Tweak some core config init, to avoid leveraging db settings.
2 files changed with 7 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rattail/db/config.py
Show inline comments
 
@@ -73,7 +73,7 @@ def get_engines(config, section='rattail.db'):
 
    :returns: A dictionary of SQLAlchemy engine instances, with keys matching
 
       those found in config.
 
    """
 
    keys = config.get(section, 'keys')
 
    keys = config.get(section, 'keys', usedb=False)
 
    if keys:
 
        keys = keys.split(',')
 
    else:
 
@@ -122,9 +122,9 @@ def configure_session(config, session):
 
    """
 
    from rattail.db.changes import record_changes
 

	
 
    if config.getbool('rattail.db', 'changes.record'):
 
    if config.getbool('rattail.db', 'changes.record', usedb=False):
 
        ignore_role_changes = config.getbool(
 
            'rattail.db', 'changes.ignore_roles', default=True)
 
            'rattail.db', 'changes.ignore_roles', default=True, usedb=False)
 
        record_changes(session, ignore_role_changes)
 

	
 

	
 
@@ -132,7 +132,7 @@ def configure_versioning(config, manager=None, plugins=None, **kwargs):
 
    """
 
    Configure Continuum versioning.
 
    """
 
    if not config.getbool('rattail.db', 'versioning.enabled', default=False):
 
    if not config.getbool('rattail.db', 'versioning.enabled', default=False, usedb=False):
 
        return
 

	
 
    try:
rattail/logging.py
Show inline comments
 
@@ -28,6 +28,7 @@ from __future__ import absolute_import
 

	
 
import os
 
import sys
 
import copy
 
import datetime
 
import socket
 
import getpass
 
@@ -93,7 +94,8 @@ class TimeConverter(object):
 
    """
 

	
 
    def __init__(self, config):
 
        self.config = config
 
        self.config = copy.copy(config)
 
        self.config.usedb = False
 

	
 
    def __call__(self, value):
 
        value = datetime.datetime.utcfromtimestamp(value)
0 comments (0 inline, 0 general)