------------------------------------------------------------
revno: 1000
committer: Mark Sapiro <[EMAIL PROTECTED]>
branch nick: 2.2
timestamp: Thu 2008-08-21 14:35:20 -0700
message:
Backports from the trunk -
- Added '(by thread)' to the previous and next message links in the
archive to emphasize that even if you got to the message from a
subject, date or author index, previous and next are still by thread.
- The processing of Topics regular expressions has changed. Previously the
Topics regexp was compiled in verbose mode but not documented as such
which caused some confusion. Also, the documentation indicated that
topic keywords could be entered one per line, but these entries were not
handled properly. Topics regexps are now compiled in non-verbose mode
and multi-line entries are 'ored'. Existing Topics regexps will be
converted when the list is updated so they will continue to work.
modified:
Mailman/Archiver/HyperArch.py
Mailman/Cgi/options.py
Mailman/Gui/Topics.py
Mailman/Handlers/Tagger.py
Mailman/MailList.py
Mailman/Utils.py
Mailman/versions.py
NEWS
=== modified file 'Mailman/Archiver/HyperArch.py'
--- a/Mailman/Archiver/HyperArch.py 2008-06-29 21:06:46 +0000
+++ b/Mailman/Archiver/HyperArch.py 2008-08-21 21:35:20 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2008 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
@@ -495,7 +495,7 @@
subject = self._get_subject_enc(self.prev)
prev = ('<LINK REL="Previous" HREF="%s">'
% (url_quote(self.prev.filename)))
- prev_wsubj = ('<LI>' + _('Previous message:') +
+ prev_wsubj = ('<LI>' + _('Previous message (by thread):') +
' <A HREF="%s">%s\n</A></li>'
% (url_quote(self.prev.filename),
self.quote(subject)))
@@ -517,7 +517,7 @@
subject = self._get_subject_enc(self.next)
next = ('<LINK REL="Next" HREF="%s">'
% (url_quote(self.next.filename)))
- next_wsubj = ('<LI>' + _('Next message:') +
+ next_wsubj = ('<LI>' + _('Next message (by thread):') +
' <A HREF="%s">%s\n</A></li>'
% (url_quote(self.next.filename),
self.quote(subject)))
=== modified file 'Mailman/Cgi/options.py'
--- a/Mailman/Cgi/options.py 2008-04-14 17:45:27 +0000
+++ b/Mailman/Cgi/options.py 2008-08-21 21:35:20 +0000
@@ -33,6 +33,7 @@
from Mailman.htmlformat import *
from Mailman.Logging.Syslog import syslog
+OR = '|'
SLASH = '/'
SETLANGUAGE = -1
@@ -1038,7 +1039,8 @@
table.AddRow([Bold(Label(_('Name:'))),
Utils.websafe(name)])
table.AddRow([Bold(Label(_('Pattern (as regexp):'))),
- '<pre>' + Utils.websafe(pattern) + '</pre>'])
+ '<pre>' + Utils.websafe(OR.join(pattern.splitlines()))
+ + '</pre>'])
table.AddRow([Bold(Label(_('Description:'))),
Utils.websafe(description)])
# Make colors look nice
=== modified file 'Mailman/Gui/Topics.py'
--- a/Mailman/Gui/Topics.py 2006-01-14 23:56:58 +0000
+++ b/Mailman/Gui/Topics.py 2008-08-21 21:35:20 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2006 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2008 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
@@ -29,6 +29,8 @@
True = 1
False = 0
+OR = '|'
+
class Topics(GUIBase):
@@ -126,9 +128,10 @@
# Make sure the pattern was a legal regular expression
name = Utils.websafe(name)
try:
- re.compile(pattern)
+ orpattern = OR.join(pattern.splitlines())
+ re.compile(orpattern)
except (re.error, TypeError):
- safepattern = Utils.websafe(pattern)
+ safepattern = Utils.websafe(orpattern)
doc.addError(_("""The topic pattern '%(safepattern)s' is not a
legal regular expression. It will be discarded."""))
continue
=== modified file 'Mailman/Handlers/Tagger.py'
--- a/Mailman/Handlers/Tagger.py 2005-08-27 01:40:17 +0000
+++ b/Mailman/Handlers/Tagger.py 2008-08-21 21:35:20 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2001,2002 by the Free Software Foundation, Inc.
+# Copyright (C) 2001-2008 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
@@ -25,6 +25,7 @@
from Mailman.Logging.Syslog import syslog
+OR = '|'
CRNL = '\r\n'
EMPTYSTRING = ''
NLTAB = '\n\t'
@@ -53,7 +54,8 @@
# added to the specific topics bucket.
hits = {}
for name, pattern, desc, emptyflag in mlist.topics:
- cre = re.compile(pattern, re.IGNORECASE | re.VERBOSE)
+ pattern = OR.join(pattern.splitlines())
+ cre = re.compile(pattern, re.IGNORECASE)
for line in matchlines:
if cre.search(line):
hits[name] = 1
=== modified file 'Mailman/MailList.py'
--- a/Mailman/MailList.py 2008-08-20 00:56:58 +0000
+++ b/Mailman/MailList.py 2008-08-21 21:35:20 +0000
@@ -74,6 +74,7 @@
_ = i18n._
EMPTYSTRING = ''
+OR = '|'
try:
True, False
@@ -757,10 +758,11 @@
goodtopics = []
for name, pattern, desc, emptyflag in self.topics:
try:
- re.compile(pattern)
+ orpattern = OR.join(pattern.splitlines())
+ re.compile(orpattern)
except (re.error, TypeError):
syslog('error', 'Bad topic pattern "%s" for list: %s',
- pattern, self.internal_name())
+ orpattern, self.internal_name())
else:
goodtopics.append((name, pattern, desc, emptyflag))
self.topics = goodtopics
=== modified file 'Mailman/Utils.py'
--- a/Mailman/Utils.py 2008-07-11 22:04:03 +0000
+++ b/Mailman/Utils.py 2008-08-21 21:35:20 +0000
@@ -63,6 +63,7 @@
EMPTYSTRING = ''
UEMPTYSTRING = u''
+CR = '\r'
NL = '\n'
DOT = '.'
IDENTCHARS = ascii_letters + digits + '_'
@@ -885,6 +886,61 @@
return EMPTYSTRING.join(s.splitlines())
+def strip_verbose_pattern(pattern):
+ # Remove white space and comments from a verbose pattern and return a
+ # non-verbose, equivalent pattern. Replace CR and NL in the result
+ # with '\\r' and '\\n' respectively to avoid multi-line results.
+ if not isinstance(pattern, str):
+ return pattern
+ newpattern = ''
+ i = 0
+ inclass = False
+ skiptoeol = False
+ copynext = False
+ while i < len(pattern):
+ c = pattern[i]
+ if copynext:
+ if c == NL:
+ newpattern += '\\n'
+ elif c == CR:
+ newpattern += '\\r'
+ else:
+ newpattern += c
+ copynext = False
+ elif skiptoeol:
+ if c == NL:
+ skiptoeol = False
+ elif c == '#' and not inclass:
+ skiptoeol = True
+ elif c == '[' and not inclass:
+ inclass = True
+ newpattern += c
+ copynext = True
+ elif c == ']' and inclass:
+ inclass = False
+ newpattern += c
+ elif re.search('\s', c):
+ if inclass:
+ if c == NL:
+ newpattern += '\\n'
+ elif c == CR:
+ newpattern += '\\r'
+ else:
+ newpattern += c
+ elif c == '\\' and not inclass:
+ newpattern += c
+ copynext = True
+ else:
+ if c == NL:
+ newpattern += '\\n'
+ elif c == CR:
+ newpattern += '\\r'
+ else:
+ newpattern += c
+ i += 1
+ return newpattern
+
+
# Patterns and functions to flag possible XSS attacks in HTML.
# This list is compiled from information at http://ha.ckers.org/xss.html,
# http://www.quirksmode.org/js/events_compinfo.html,
=== modified file 'Mailman/versions.py'
--- a/Mailman/versions.py 2008-08-20 00:56:58 +0000
+++ b/Mailman/versions.py 2008-08-21 21:35:20 +0000
@@ -313,6 +313,15 @@
pass
else:
l.digest_members[k] = 0
+ #
+ # Convert pre 2.2 topics regexps which were compiled in verbose mode
+ # to a non-verbose equivalent.
+ #
+ if stored_state['data_version'] <= 97 and stored_state.has_key('topics'):
+ l.topics = []
+ for name, pattern, description, emptyflag in stored_state['topics']:
+ pattern = Utils.strip_verbose_pattern(pattern)
+ l.topics.append((name, pattern, description, emptyflag))
=== modified file 'NEWS'
--- a/NEWS 2008-08-21 19:50:49 +0000
+++ b/NEWS 2008-08-21 21:35:20 +0000
@@ -19,6 +19,14 @@
- Added an 'automate' option to bin/newlist to send the notice to the
admin without the prompt.
+ - The processing of Topics regular expressions has changed. Previously the
+ Topics regexp was compiled in verbose mode but not documented as such
+ which caused some confusion. Also, the documentation indicated that
+ topic keywords could be entered one per line, but these entries were not
+ handled properly. Topics regexps are now compiled in non-verbose mode
+ and multi-line entries are 'ored'. Existing Topics regexps will be
+ converted when the list is updated so they will continue to work.
+
Bug fixes and other patches
- Fixed a bug in admin.py which would result in chunked pages of the
@@ -31,6 +39,10 @@
- Changed the 'Approve' wording in the admindbdetails.html template to
'Accept/Approve' for better agreement with the button labels.
+ - Added '(by thread)' to the previous and next message links in the
+ archive to emphasize that even if you got to the message from a
+ subject, date or author index, previous and next are still by thread.
+
2.1.11 (30-Jun-2008)
New Features
--
Dormant development version (web u/i update)
https://code.launchpad.net/~mailman-coders/mailman/2.2
You are receiving this branch notification because you are subscribed to it.
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org