summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Warsaw2009-05-27 17:47:21 -0400
committerBarry Warsaw2009-05-27 17:47:21 -0400
commit6213698325fb8905a8aefa0cc7779c2566f3e4e6 (patch)
tree8cded1b324f85334e6ab9ac66b1614b3c97e5796
parent4cf56226a52d2f5e607b5d4d83e20ae24619a383 (diff)
downloadmailman-6213698325fb8905a8aefa0cc7779c2566f3e4e6.tar.gz
mailman-6213698325fb8905a8aefa0cc7779c2566f3e4e6.tar.zst
mailman-6213698325fb8905a8aefa0cc7779c2566f3e4e6.zip
When cleaning up the artifacts of a list being deleted, be more careful for
artifacts that don't exist. In that case, just skimp them rather than complain. Docstring style cleanup. Allow for doctest layer specification in the package's __init__.py, defaulting to SMTPLayer if not given. This is probably too coarse for long term use, but it works for now. Make sure pipelines.txt properly cleans up its digest; it must be flushed after clearing.
Diffstat (limited to '')
-rw-r--r--src/mailman/app/lifecycle.py4
-rw-r--r--src/mailman/archiving/common.txt (renamed from src/mailman/docs/archivers.txt)7
-rw-r--r--src/mailman/docs/__init__.py30
-rw-r--r--src/mailman/docs/pipelines.txt14
-rw-r--r--src/mailman/pipeline/docs/digests.txt5
5 files changed, 51 insertions, 9 deletions
diff --git a/src/mailman/app/lifecycle.py b/src/mailman/app/lifecycle.py
index 051b7cec3..ff087a874 100644
--- a/src/mailman/app/lifecycle.py
+++ b/src/mailman/app/lifecycle.py
@@ -101,7 +101,9 @@ def remove_list(fqdn_listname, mailing_list=None, archives=True):
])
# Now that we know what files and directories to delete, delete them.
for target in removeables:
- if os.path.islink(target):
+ if not os.path.exists(target):
+ pass
+ elif os.path.islink(target):
os.unlink(target)
elif os.path.isdir(target):
shutil.rmtree(target)
diff --git a/src/mailman/docs/archivers.txt b/src/mailman/archiving/common.txt
index ef36a25ac..a97b14245 100644
--- a/src/mailman/docs/archivers.txt
+++ b/src/mailman/archiving/common.txt
@@ -1,3 +1,4 @@
+=========
Archivers
=========
@@ -46,7 +47,7 @@ interoperate.
Sending the message to the archiver
------------------------------------
+===================================
The archiver is also able to archive the message.
@@ -69,7 +70,7 @@ Note however that the prototype archiver can't archive messages.
The Mail-Archive.com
---------------------
+====================
The Mail-Archive <http://www.mail-archive.com> is a public archiver that can
be used to archive message for free. Mailman comes with a plugin for this
@@ -157,7 +158,7 @@ Additionally, this archiver can handle malformed Message-IDs.
MHonArc
--------
+=======
The MHonArc archiver <http://www.mhonarc.org> is also available.
diff --git a/src/mailman/docs/__init__.py b/src/mailman/docs/__init__.py
index e69de29bb..0bb71a563 100644
--- a/src/mailman/docs/__init__.py
+++ b/src/mailman/docs/__init__.py
@@ -0,0 +1,30 @@
+# Copyright (C) 2009 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/>.
+
+"""General Mailman doc tests."""
+
+from __future__ import absolute_import, unicode_literals
+
+__metaclass__ = type
+__all__ = [
+ 'layer',
+ ]
+
+
+
+from mailman.testing.layers import ConfigLayer
+layer = ConfigLayer
diff --git a/src/mailman/docs/pipelines.txt b/src/mailman/docs/pipelines.txt
index 0e6dad8e8..36bf2dd23 100644
--- a/src/mailman/docs/pipelines.txt
+++ b/src/mailman/docs/pipelines.txt
@@ -1,3 +1,4 @@
+=========
Pipelines
=========
@@ -16,7 +17,7 @@ message once it's started.
Processing a message
---------------------
+====================
Messages hit the pipeline after they've been accepted for posting.
@@ -47,12 +48,12 @@ etc.
List-Post: <mailto:xtest@example.com>
List-Subscribe:
<http://lists.example.com/listinfo/xtest@example.com>,
- <mailto:xtest-join@example.com>
+ <mailto:xtest-join@example.com>
Archived-At:
http://lists.example.com/archives/4CMWUN6BHVCMHMDAOSJZ2Q72G5M32MWB
List-Unsubscribe:
<http://lists.example.com/listinfo/xtest@example.com>,
- <mailto:xtest-leave@example.com>
+ <mailto:xtest-leave@example.com>
List-Archive: <http://lists.example.com/archives/xtest@example.com>
List-Help: <mailto:xtest-request@example.com?subject=help>
<BLANKLINE>
@@ -183,4 +184,11 @@ There's now one message in the digest mailbox, getting ready to be sent.
<BLANKLINE>
<BLANKLINE>
+
+Clean up the digests
+====================
+
>>> digest.clear()
+ >>> digest.flush()
+ >>> sum(1 for msg in digest_mbox(mlist))
+ 0
diff --git a/src/mailman/pipeline/docs/digests.txt b/src/mailman/pipeline/docs/digests.txt
index 6aafef62c..14d2a5636 100644
--- a/src/mailman/pipeline/docs/digests.txt
+++ b/src/mailman/pipeline/docs/digests.txt
@@ -1,3 +1,4 @@
+=======
Digests
=======
@@ -30,7 +31,7 @@ update the tests when we switch to a different mailbox format.
Short circuiting
-----------------
+================
When a message is posted to the mailing list, it is generally added to a
mailbox, unless the mailing list does not allow digests.
@@ -56,7 +57,7 @@ mailbox, unless the mailing list does not allow digests.
Sending a digest
-----------------
+================
For messages which are not digests, but which are posted to a digesting
mailing list, the messages will be stored until they reach a criteria