Merge lp:~jcsackett/launchpad/unknown-blueprints-service-597738-2 into lp:launchpad

Proposed by j.c.sackett on 2010-09-22
Status: Merged
Approved by: j.c.sackett on 2010-09-22
Approved revision: no longer in the source branch.
Merged at revision: 11631
Proposed branch: lp:~jcsackett/launchpad/unknown-blueprints-service-597738-2
Merge into: lp:launchpad
Prerequisite: lp:~jcsackett/launchpad/series-need-usage-attributes-643902
Diff against target: 120 lines (+23/-48)
2 files modified
lib/lp/blueprints/templates/unknown-specs.pt (+22/-48)
lib/lp/registry/tests/test_service_usage.py (+1/-0)
To merge this branch: bzr merge lp:~jcsackett/launchpad/unknown-blueprints-service-597738-2
Reviewer Review Type Date Requested Status
Edwin Grubbs (community) code 2010-09-22 Approve on 2010-09-22
Review via email: mp+36242@code.launchpad.net

Commit message

Cleans up unknown-specs template; template used to use a nasty python conditional and didn't have norobots; nofollow.

Description of the change

Summary
=======

Cleans up the unknown-specs template in blueprints by leveraging work in a branch that adds usage enums to product and distribution series.

Proposed Fix
============

Remove nasty python conditionals from the template and use the now added attributes.

Implementation details
======================

As in proposed fix.

Tests
=====

bin/test -m lp.blueprints

Demo and Q/A
============

Open http://blueprints.launchpad.dev/kubuntu/krunch and http://blueprints.launchpad.dev/firefox/trunk; both should work fine and display a "Launchpad doesn't know how" message.

Lint
====
Output:

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/blueprints/templates/unknown-specs.pt
  lib/lp/registry/adapters.py
  lib/lp/registry/configure.zcml
  lib/lp/registry/interfaces/distroseries.py
  lib/lp/registry/interfaces/productseries.py
  lib/lp/registry/model/distroseries.py
  lib/lp/registry/model/productseries.py
  lib/lp/registry/tests/test_service_usage.py

./lib/lp/blueprints/templates/unknown-specs.pt
      20: not well-formed (invalid token)
./lib/lp/registry/interfaces/distroseries.py
     417: E301 expected 1 blank line, found 2
     458: E301 expected 1 blank line, found 0
./lib/lp/registry/model/distroseries.py
     364: E301 expected 1 blank line, found 2
     708: E301 expected 1 blank line, found 2

Errors are a result of lint's comment/blank line issue.
Output mucked up by merged precondition branch.

To post a comment you must log in.
Edwin Grubbs (edwin-grubbs) wrote :

Hi JC,

This branch looks good.

-Edwin

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/blueprints/templates/unknown-specs.pt'
2--- lib/lp/blueprints/templates/unknown-specs.pt 2010-09-23 15:15:02 +0000
3+++ lib/lp/blueprints/templates/unknown-specs.pt 2010-09-24 15:22:50 +0000
4@@ -6,7 +6,6 @@
5 metal:use-macro="view/macro:page/main_side"
6 i18n:domain="launchpad"
7 >
8-
9 <head>
10 <tal:head_epilogue metal:fill-slot="head_epilogue">
11 <meta name="robots" content="noindex,nofollow" />
12@@ -14,48 +13,23 @@
13 </head>
14
15 <body>
16-
17 <div metal:fill-slot="main">
18 <div class="top-portlet">
19 <div id="specs-unknown">
20 <strong>
21- <tal:is_project condition="view/is_project">
22+ <tal:is-project condition="view/is_project">
23 <p>
24 Launchpad does not know how
25 <tal:project replace="view/context/displayname" /> tracks feature
26 planning or documentation.
27 </p>
28- </tal:is_project>
29-
30- <tal:is_series condition="view/is_series">
31- <div
32- tal:omit-tag=""
33- tal:define="target python:view.context.product and view.context.product or view.context.distribution;
34- blueprints_usage target/blueprints_usage">
35- <p tal:condition="blueprints_usage/enumvalue:EXTERNAL">
36- <tal:project replace="target/displayname" />'s
37- <tal:project replace="view/context/displayname" /> series does
38- not use Launchpap for planning or documentation.
39- </p>
40- <p tal:condition="blueprints_usage/enumvalue:NOT_APPLICABLE">
41- <tal:project replace="target/displayname" />'s
42- <tal:project replace="view/context/displayname" /> series does not track
43- feature planning or documentation.
44- </p>
45- <p tal:condition="blueprints_usage/enumvalue:UNKNOWN">
46- Launchpad does not know how
47- <tal:project replace="target/displayname" />'s
48- <tal:project replace="view/context/displayname" /> series tracks feature
49- planning or documentation.
50- </p>
51- </div>
52- </tal:is_series>
53-
54- <tal:not_project_or_series
55- condition="python:not (view.is_project or view.is_series)">
56- <div tal:omit-tag="" tal:define="blueprints_usage view/context/blueprints_usage">
57- <p tal:condition="blueprints_usage/enumvalue:EXTERNAL">
58- <tal:project replace="view/context/displayname" /> does not use launchpad
59+ </tal:is-project>
60+
61+ <tal:not-project
62+ condition="not:view/is_project">
63+ <tal:blueprints define="blueprints_usage view/context/blueprints_usage">
64+ <p tal:condition="blueprints_usage/enumvalue:EXTERNAL">
65+ <tal:project replace="view/context/displayname" /> does not use Launchpad
66 for planning or documentation.
67 </p>
68 <p tal:condition="blueprints_usage/enumvalue:NOT_APPLICABLE">
69@@ -63,25 +37,25 @@
70 feature planning or documentation.
71 </p>
72 <p tal:condition="blueprints_usage/enumvalue:UNKNOWN">
73- launchpad does not know how
74+ Launchpad does not know how
75 <tal:project replace="view/context/displayname" /> tracks feature
76 planning or documentation.
77 </p>
78- </div>
79- </tal:not_project_or_series>
80+ </tal:blueprints>
81+ </tal:not-project>
82 </strong>
83
84- <tal:has_wiki condition="view/has_wiki">
85- <p id="wiki-fallback"
86- tal:define="wiki view/context/wikiurl"
87- tal:condition="wiki">
88- <tal:project replace="view/context/displayname" /> has a wiki, which
89- may be used for feature plannning and documentation.<br />
90- <a tal:attributes="href view/context/wikiurl">
91- <tal:project replace="view/context/displayname" /> wiki
92- </a>
93- </p>
94- </tal:has_wiki>
95+ <tal:has-wiki tal:condition="view/has_wiki">
96+ <p id="wiki-fallback"
97+ tal:define="wiki view/context/wikiurl"
98+ tal:condition="wiki">
99+ <tal:project replace="view/context/displayname" /> has a wiki, which
100+ may be used for feature plannning and documentation.<br />
101+ <a tal:attributes="href view/context/wikiurl">
102+ <tal:project replace="view/context/displayname" /> wiki
103+ </a>
104+ </p>
105+ </tal:has-wiki>
106 </div>
107
108 <p id="configure-support"
109
110=== modified file 'lib/lp/registry/tests/test_service_usage.py'
111--- lib/lp/registry/tests/test_service_usage.py 2010-09-21 14:47:26 +0000
112+++ lib/lp/registry/tests/test_service_usage.py 2010-09-24 15:22:50 +0000
113@@ -145,6 +145,7 @@
114
115 class SeriesUsageEnumsMixin(object):
116 """Mixin to test the usage attributes on product and distro series."""
117+
118 def setUp(self):
119 self.series = None
120 self.series_pillar = None