Merge lp://qastaging/~barry/launchpad/394133-urlwrap into lp://qastaging/launchpad
Proposed by
Barry Warsaw
Status: | Merged |
---|---|
Approved by: | Barry Warsaw |
Approved revision: | no longer in the source branch. |
Merged at revision: | not available |
Proposed branch: | lp://qastaging/~barry/launchpad/394133-urlwrap |
Merge into: | lp://qastaging/launchpad |
Diff against target: |
147 lines (+98/-5) 3 files modified
lib/canonical/launchpad/doc/textformatting.txt (+76/-0) lib/canonical/launchpad/mailnotification.py (+6/-1) lib/lp/services/mail/mailwrapper.py (+16/-4) |
To merge this branch: | bzr merge lp://qastaging/~barry/launchpad/394133-urlwrap |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | code | Approve | |
Review via email: mp+14504@code.qastaging.launchpad.net |
To post a comment you must log in.
= Summary =
Bug 394133 describes an annoying problem when messages are held for moderator
approval, with a team name that is fairly long and contains hyphens. The
message that gets sent to the team administrators has the url wrapped so that
it's generally not clickable in most mail readers.
== Proposed fix ==
Add a hack to MailWrapper. format( ) so that you can pass in a callable. This
callable gets the paragraph to wrap as an argument and may return False if the
paragraph should not get wrapped. Otherwise (return True), normal processing
will continue.
== Pre-implementation notes ==
The bug report describes a few alternative implementations. Once we're on
Python 2.6 we can just use textwrap's new argument to suppress breaking on
hyphens. We decided not to try to pull in Python 2.6's textwrap just for
this.
== Implementation details ==
None in particular.
== Tests ==
% bin/test -vv -t textformatting
== Demo and Q/A ==
* make run_all
* Create a team with a long name
* Put the following message text in a file:
{{{
From: <email address hidden>
To: <email address hidden>
Subject: Test
Message-ID: <first>
Testing
}}}
* Tweak the team name to match the long one you created above. bin/inject -l frankly- my-dear- i-dont- give-a- damn message.txt
* lib/mailman/
* Watch your email for the non-wrapped message
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: services/ mail/mailwrappe r.py /launchpad/ mailnotificatio n.py /launchpad/ doc/textformatt ing.txt
lib/lp/
lib/canonical
lib/canonical