summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/database.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-07-25 17:48:47 -0400
committerBarry Warsaw2012-07-25 17:48:47 -0400
commitc15688eb88db81340a7602093134e10e8927b2fc (patch)
tree11fc83bf64a436fd39492441e3383a109b02d867 /src/mailman/interfaces/database.py
parent3ecb13338d36f7f4bccb609bdb2d54ff11359f8f (diff)
downloadmailman-c15688eb88db81340a7602093134e10e8927b2fc.tar.gz
mailman-c15688eb88db81340a7602093134e10e8927b2fc.tar.zst
mailman-c15688eb88db81340a7602093134e10e8927b2fc.zip
Diffstat (limited to 'src/mailman/interfaces/database.py')
-rw-r--r--src/mailman/interfaces/database.py21
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
+ """