Merge lp:~danilo/launchpad-work-items-tracker/roadmap-urls into lp:~linaro-automation/launchpad-work-items-tracker/linaro

Proposed by Данило Шеган
Status: Merged
Approved by: Stevan Radaković
Approved revision: 348
Merged at revision: 347
Proposed branch: lp:~danilo/launchpad-work-items-tracker/roadmap-urls
Merge into: lp:~linaro-automation/launchpad-work-items-tracker/linaro
Diff against target: 26 lines (+7/-4)
1 file modified
report_tools.py (+7/-4)
To merge this branch: bzr merge lp:~danilo/launchpad-work-items-tracker/roadmap-urls
Reviewer Review Type Date Requested Status
Stevan Radaković Approve
Review via email: mp+148177@code.launchpad.net

Description of the change

To enable easier linking from blueprints to cards and back, I'd like to support "Roadmap id" values which are actual URLs on cards.linaro.org.

I'll simply provide a small hack to look up blueprints by card URLs instead of just by card IDs.

Example blueprint is https://blueprints.launchpad.net/linaro-android-infrastructure/+spec/flatten-android-artifacts

To post a comment you must log in.
Revision history for this message
Stevan Radaković (stevanr) wrote :

Looks good.
Approve +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'report_tools.py'
2--- report_tools.py 2012-07-17 14:29:45 +0000
3+++ report_tools.py 2013-02-13 13:22:23 +0000
4@@ -4,7 +4,7 @@
5
6 import datetime
7 import urllib, sys, os.path, re
8-from storm.locals import create_database, Store
9+from storm.locals import create_database, Store, Or
10 from subprocess import Popen
11 from cgi import escape
12 import errno
13@@ -999,9 +999,12 @@
14
15
16 def card_blueprints(store, roadmap_id):
17- metas = store.find(Meta,
18- Meta.key == u'Roadmap id',
19- Meta.value == roadmap_id)
20+ card_url = u'http://cards.linaro.org/browse/%s' % roadmap_id
21+ metas = store.find(
22+ Meta,
23+ Meta.key == u'Roadmap id',
24+ Or(Meta.value == roadmap_id,
25+ Meta.value == card_url))
26 return [meta.blueprint for meta in metas]
27
28

Subscribers

People subscribed via source and target branches