Merge lp://staging/~jcsackett/launchpad/linkifier-bugs into lp://staging/launchpad

Proposed by j.c.sackett
Status: Merged
Approved by: Māris Fogels
Approved revision: no longer in the source branch.
Merged at revision: 12073
Proposed branch: lp://staging/~jcsackett/launchpad/linkifier-bugs
Merge into: lp://staging/launchpad
Diff against target: 64 lines (+39/-2)
2 files modified
lib/lp/app/browser/stringformatter.py (+1/-1)
lib/lp/app/browser/tests/test_stringformatter.py (+38/-1)
To merge this branch: bzr merge lp://staging/~jcsackett/launchpad/linkifier-bugs
Reviewer Review Type Date Requested Status
Māris Fogels (community) Approve
Review via email: mp+43677@code.staging.launchpad.net

Commit message

[r=mars][ui=none][bug=85470,179868,276726] Updates the protocols recognized by the linkifier. file:// no longer supported, apt://, apt: and data: added.

Description of the change

Summary
=======

Several simple bugs have been filed against the linkifier in bug comments regarding its handling of various protocols. These are handled in this branch by simple changes to the protocol section of the regex used in the linkifier.

Preimp-talk
===========

Spoke with Curtis Hovey.

Implementation
==============

The linkifier decides which things to link based on the protocols defined in the protocol glob of a truly massive regex in lp.app.browser.stringformatter

The protocol section is modified to support apt and data uris, and to not follow file uris, as the latter is useless to anyone but the person with the file on their computer.

Tests
=====

lp test -t test_stringformatter

QA
==

Open launchpad.dev and file a bug against any product. In the comment section, put the following:

This links: apt:some-package
As does this: apt://some-package
As does this: data:text/plain,hello
This does not: file://some/file.txt

To post a comment you must log in.
Revision history for this message
Māris Fogels (mars) wrote :

Hi J.C.,

An excellent change, r=mars

I am surprised you have to use the DatabaseFunctionalLayer. The formatter objects must be doing a lot of work? Could we get away with just Zope registry, or even less, in this test?

Maris

review: Approve
Revision history for this message
j.c.sackett (jcsackett) wrote :

On Dec 14, 2010, at 2:21 PM, Māris Fogels wrote:
> I am surprised you have to use the DatabaseFunctionalLayer. The formatter objects must be doing a lot of work? Could we get away with just Zope registry, or even less, in this test?

Actually, no layer is needed. I am just incredibly used to typing layer=DatabaseFunctionalLayer.

I've whacked the layer and everything is still dandy. Thanks for catching that.

//j.c.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.