Moving the "dependency injection printer tools" over to tools/common.py

This commit is contained in:
Christopher Allan Webber
2012-07-14 12:36:40 -05:00
parent 8a22617ffe
commit 35a24fc263
3 changed files with 39 additions and 20 deletions

View File

@@ -27,6 +27,7 @@ from migrate import changeset
from mediagoblin.db.sql.base import GMGTableBase
from mediagoblin.db.sql.util import MigrationManager, RegisterMigration
from mediagoblin.tools.common import CollectingPrinter
# This one will get filled with local migrations
@@ -520,18 +521,6 @@ def _insert_migration3_objects(session):
session.commit()
class CollectingPrinter(object):
def __init__(self):
self.collection = []
def __call__(self, string):
self.collection.append(string)
@property
def combined_string(self):
return u''.join(self.collection)
def create_test_engine():
from sqlalchemy import create_engine
engine = create_engine('sqlite:///:memory:', echo=False)