summaryrefslogtreecommitdiff
path: root/src/mailman/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/config')
-rw-r--r--src/mailman/config/alembic.cfg20
-rw-r--r--src/mailman/config/config.py13
-rw-r--r--src/mailman/config/configure.zcml20
-rw-r--r--src/mailman/config/schema.cfg9
4 files changed, 29 insertions, 33 deletions
diff --git a/src/mailman/config/alembic.cfg b/src/mailman/config/alembic.cfg
new file mode 100644
index 000000000..09fd03f58
--- /dev/null
+++ b/src/mailman/config/alembic.cfg
@@ -0,0 +1,20 @@
+# Copyright (C) 2014 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman. If not, see <http://www.gnu.org/licenses/>.
+
+[alembic]
+# Path to Alembic migration scripts.
+script_location: mailman.database:alembic
diff --git a/src/mailman/config/config.py b/src/mailman/config/config.py
index e8c8ebc8b..649d6c5e1 100644
--- a/src/mailman/config/config.py
+++ b/src/mailman/config/config.py
@@ -33,7 +33,7 @@ import sys
from ConfigParser import SafeConfigParser
from flufl.lock import Lock
from lazr.config import ConfigSchema, as_boolean
-from pkg_resources import resource_filename, resource_stream, resource_string
+from pkg_resources import resource_stream, resource_string
from string import Template
from zope.component import getUtility
from zope.event import notify
@@ -46,7 +46,7 @@ from mailman.interfaces.configuration import (
ConfigurationUpdatedEvent, IConfiguration, MissingConfigurationFileError)
from mailman.interfaces.languages import ILanguageManager
from mailman.utilities.filesystem import makedirs
-from mailman.utilities.modules import call_name
+from mailman.utilities.modules import call_name, expand_path
SPACE = ' '
@@ -141,7 +141,7 @@ class Configuration:
def _expand_paths(self):
"""Expand all configuration paths."""
# Set up directories.
- bin_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
+ bin_dir = os.path.abspath(os.path.dirname(sys.executable))
# Now that we've loaded all the configuration files we're going to
# load, set up some useful directories based on the settings in the
# configuration file.
@@ -304,12 +304,7 @@ def external_configuration(path):
:return: A `ConfigParser` instance.
"""
# Is the context coming from a file system or Python path?
- if path.startswith('python:'):
- resource_path = path[7:]
- package, dot, resource = resource_path.rpartition('.')
- cfg_path = resource_filename(package, resource + '.cfg')
- else:
- cfg_path = path
+ cfg_path = expand_path(path)
parser = SafeConfigParser()
files = parser.read(cfg_path)
if files != [cfg_path]:
diff --git a/src/mailman/config/configure.zcml b/src/mailman/config/configure.zcml
index f9b9cb093..24061f0f0 100644
--- a/src/mailman/config/configure.zcml
+++ b/src/mailman/config/configure.zcml
@@ -40,20 +40,6 @@
factory="mailman.model.requests.ListRequests"
/>
- <adapter
- for="mailman.interfaces.database.IDatabase"
- provides="mailman.interfaces.database.ITemporaryDatabase"
- factory="mailman.database.sqlite.make_temporary"
- name="sqlite"
- />
-
- <adapter
- for="mailman.interfaces.database.IDatabase"
- provides="mailman.interfaces.database.ITemporaryDatabase"
- factory="mailman.database.postgresql.make_temporary"
- name="postgres"
- />
-
<utility
provides="mailman.interfaces.bounce.IBounceProcessor"
factory="mailman.model.bounce.BounceProcessor"
@@ -72,12 +58,6 @@
/>
<utility
- provides="mailman.interfaces.database.IDatabaseFactory"
- factory="mailman.database.factory.DatabaseTemporaryFactory"
- name="temporary"
- />
-
- <utility
provides="mailman.interfaces.domain.IDomainManager"
factory="mailman.model.domain.DomainManager"
/>
diff --git a/src/mailman/config/schema.cfg b/src/mailman/config/schema.cfg
index d7508a533..ef158d6c5 100644
--- a/src/mailman/config/schema.cfg
+++ b/src/mailman/config/schema.cfg
@@ -204,9 +204,6 @@ class: mailman.database.sqlite.SQLiteDatabase
url: sqlite:///$DATA_DIR/mailman.db
debug: no
-# The module path to the migrations modules.
-migrations_path: mailman.database.schema
-
[logging.template]
# This defines various log settings. The options available are:
#
@@ -229,6 +226,7 @@ migrations_path: mailman.database.schema
# - archiver -- All archiver output
# - bounce -- All bounce processing logs go here
# - config -- Configuration issues
+# - database -- Database logging (SQLAlchemy and Alembic)
# - debug -- Only used for development
# - error -- All exceptions go to this log
# - fromusenet -- Information related to the Usenet to Mailman gateway
@@ -255,6 +253,9 @@ path: bounce.log
[logging.config]
+[logging.database]
+level: warn
+
[logging.debug]
path: debug.log
level: info
@@ -532,7 +533,7 @@ register_bounces_every: 15m
# following values.
# The class implementing the IArchiver interface.
-class:
+class:
# Set this to 'yes' to enable the archiver.
enable: no