diff options
| author | Abhilash Raj | 2014-09-24 16:06:07 +0530 |
|---|---|---|
| committer | Abhilash Raj | 2014-09-24 16:06:07 +0530 |
| commit | f83f2a07e79c13aef592f779cf112340707cf5c0 (patch) | |
| tree | f7e0b4cd273fa24ad5c6048d39a4b8aa7521bc44 /src/mailman/database/base.py | |
| parent | 20b41091f37bbf61c646c2e1586b73269304da2c (diff) | |
| parent | eef73255db608785a55c055cbbfb800603671ff6 (diff) | |
| download | mailman-f83f2a07e79c13aef592f779cf112340707cf5c0.tar.gz mailman-f83f2a07e79c13aef592f779cf112340707cf5c0.tar.zst mailman-f83f2a07e79c13aef592f779cf112340707cf5c0.zip | |
Diffstat (limited to 'src/mailman/database/base.py')
| -rw-r--r-- | src/mailman/database/base.py | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/mailman/database/base.py b/src/mailman/database/base.py index c4b04b329..e360dcedf 100644 --- a/src/mailman/database/base.py +++ b/src/mailman/database/base.py @@ -45,10 +45,6 @@ class SABaseDatabase: Use this as a base class for your DB-Specific derived classes. """ - # Tag used to distinguish the database being used. Override this in base - # classes. - TAG = '' - def __init__(self): self.url = None self.store = None @@ -66,16 +62,6 @@ class SABaseDatabase: """See `IDatabase`.""" self.store.rollback() - def _database_exists(self): - """Return True if the database exists and is initialized. - - Return False when Mailman needs to create and initialize the - underlying database schema. - - Base classes *must* override this. - """ - raise NotImplementedError - def _pre_reset(self, store): """Clean up method for testing. @@ -103,10 +89,6 @@ class SABaseDatabase: """ pass - # XXX Abhilash removed teh _prepare() method. Is that because SA takes - # care of this for us? If so, then the comment below must be updated. - # For reference, the SQLite bug is marked "won't fix". - def initialize(self, debug=None): """See `IDatabase`.""" # Calculate the engine url. @@ -132,37 +114,3 @@ class SABaseDatabase: session = sessionmaker(bind=self.engine) self.store = session() self.store.commit() - - # XXX We should probably rename load_migrations() and perhaps get rid of - # load_sql(). The latter is never called any more. - - def load_migrations(self, until=None): - """Load schema migrations. - - :param until: Load only the migrations up to the specified timestamp. - With default value of None, load all migrations. - :type until: string - """ - from mailman.database.model import Model - Model.metadata.create_all(self.engine) - - def load_sql(self, store, sql): - """Load the given SQL into the store. - - :param store: The Storm store to load the schema into. - :type store: storm.locals.Store` - :param sql: The possibly multi-line SQL to load. - :type sql: string - """ - # Discard all blank and comment lines. - lines = (line for line in sql.splitlines() - if line.strip() != '' and line.strip()[:2] != '--') - sql = NL.join(lines) - for statement in sql.split(';'): - if statement.strip() != '': - store.execute(statement + ';') - - - @staticmethod - def _make_temporary(): - raise NotImplementedError |
