diff options
Diffstat (limited to 'src/mailman/interfaces/database.py')
| -rw-r--r-- | src/mailman/interfaces/database.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/mailman/interfaces/database.py b/src/mailman/interfaces/database.py index 316d5be49..a74ddd71f 100644 --- a/src/mailman/interfaces/database.py +++ b/src/mailman/interfaces/database.py @@ -23,6 +23,7 @@ __metaclass__ = type __all__ = [ 'DatabaseError', 'IDatabase', + 'IDatabaseFactory', ] @@ -49,12 +50,6 @@ class IDatabase(Interface): configuration file setting. """ - def _reset(): - """Reset the database to its pristine state. - - This is only used by the test framework. - """ - def _make_temporary(): """Make a temporary database. @@ -79,3 +74,17 @@ class IDatabase(Interface): store = Attribute( """The underlying Storm store on which you can do queries.""") + + + +class IDatabaseFactory(Interface): + "Interface for creating new databases.""" + + def create(): + """Return a new `IDatabase`. + + The database will be initialized and all migrations will be loaded. + + :return: A new database. + :rtype: IDatabase + """ |
