summaryrefslogtreecommitdiff
path: root/Mailman/bin/make_instance.py
diff options
context:
space:
mode:
authorBarry Warsaw2008-02-25 00:24:03 -0500
committerBarry Warsaw2008-02-25 00:24:03 -0500
commit6965bd89216a8d759ff8ea35ca4d1e88b0c35906 (patch)
tree642089474463c2632ab358a8f6d982af19ed24ca /Mailman/bin/make_instance.py
parentaab29f252ebefb1520714080a90bb42a25393f18 (diff)
downloadmailman-6965bd89216a8d759ff8ea35ca4d1e88b0c35906.tar.gz
mailman-6965bd89216a8d759ff8ea35ca4d1e88b0c35906.tar.zst
mailman-6965bd89216a8d759ff8ea35ca4d1e88b0c35906.zip
Diffstat (limited to 'Mailman/bin/make_instance.py')
-rw-r--r--Mailman/bin/make_instance.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/Mailman/bin/make_instance.py b/Mailman/bin/make_instance.py
index 26e799470..1f93c39bb 100644
--- a/Mailman/bin/make_instance.py
+++ b/Mailman/bin/make_instance.py
@@ -25,9 +25,9 @@ import errno
import shutil
import optparse
import setuptools
-from string import Template
-import Mailman.data
+from pkg_resources import resource_string
+from string import Template
from Mailman import Defaults
from Mailman.Version import MAILMAN_VERSION
@@ -35,7 +35,6 @@ from Mailman.i18n import _
SPACE = ' '
-DATA_DIR = os.path.dirname(Mailman.data.__file__)
@@ -131,15 +130,13 @@ def instantiate(var_dir, user, group, languages, force):
# Create an etc/mailman.cfg file which contains just a few configuration
# variables about the run-time environment that can't be calculated.
# Don't overwrite mailman.cfg unless the -f flag was given.
- in_file_path = os.path.join(DATA_DIR, 'mailman.cfg.in')
out_file_path = os.path.join(etc_dir, 'mailman.cfg')
if os.path.exists(out_file_path) and not force:
# The logging subsystem isn't up yet, so just print this to stderr.
print >> sys.stderr, 'File exists:', out_file_path
print >> sys.stderr, 'Use --force to override.'
else:
- with open(in_file_path) as fp:
- raw = Template(fp.read())
+ raw = Template(resource_string('Mailman.extras', 'mailman.cfg.in'))
processed = raw.safe_substitute(var_dir=var_dir,
user_id=uid,
user_name=user_name,