summaryrefslogtreecommitdiff
path: root/Mailman/Cgi/edithtml.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/Cgi/edithtml.py')
-rw-r--r--Mailman/Cgi/edithtml.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/Mailman/Cgi/edithtml.py b/Mailman/Cgi/edithtml.py
index d52fda1fc..9a07cdc0e 100644
--- a/Mailman/Cgi/edithtml.py
+++ b/Mailman/Cgi/edithtml.py
@@ -1,17 +1,17 @@
-# Copyright (C) 1998,1999,2000,2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2005 by the Free Software Foundation, Inc.
#
# This program 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 2
# of the License, or (at your option) any later version.
-#
+#
# This program 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 this program; if not, write to the Free Software
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""Script which implements admin editing of the list's html templates."""
@@ -43,6 +43,7 @@ def main():
('listinfo.html', _('General list information page')),
('subscribe.html', _('Subscribe results page')),
('options.html', _('User specific options page')),
+ ('subscribeack.txt', _('Welcome email text file')),
)
_ = i18n._
@@ -157,10 +158,14 @@ def ChangeHTML(mlist, cgi_info, template_name, doc):
code = cgi_info['html_code'].value
langdir = os.path.join(mlist.fullpath(), mlist.preferred_language)
# Make sure the directory exists
+ omask = os.umask(0)
try:
- os.mkdir(langdir, 02775)
- except OSError, e:
- if e.errno <> errno.EEXIST: raise
+ try:
+ os.mkdir(langdir, 02775)
+ except OSError, e:
+ if e.errno <> errno.EEXIST: raise
+ finally:
+ os.umask(omask)
fp = open(os.path.join(langdir, template_name), 'w')
try:
fp.write(code)