diff options
Diffstat (limited to 'Mailman')
| -rw-r--r-- | Mailman/Utils.py | 2 | ||||
| -rw-r--r-- | Mailman/data/Makefile.in | 118 | ||||
| -rw-r--r-- | Mailman/messages/Makefile.in | 155 | ||||
| -rw-r--r-- | Mailman/templates/Makefile.in | 83 | ||||
| -rw-r--r-- | Mailman/tests/Makefile.in | 82 | ||||
| -rw-r--r-- | Mailman/tests/bounces/Makefile.in | 66 | ||||
| -rw-r--r-- | Mailman/tests/test_handlers.py | 3 | ||||
| -rw-r--r-- | Mailman/tests/test_membership.py | 6 | ||||
| -rw-r--r-- | Mailman/tests/test_security_mgr.py | 11 |
9 files changed, 511 insertions, 15 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 240658e59..2fff35c12 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -549,7 +549,7 @@ ADMINDATA = { 'set': (3, 3), 'subscribe': (0, 3), 'unsubscribe': (0, 1), - 'who': (0, 0), + 'who': (0, 2), } # Given a Message.Message object, test for administrivia (eg subscribe, diff --git a/Mailman/data/Makefile.in b/Mailman/data/Makefile.in new file mode 100644 index 000000000..24f0f3a85 --- /dev/null +++ b/Mailman/data/Makefile.in @@ -0,0 +1,118 @@ +# Copyright (C) 1998-2007 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 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. + +# NOTE: Makefile.in is converted into Makefile by the configure script +# in the parent directory. Once configure has run, you can recreate +# the Makefile by running just config.status. + +# Variables set by configure + +VPATH= @srcdir@ +srcdir= @srcdir@ +bindir= @bindir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +var_prefix= @VAR_PREFIX@ +DESTDIR= + +CC= @CC@ +CHMOD= @CHMOD@ +INSTALL= @INSTALL@ +PYTHON= @PYTHON@ + +DEFS= @DEFS@ + +# Customizable but not set by configure + +OPT= @OPT@ +CFLAGS= $(OPT) $(DEFS) +PACKAGEDIR= $(prefix)/Mailman +DATADIR= $(var_prefix)/data +ETCDIR= $(var_prefix)/etc +ICONDIR= $(prefix)/icons +SCRIPTSDIR= $(prefix)/scripts + +SHELL= /bin/sh +PYTHONLIBDIR= $(prefix)/pythonlib +PYTHONPATHDIR= $(PYTHONLIBDIR)/lib/python + +# Traditional distutils packages +SETUPINSTOPTS= --home $(DESTDIR)$(PYTHONLIBDIR) +SETUPCMD= setup.py --quiet install $(SETUPINSTOPTS) + +SETUPTOOLS= setuptools-0.6c3 +SQLALCHEMY= SQLAlchemy-0.3.3 +ZOPEIFACE= zope.interface-3.3.0.1 +ELIXIR= Elixir-0.3.0 +SETUPPKGS= $(SETUPTOOLS) $(SQLALCHEMY) $(ZOPEIFACE) $(ELIXIR) + +EZINSTOPTS= --install-dir $(DESTDIR)$(PYTHONPATHDIR) +EZCMD= $(PYTHONLIBDIR)/bin/easy_install $(EZINSTOPTS) + +WSGIREF= wsgiref-0.1.2-py2.4.egg +MUNEPY= munepy-1.1-py2.5.egg +EZPKGS= $(WSGIREF) $(MUNEPY) + +# Modes for directories and executables created by the install +# process. Default to group-writable directories but +# user-only-writable for executables. +DIRMODE= 775 +EXEMODE= 755 +FILEMODE= 644 +DATAMODE= 664 +INSTALL_PROGRAM=$(INSTALL) -m $(EXEMODE) + +PATHSDIRS= bin cron scripts tests +ICONS= $(srcdir)/*.jpg $(srcdir)/*.png + +# Rules + +all: + +install: install-other install-packages + +install-other: + $(INSTALL) -m $(FILEMODE) $(ICONS) $(DESTDIR)$(ICONDIR) + for d in $(PATHSDIRS); \ + do \ + dir=$(DESTDIR)$(prefix)/$$d; \ + $(INSTALL) -m $(FILEMODE) paths.py $$dir; \ + done + $(INSTALL) -m $(EXEMODE) mailman $(DESTDIR)$(SCRIPTSDIR) + $(INSTALL) -m $(FILEMODE) mailman.cfg.sample $(DESTDIR)$(ETCDIR) + +install-packages: + mkdir -p $(PYTHONPATHDIR) + for p in $(SETUPPKGS); \ + do \ + gunzip -c $(srcdir)/$$p.tar.gz | tar xf -; \ + (cd $$p ; umask 02 ; \ + PYTHONPATH=$(PYTHONPATHDIR) $(PYTHON) $(SETUPCMD)); \ + done + for p in $(EZPKGS); \ + do \ + (umask 02 ; PYTHONPATH=$(PYTHONPATHDIR) $(EZCMD) $$p); \ + done + $(INSTALL) -m $(FILEMODE) coverage.py $(PYTHONPATHDIR) + +finish: + +clean: + +distclean: + -rm Makefile paths.py mailman + -rm -rf $(PACKAGES) diff --git a/Mailman/messages/Makefile.in b/Mailman/messages/Makefile.in new file mode 100644 index 000000000..dd2b1a610 --- /dev/null +++ b/Mailman/messages/Makefile.in @@ -0,0 +1,155 @@ +# Copyright (C) 2001-2007 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 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# NOTE: Makefile.in is converted into Makefile by the configure script +# in the parent directory. Once configure has run, you can recreate +# the Makefile by running just config.status. +# +# NOTE: You should ordinarily never need to run "make catalogs", but +# if you find you do, you will need GNU make, and the GNU gettext +# suite (e.g. msgfmt, msgmerge). + +# Variables set by configure + +VPATH= @srcdir@ +srcdir= @srcdir@ +bindir= @bindir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +DESTDIR= + +CC= @CC@ +CHMOD= @CHMOD@ +INSTALL= @INSTALL@ + +DEFS= @DEFS@ + +# Customizable but not set by configure + +OPT= @OPT@ +CFLAGS= $(OPT) $(DEFS) +PACKAGEDIR= $(prefix)/messages +SHELL= /bin/sh +DIRSETGID= chmod g+s +MSGFMT= @PYTHON@ ../build/bin/msgfmt.py +MSGMERGE= msgmerge + +# Languages from configure script +LANGUAGES= @LANGUAGES@ +LANGDIRS= $(LANGUAGES:%=messages/%/LC_MESSAGES) +# Human readable po file +POFILES= $(LANGUAGES:%=%/LC_MESSAGES/mailman.po) +# Binary generated mo file +MOFILES= $(LANGUAGES:%=%/LC_MESSAGES/mailman.mo) +TARGETS= $(MOFILES) + +# Modes for directories and executables created by the install +# process. Default to group-writable directories but +# user-only-writable for executables. +DIRMODE= 775 +EXEMODE= 755 +FILEMODE= 644 +INSTALL_PROGRAM=$(INSTALL) -m $(EXEMODE) +PROG= @PYTHON@ build/bin/pygettext.py +TEMPL2POT= @PYTHON@ build/bin/templ2pot.py + +.SUFFIXES: .po .mo +.po.mo: + -$(MSGFMT) -o $@ $< + +# Rules + +all: mofiles + +catalogs: $(TARGETS) + +check: + @for file in $(POFILES); \ + do \ + echo "Checking $$file"; \ + msgfmt -o /dev/null --statistics -v $$file; \ + done + +install: doinstall + +doinstall: mofiles + @for d in $(LANGDIRS); \ + do \ + dir=$(DESTDIR)$(prefix)/$$d; \ + echo "Creating language directory $$dir"; \ + $(srcdir)/../mkinstalldirs $$dir; \ + chmod $(DIRMODE) $$dir; \ + $(DIRSETGID) $$dir; \ + done + @for d in $(LANGUAGES); \ + do \ + readme=$(srcdir)/$$d/README.$$d; \ + if test -f $$readme; \ + then \ + $(INSTALL) -m $(FILEMODE) $$readme $(DESTDIR)$(prefix)/messages/$$d; \ + fi; \ + done + @for d in $(LANGUAGES); \ + do \ + po=$(srcdir)/$$d/LC_MESSAGES/mailman.po; \ + mo=$(srcdir)/$$d/LC_MESSAGES/mailman.mo; \ + dir=$(DESTDIR)$(prefix)/messages/$$d/LC_MESSAGES; \ + $(INSTALL) -m $(FILEMODE) $$po $$dir; \ + $(INSTALL) -m $(FILEMODE) $$mo $$dir; \ + done + +mofiles: $(MOFILES) + +finish: + +clean: + -rm -f */LC_MESSAGES/mailman.mo + +fileclean: + -rm -f marked.files docstring.files template.files + +potclean: fileclean + -rm -f Makefile $(POTFILE) + +distclean: clean potclean + -rm -f Makefile + +marked.files: + @echo "Calculating marked input files for pygettext" + (cd ..; find Mailman -path '*pythonlib' -prune -o -path '*Commands/cmd_*.py' -prune -o -name '*.py' -print >| messages/$@) + +docstring.files: + @echo "Calculating script input files for pygettext" + (cd ..; grep -d skip -l -i '^#! .*python.*' `find bin cron scripts -name ".#*" -prune -o -print` | grep -v pygettext >| messages/$@) + (cd ..; ls Mailman/Commands/cmd_*.py >> messages/$@) + +template.files: + @echo "Calculating template input files for templ2pot" + (cd ..; ls templates/en/*.* >| messages/$@) + +potfile: marked.files docstring.files template.files + @echo "Running pygettext on $@; this make take a while." + (cd ..; $(PROG) -p messages -d mailman -D -X messages/marked.files `cat messages/marked.files messages/docstring.files`) + (cd ..; $(TEMPL2POT) `cat messages/template.files` >> messages/mailman.pot) + +# Update the individual mailman.po files with the new changes to the +# .pot file +%/LC_MESSAGES/mailman.po: mailman.pot + @echo "Merging new template file with existing translations" + $(MSGMERGE) -U $@ mailman.pot || touch $@ + + +FORCE: diff --git a/Mailman/templates/Makefile.in b/Mailman/templates/Makefile.in new file mode 100644 index 000000000..a69e558f4 --- /dev/null +++ b/Mailman/templates/Makefile.in @@ -0,0 +1,83 @@ +# Copyright (C) 1998-2007 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 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# NOTE: Makefile.in is converted into Makefile by the configure script +# in the parent directory. Once configure has run, you can recreate +# the Makefile by running just config.status. + +# Variables set by configure + +VPATH= @srcdir@ +srcdir= @srcdir@ +bindir= @bindir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +DESTDIR= + +CC= @CC@ +CHMOD= @CHMOD@ +INSTALL= @INSTALL@ +TRUE= @TRUE@ + +DEFS= @DEFS@ + +# Customizable but not set by configure + +OPT= @OPT@ +CFLAGS= $(OPT) $(DEFS) +TEMPLATEDIR= $(prefix)/templates + +SHELL= /bin/sh + +LANGUAGES= en @LANGUAGES@ +MAKELANGS= @LANGUAGES@ + +# Modes for directories and executables created by the install +# process. Default to group-writable directories but +# user-only-writable for executables. +DIRMODE= 775 +EXEMODE= 755 +FILEMODE= 644 +INSTALL_PROGRAM=$(INSTALL) -m $(EXEMODE) +PO2TEMPL= @PYTHON@ build/bin/po2templ.py + + +# Rules + +all: + for d in $(MAKELANGS); \ + do \ + (mkdir -p $$d; cd ..; $(PO2TEMPL) $$d) \ + done + +install: all + for d in $(LANGUAGES); \ + do \ + $(srcdir)/../mkinstalldirs $(DESTDIR)$(TEMPLATEDIR)/$$d; \ + for f in $(srcdir)/$$d/*.html $(srcdir)/$$d/*.txt; \ + do \ + $(INSTALL) -m $(FILEMODE) $$f $(DESTDIR)$(TEMPLATEDIR)/$$d; \ + done; \ + done + +finish: + +clean: + -rm -rf $(MAKELANGS) + +distclean: + -rm -f Makefile + -rm -rf $(MAKELANGS) diff --git a/Mailman/tests/Makefile.in b/Mailman/tests/Makefile.in new file mode 100644 index 000000000..1326f67e5 --- /dev/null +++ b/Mailman/tests/Makefile.in @@ -0,0 +1,82 @@ +# Copyright (C) 1998-2007 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 +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. + +# NOTE: Makefile.in is converted into Makefile by the configure script +# in the parent directory. Once configure has run, you can recreate +# the Makefile by running just config.status. + +# Variables set by configure + +VPATH= @srcdir@ +srcdir= @srcdir@ +bindir= @bindir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +DESTDIR= + +CC= @CC@ +CHMOD= @CHMOD@ +INSTALL= @INSTALL@ + +DEFS= @DEFS@ + +# Customizable but not set by configure + +OPT= @OPT@ +CFLAGS= $(OPT) $(DEFS) +PACKAGEDIR= $(prefix)/Mailman/testing +SHELL= /bin/sh + +MODULES= *.py +OTHERFILES= testing.cfg.in + +# Modes for directories and executables created by the install +# process. Default to group-writable directories but +# user-only-writable for executables. +DIRMODE= 775 +EXEMODE= 755 +FILEMODE= 644 +INSTALL_PROGRAM=$(INSTALL) -m $(EXEMODE) + +# Directories make should decend into +SUBDIRS= bounces + +# Rules + +all: + +install: + for f in $(MODULES) $(OTHERFILES); \ + do \ + $(INSTALL) -m $(FILEMODE) $(srcdir)/$$f $(DESTDIR)$(PACKAGEDIR); \ + done + for d in $(SUBDIRS); \ + do \ + (cd $$d; $(MAKE) DESTDIR=$(DESTDIR) install); \ + done + +finish: + +clean: + +distclean: + -rm *.pyc + -rm Makefile + @for d in $(SUBDIRS); \ + do \ + (cd $$d; $(MAKE) distclean); \ + done diff --git a/Mailman/tests/bounces/Makefile.in b/Mailman/tests/bounces/Makefile.in new file mode 100644 index 000000000..0c9b2759b --- /dev/null +++ b/Mailman/tests/bounces/Makefile.in @@ -0,0 +1,66 @@ +# Copyright (C) 2001-2007 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 Licenseo +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. + +# Variables set by configure + +VPATH= @srcdir@ +srcdir= @srcdir@ +bindir= @bindir@ +prefix= @prefix@ +exec_prefix= @exec_prefix@ +DESTDIR= + +CC= @CC@ +CHMOD= @CHMOD@ +INSTALL= @INSTALL@ + +DEFS= @DEFS@ + +# Customizable but not set by configure + +OPT= @OPT@ +CFLAGS= $(OPT) $(DEFS) +BOUNCEDIR= $(prefix)/Mailman/testing/bounces +SHELL= /bin/sh + +BOUNCE_FILES= $(srcdir)/*.txt + + +# Modes for directories and executables created by the install +# process. Default to group-writable directories but +# user-only-writable for executables. +DIRMODE= 775 +EXEMODE= 755 +FILEMODE= 644 +INSTALL_PROGRAM=$(INSTALL) -m $(EXEMODE) + +# Rules +all: + +install: + for f in $(BOUNCE_FILES); \ + do \ + $(INSTALL) -m $(FILEMODE) $$f $(DESTDIR)$(BOUNCEDIR); \ + done + +finish: + +clean: + +distclean: + -rm *.pyc + -rm Makefile diff --git a/Mailman/tests/test_handlers.py b/Mailman/tests/test_handlers.py index b8b33ba1a..b4cb390ce 100644 --- a/Mailman/tests/test_handlers.py +++ b/Mailman/tests/test_handlers.py @@ -25,7 +25,6 @@ from Mailman import Message from Mailman import passwords from Mailman.MailList import MailList from Mailman.configuration import config -from Mailman.tests.base import TestBase from Mailman.Handlers import Approve # Don't test handlers such as SMTPDirect and Sendmail here @@ -37,7 +36,7 @@ def password(cleartext): -class TestApprove(TestBase): +class TestApprove(unittest.TestCase): def test_short_circuit(self): msgdata = {'approved': 1} rtn = Approve.process(self._mlist, None, msgdata) diff --git a/Mailman/tests/test_membership.py b/Mailman/tests/test_membership.py index c7f1773b8..b874ee67c 100644 --- a/Mailman/tests/test_membership.py +++ b/Mailman/tests/test_membership.py @@ -28,7 +28,6 @@ from Mailman import passwords from Mailman.Errors import NotAMemberError from Mailman.UserDesc import UserDesc from Mailman.configuration import config -from Mailman.tests.base import TestBase @@ -37,7 +36,7 @@ def password(cleartext): -class TestNoMembers(TestBase): +class TestNoMembers(unittest.TestCase): def test_no_member(self): eq = self.assertEqual raises = self.assertRaises @@ -81,9 +80,8 @@ class TestNoMembers(TestBase): -class TestMembers(TestBase): +class TestMembers(unittest.TestCase): def setUp(self): - TestBase.setUp(self) self._member_password = password('xxXXxx') self._mlist.addNewMember('person@dom.ain', digest=0, diff --git a/Mailman/tests/test_security_mgr.py b/Mailman/tests/test_security_mgr.py index 3d513562d..4a9a6919e 100644 --- a/Mailman/tests/test_security_mgr.py +++ b/Mailman/tests/test_security_mgr.py @@ -31,7 +31,6 @@ from Mailman import Errors from Mailman import Utils from Mailman import passwords from Mailman.configuration import config -from Mailman.tests.base import TestBase @@ -40,7 +39,7 @@ def password(cleartext): -class TestSecurityManager(TestBase): +class TestSecurityManager(unittest.TestCase): def test_init_vars(self): eq = self.assertEqual eq(self._mlist.mod_password, None) @@ -83,9 +82,8 @@ class TestSecurityManager(TestBase): -class TestAuthenticate(TestBase): +class TestAuthenticate(unittest.TestCase): def setUp(self): - TestBase.setUp(self) Utils.set_global_password('bbBBbb', siteadmin=True) Utils.set_global_password('ccCCcc', siteadmin=False) @@ -98,7 +96,6 @@ class TestAuthenticate(TestBase): os.unlink(config.LISTCREATOR_PW_FILE) except OSError, e: if e.errno <> errno.ENOENT: raise - TestBase.tearDown(self) def test_auth_creator(self): self.assertEqual(self._mlist.Authenticate( @@ -171,9 +168,8 @@ class StripperIO(StringIO): StringIO.write(self, s) -class TestWebAuthenticate(TestBase): +class TestWebAuthenticate(unittest.TestCase): def setUp(self): - TestBase.setUp(self) Utils.set_global_password('bbBBbb', siteadmin=True) Utils.set_global_password('ccCCcc', siteadmin=False) mlist = self._mlist @@ -200,7 +196,6 @@ class TestWebAuthenticate(TestBase): except OSError, e: if e.errno <> errno.ENOENT: raise del os.environ['HTTP_COOKIE'] - TestBase.tearDown(self) def test_auth_site_admin(self): self.failUnless(self._mlist.WebAuthenticate( |
