~abompard/mailman/import21

« back to all changes in this revision

Viewing changes to src/mailman/database/base.py

  • Committer: Aurélien Bompard
  • Date: 2014-01-27 10:58:16 UTC
  • mfrom: (7215.2.17 3.0)
  • Revision ID: aurelien@bompard.org-20140127105816-xptlvnpr3ixak5d2
Merge from the main branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2013 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 2006-2014 by the Free Software Foundation, Inc.
2
2
#
3
3
# This file is part of GNU Mailman.
4
4
#
27
27
import sys
28
28
import logging
29
29
 
30
 
from flufl.lock import Lock
31
30
from lazr.config import as_boolean
32
31
from pkg_resources import resource_listdir, resource_string
33
32
from storm.cache import GenerationalCache
60
59
        self.url = None
61
60
        self.store = None
62
61
 
63
 
    def initialize(self, debug=None):
64
 
        """See `IDatabase`."""
65
 
        # Serialize this so we don't get multiple processes trying to create
66
 
        # the database at the same time.
67
 
        with Lock(os.path.join(config.LOCK_DIR, 'dbcreate.lck')):
68
 
            self._create(debug)
69
 
 
70
62
    def begin(self):
71
63
        """See `IDatabase`."""
72
64
        # Storm takes care of this for us.
117
109
        """
118
110
        pass
119
111
 
120
 
    def _create(self, debug):
 
112
    def initialize(self, debug=None):
 
113
        """See `IDatabase`."""
121
114
        # Calculate the engine url.
122
115
        url = expand(config.database.url, config.paths)
123
116
        log.debug('Database url: %s', url)