Merge lp:~cjwatson/launchpad/code-pagetests-future-imports into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18656
Proposed branch: lp:~cjwatson/launchpad/code-pagetests-future-imports
Merge into: lp:launchpad
Prerequisite: lp:~cjwatson/launchpad/code-doctests-future-imports
Diff against target: 2999 lines (+446/-427)
47 files modified
lib/lp/code/stories/branches/xx-bazaar-home.txt (+13/-13)
lib/lp/code/stories/branches/xx-branch-deletion.txt (+6/-6)
lib/lp/code/stories/branches/xx-branch-edit.txt (+12/-12)
lib/lp/code/stories/branches/xx-branch-index.txt (+37/-37)
lib/lp/code/stories/branches/xx-branch-listings-merge-proposal-badge.txt (+2/-2)
lib/lp/code/stories/branches/xx-branch-listings.txt (+29/-29)
lib/lp/code/stories/branches/xx-branch-mirror-failures.txt (+4/-4)
lib/lp/code/stories/branches/xx-branch-tag-cloud.txt (+2/-2)
lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt (+2/-2)
lib/lp/code/stories/branches/xx-branchmergeproposals.txt (+29/-29)
lib/lp/code/stories/branches/xx-bug-branch-links.txt (+5/-5)
lib/lp/code/stories/branches/xx-claiming-team-code-reviews.txt (+4/-4)
lib/lp/code/stories/branches/xx-code-review-comments.txt (+7/-7)
lib/lp/code/stories/branches/xx-distribution-branches.txt (+1/-1)
lib/lp/code/stories/branches/xx-distroseries-branches.txt (+1/-1)
lib/lp/code/stories/branches/xx-nearby-branches.txt (+1/-1)
lib/lp/code/stories/branches/xx-person-branches.txt (+10/-10)
lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt (+3/-3)
lib/lp/code/stories/branches/xx-private-branch-listings.txt (+15/-15)
lib/lp/code/stories/branches/xx-product-branches.txt (+16/-16)
lib/lp/code/stories/branches/xx-product-overview.txt (+2/-2)
lib/lp/code/stories/branches/xx-project-branches.txt (+4/-4)
lib/lp/code/stories/branches/xx-propose-for-merging.txt (+1/-1)
lib/lp/code/stories/branches/xx-source-package-branches-empty.txt (+4/-4)
lib/lp/code/stories/branches/xx-source-package-branches-listing.txt (+1/-1)
lib/lp/code/stories/branches/xx-subscribing-branches.txt (+4/-4)
lib/lp/code/stories/branches/xx-upgrading-branches.txt (+1/-1)
lib/lp/code/stories/branches/xx-upload-directions.txt (+11/-11)
lib/lp/code/stories/codeimport/xx-admin-codeimport.txt (+3/-3)
lib/lp/code/stories/codeimport/xx-codeimport-machines.txt (+7/-7)
lib/lp/code/stories/codeimport/xx-codeimport-results.txt (+3/-3)
lib/lp/code/stories/codeimport/xx-codeimport-view.txt (+8/-8)
lib/lp/code/stories/codeimport/xx-create-codeimport.txt (+13/-13)
lib/lp/code/stories/codeimport/xx-edit-codeimport.txt (+2/-2)
lib/lp/code/stories/codeimport/xx-failing-codeimport.txt (+3/-2)
lib/lp/code/stories/feeds/xx-branch-atom.txt (+5/-5)
lib/lp/code/stories/feeds/xx-revision-atom.txt (+2/-2)
lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt (+8/-8)
lib/lp/code/stories/webservice/xx-branch-links.txt (+2/-2)
lib/lp/code/stories/webservice/xx-branch.txt (+14/-14)
lib/lp/code/stories/webservice/xx-branches.txt (+4/-4)
lib/lp/code/stories/webservice/xx-branchmergeproposal.txt (+12/-13)
lib/lp/code/stories/webservice/xx-branchsubscription.txt (+3/-3)
lib/lp/code/stories/webservice/xx-code-import.txt (+105/-105)
lib/lp/code/tests/test_doc.py (+3/-1)
lib/lp/services/testing/__init__.py (+12/-4)
lib/lp/testing/pages.py (+10/-1)
To merge this branch: bzr merge lp:~cjwatson/launchpad/code-pagetests-future-imports
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+345472@code.launchpad.net

Commit message

Convert pagetests under lp.code to Launchpad's preferred __future__ imports.

Description of the change

This is long, but it's almost all just boring mechanical print-statement-to-function conversion.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
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/code/stories/branches/xx-bazaar-home.txt'
2--- lib/lp/code/stories/branches/xx-bazaar-home.txt 2017-10-23 00:16:39 +0000
3+++ lib/lp/code/stories/branches/xx-bazaar-home.txt 2018-05-13 10:39:08 +0000
4@@ -14,7 +14,7 @@
5 >>> browser.open('http://code.launchpad.dev/')
6 >>> footer = find_tag_by_id(browser.contents, 'application-footer')
7
8- >>> print extract_text(footer)
9+ >>> print(extract_text(footer))
10 30 branches registered in
11 6 projects
12 1 imported branches
13@@ -30,11 +30,11 @@
14 with a link to the complete listing.
15
16 >>> preview = find_tag_by_id(browser.contents, 'project-cloud-preview')
17- >>> print extract_text(preview)
18+ >>> print(extract_text(preview))
19 Most active projects in the last month
20 see all projects…
21
22- >>> print preview.findAll('a')[-1]['href']
23+ >>> print(preview.findAll('a')[-1]['href'])
24 /projects
25
26
27@@ -44,7 +44,7 @@
28 Any user can see the project search form.
29
30 >>> form = find_tag_by_id(browser.contents, 'search-projects-form')
31- >>> print form['action']
32+ >>> print(form['action'])
33 http://launchpad.dev/projects
34
35 >>> browser.getControl(name='text', index=0)
36@@ -72,11 +72,11 @@
37 registered branches first.
38
39 >>> registered = find_tag_by_id(browser.contents, 'recently-registered')
40- >>> print registered.findAll('a')[-1]['href']
41+ >>> print(registered.findAll('a')[-1]['href'])
42 /+recently-registered-branches
43
44 >>> browser.getLink(url='recently-registered-branches').click()
45- >>> print browser.title
46+ >>> print(browser.title)
47 Recently registered branches
48
49 Since the view contains branches across different projects, the project
50@@ -85,7 +85,7 @@
51
52 >>> table = find_tag_by_id(browser.contents, 'branchtable')
53 >>> for row in table.thead.findAll('tr'):
54- ... print extract_text(row)
55+ ... print(extract_text(row))
56 Name
57 Status
58 Registered
59@@ -105,16 +105,16 @@
60
61 >>> browser.open('http://code.launchpad.dev/')
62 >>> changed = find_tag_by_id(browser.contents, 'recently-changed')
63- >>> print changed.findAll('a')[-1]['href']
64+ >>> print(changed.findAll('a')[-1]['href'])
65 /+recently-changed-branches
66
67 >>> browser.getLink(url='recently-changed-branches').click()
68- >>> print browser.title
69+ >>> print(browser.title)
70 Recently changed branches
71
72 >>> table = find_tag_by_id(browser.contents, 'branchtable')
73 >>> for row in table.thead.findAll('tr'):
74- ... print extract_text(row)
75+ ... print(extract_text(row))
76 Name
77 Status
78 Registered
79@@ -132,11 +132,11 @@
80
81 >>> browser.open('http://code.launchpad.dev/')
82 >>> imported = find_tag_by_id(browser.contents, 'recent-imports')
83- >>> print imported.findAll('a')[-1]['href']
84+ >>> print(imported.findAll('a')[-1]['href'])
85 /+recently-imported-branches
86
87 >>> browser.getLink(url='recently-imported-branches').click()
88- >>> print browser.title
89+ >>> print(browser.title)
90 Recently imported branches
91
92 Since imported branches are all owned by vcs-imports, and the authors
93@@ -145,7 +145,7 @@
94
95 >>> table = find_tag_by_id(browser.contents, 'branchtable')
96 >>> for row in table.thead.findAll('tr'):
97- ... print extract_text(row)
98+ ... print(extract_text(row))
99 Name
100 Status
101 Registered
102
103=== modified file 'lib/lp/code/stories/branches/xx-branch-deletion.txt'
104--- lib/lp/code/stories/branches/xx-branch-deletion.txt 2014-11-27 22:13:36 +0000
105+++ lib/lp/code/stories/branches/xx-branch-deletion.txt 2018-05-13 10:39:08 +0000
106@@ -23,20 +23,20 @@
107
108 >>> browser = setupBrowser(auth="Basic alice@example.com:test")
109 >>> browser.open('http://code.launchpad.dev/~alice/earthlynx/to-delete')
110- >>> print browser.title
111+ >>> print(browser.title)
112 to-delete : Code : Earth Lynx
113
114 The newly created branch has an action 'Delete branch'.
115
116 >>> delete_link = browser.getLink('Delete branch')
117- >>> print delete_link.url
118+ >>> print(delete_link.url)
119 http://code.launchpad.dev/~alice/earthlynx/to-delete/+delete
120
121 When the user clicks on the link, they are informed what will happen if they
122 delete the branch.
123
124 >>> delete_link.click()
125- >>> print extract_text(find_main_content(browser.contents))
126+ >>> print(extract_text(find_main_content(browser.contents)))
127 Delete branch lp://dev/~alice/earthlynx/to-delete
128 to-delete ...
129 Branch deletion is permanent.
130@@ -47,7 +47,7 @@
131 the branch has been deleted.
132
133 >>> browser.getControl('Delete').click()
134- >>> print browser.url
135+ >>> print(browser.url)
136 http://code.launchpad.dev/earthlynx
137 >>> print_feedback_messages(browser.contents)
138 Branch ~alice/earthlynx/to-delete deleted...
139@@ -62,7 +62,7 @@
140 >>> browser.open('http://code.launchpad.dev/~alice/+junk/to-delete')
141 >>> browser.getLink('Delete branch').click()
142 >>> browser.getControl('Delete').click()
143- >>> print browser.url
144+ >>> print(browser.url)
145 http://code.launchpad.dev/~alice
146 >>> print_feedback_messages(browser.contents)
147 Branch ~alice/+junk/to-delete deleted...
148@@ -80,7 +80,7 @@
149
150 >>> admin_browser.open(branch_location)
151 >>> admin_browser.getLink('Delete branch').click()
152- >>> print extract_text(find_main_content(admin_browser.contents))
153+ >>> print(extract_text(find_main_content(admin_browser.contents)))
154 Delete branch...
155 This branch cannot be deleted as it has 1 branch sharing revisions.
156
157
158=== modified file 'lib/lp/code/stories/branches/xx-branch-edit.txt'
159--- lib/lp/code/stories/branches/xx-branch-edit.txt 2015-09-02 16:50:04 +0000
160+++ lib/lp/code/stories/branches/xx-branch-edit.txt 2018-05-13 10:39:08 +0000
161@@ -44,7 +44,7 @@
162
163 The form should have been filled with sample data values.
164
165- >>> print browser.getControl('Branch URL').value
166+ >>> print(browser.getControl('Branch URL').value)
167 http://trekkies.example.com/gnome-terminal/klingon
168
169 Then, post the changes to the summary. Also add a trailing slash to the
170@@ -78,19 +78,19 @@
171 >>> len(stub.test_emails)
172 0
173
174- >>> print browser.url
175+ >>> print(browser.url)
176 http://code.launchpad.dev/~name12/gnome-terminal/klingon
177
178- >>> print extract_text(find_tag_by_id(
179- ... browser.contents, 'branch-info'))
180+ >>> print(extract_text(find_tag_by_id(
181+ ... browser.contents, 'branch-info')))
182 Branch information ...
183 Project: GNOME Terminal
184 Status: Experimental Edit
185 Location: http://trekkies.example.com/gnome-terminal/klingon
186 Last mirrored: ...
187
188- >>> print extract_text(find_tag_by_id(browser.contents,
189- ... 'branch-description').p)
190+ >>> print(extract_text(find_tag_by_id(browser.contents,
191+ ... 'branch-description').p))
192 Klingon support for Gnome Terminal
193
194
195@@ -123,7 +123,7 @@
196
197 >>> contents = browser.contents
198 >>> status_tag = find_tag_by_id(contents, 'edit-lifecycle_status')
199- >>> print extract_text(status_tag)
200+ >>> print(extract_text(status_tag))
201 Merged Edit
202
203 Set the branch status back to its initial state.
204@@ -217,7 +217,7 @@
205 ... 'http://acme.example.com/~foo/bar/baz')
206 Traceback (most recent call last):
207 ...
208- LookupError: label 'Branch URL'
209+ LookupError: label u'Branch URL'
210
211
212 Editing the whiteboard
213@@ -255,7 +255,7 @@
214 set.
215
216 >>> stub.test_emails = []
217- >>> print whiteboard_tag
218+ >>> print(whiteboard_tag)
219 None
220
221 >>> nopriv_browser.getLink('Edit whiteboard').click()
222@@ -266,7 +266,7 @@
223
224 >>> whiteboard_tag = find_tag_by_id(
225 ... nopriv_browser.contents, 'branch-whiteboard-value')
226- >>> print extract_text(whiteboard_tag)
227+ >>> print(extract_text(whiteboard_tag))
228 New whiteboard value
229
230 The subscribers of the branch are notified that someone else has
231@@ -276,7 +276,7 @@
232 >>> len(stub.test_emails)
233 1
234
235- >>> print stub.test_emails[0][2]
236+ >>> print(stub.test_emails[0][2])
237 Content-Type: ...
238 ...
239 To: Sample Person <test@canonical.com>
240@@ -322,7 +322,7 @@
241 >>> admin_browser.getLink('Change branch details').click()
242 >>> admin_browser.getControl('Owner').value = 'mark'
243 >>> admin_browser.getControl('Change Branch').click()
244- >>> print admin_browser.url
245+ >>> print(admin_browser.url)
246 http://code.launchpad.dev/~mark/firefox/main
247
248
249
250=== modified file 'lib/lp/code/stories/branches/xx-branch-index.txt'
251--- lib/lp/code/stories/branches/xx-branch-index.txt 2018-01-19 17:21:44 +0000
252+++ lib/lp/code/stories/branches/xx-branch-index.txt 2018-05-13 10:39:08 +0000
253@@ -57,9 +57,9 @@
254 >>> def print_merge_links(browser):
255 ... links = find_tag_by_id(browser.contents, 'merge-links')
256 ... if not links:
257- ... print None
258+ ... print(None)
259 ... else:
260- ... print extract_text(links)
261+ ... print(extract_text(links))
262 >>> print_merge_links(user_browser)
263 None
264
265@@ -76,7 +76,7 @@
266 ... revisions = find_tags_by_class(
267 ... browser.contents, 'revision-details')
268 ... for revision in revisions:
269- ... print extract_text(revision).encode('ascii')
270+ ... print(extract_text(revision).encode('ascii'))
271
272 >>> print_revisions(user_browser)
273 5. By Eric on 2007-01-05
274@@ -89,7 +89,7 @@
275
276 >>> revision = find_tags_by_class(
277 ... user_browser.contents, 'revision-details', only_first=True)
278- >>> print revision.a
279+ >>> print(revision.a)
280 <a href="https://bazaar.launchpad.dev/~eric/fooix/trunk/revision/5">5</a>
281
282
283@@ -103,19 +103,19 @@
284 ... 'http://code.launchpad.dev/~name12/+branch/+junk/junk.dev')
285 >>> commit_messages = find_tags_by_class(
286 ... browser.contents, 'revision-comment')
287- >>> print commit_messages[0].p.renderContents()
288+ >>> print(commit_messages[0].p.renderContents())
289 fix bug in bar
290
291 When a commit message refers to a bug using the form "bug <bugnumber>",
292 a link to that bug is created.
293
294- >>> print commit_messages[3].p.renderContents()
295+ >>> print(commit_messages[3].p.renderContents())
296 fix <a ...>bug 1</a>
297
298 This link can be followed to the bug's details page.
299
300 >>> browser.getLink('bug 1').click()
301- >>> print browser.title
302+ >>> print(browser.title)
303 Bug #1 ...
304
305
306@@ -132,8 +132,8 @@
307 helpful message.
308
309 >>> browser.open('http://code.launchpad.dev/~name12/firefox/main')
310- >>> print extract_text(
311- ... find_tag_by_id(browser.contents, 'recent-revisions'))
312+ >>> print(extract_text(
313+ ... find_tag_by_id(browser.contents, 'recent-revisions')))
314 Recent revisions
315 This branch has not been mirrored yet.
316
317@@ -142,15 +142,15 @@
318
319 >>> browser.open(
320 ... 'http://code.launchpad.dev/~name12/gnome-terminal/pushed')
321- >>> print extract_text(
322- ... find_tag_by_id(browser.contents, 'recent-revisions'))
323+ >>> print(extract_text(
324+ ... find_tag_by_id(browser.contents, 'recent-revisions')))
325 Recent revisions
326 This branch has not been pushed to yet.
327
328 >>> browser.open(
329 ... 'http://code.launchpad.dev/~vcs-imports/evolution/main')
330- >>> print extract_text(
331- ... find_tag_by_id(browser.contents, 'recent-revisions'))
332+ >>> print(extract_text(
333+ ... find_tag_by_id(browser.contents, 'recent-revisions')))
334 Recent revisions
335 This branch has not been imported yet.
336
337@@ -160,8 +160,8 @@
338
339 >>> browser.open(
340 ... 'http://code.launchpad.dev/~name12/gnome-terminal/mirrored')
341- >>> print extract_text(
342- ... find_tag_by_id(browser.contents, 'recent-revisions'))
343+ >>> print(extract_text(
344+ ... find_tag_by_id(browser.contents, 'recent-revisions')))
345 Recent revisions
346 This branch has not been scanned yet.
347
348@@ -170,8 +170,8 @@
349
350 >>> browser.open(
351 ... 'http://code.launchpad.dev/~name12/gnome-terminal/scanned')
352- >>> print extract_text(
353- ... find_tag_by_id(browser.contents, 'recent-revisions'))
354+ >>> print(extract_text(
355+ ... find_tag_by_id(browser.contents, 'recent-revisions')))
356 Recent revisions
357 This branch is empty.
358
359@@ -192,13 +192,13 @@
360
361 >>> browser.open(
362 ... 'http://code.launchpad.dev/~name12/gnome-terminal/scanned')
363- >>> print extract_text(get_branch_details_table())
364+ >>> print(extract_text(get_branch_details_table()))
365 Branch information
366 Owner: Sample Person
367 Project: GNOME Terminal
368 Status: Development
369
370- >>> print extract_text(get_branch_management_portlet())
371+ >>> print(extract_text(get_branch_management_portlet()))
372 Only Sample Person can upload to this branch.
373 If you are Sample Person please log in for upload directions.
374 Browse the code
375@@ -225,7 +225,7 @@
376
377 >>> browser.open(
378 ... 'http://code.launchpad.dev/~no-priv/+junk/mirrored')
379- >>> print extract_text(get_branch_details_table())
380+ >>> print(extract_text(get_branch_details_table()))
381 Branch information...
382 Status: Development
383 Location: http://example.com/mirrored
384@@ -237,7 +237,7 @@
385 >>> def get_branch_description(browser):
386 ... return extract_text(find_tag_by_id(
387 ... browser.contents, 'branch-description'))
388- >>> print get_branch_description(browser)
389+ >>> print(get_branch_description(browser))
390 Traceback (most recent call last):
391 TypeError: expected string or buffer
392
393@@ -246,7 +246,7 @@
394
395 >>> browser.open(
396 ... 'http://code.launchpad.dev/~name12/gnome-terminal/main')
397- >>> print extract_text(get_branch_details_table())
398+ >>> print(extract_text(get_branch_details_table()))
399 Branch information
400 Owner: Sample Person
401 Project: GNOME Terminal
402@@ -255,7 +255,7 @@
403 Last mirrored: Not mirrored yet
404 Next mirror: Disabled
405
406- >>> print get_branch_description(browser)
407+ >>> print(get_branch_description(browser))
408 Main branch of development for GNOME Terminal.
409 Stable branches are based on that one...
410
411@@ -275,7 +275,7 @@
412
413 >>> browser.open(
414 ... 'http://code.launchpad.dev/~no-priv/+junk/mirror-disabled')
415- >>> print extract_text(get_branch_details_table())
416+ >>> print(extract_text(get_branch_details_table()))
417 Branch information
418 Owner: No Privileges Person
419 Status: Development
420@@ -291,8 +291,8 @@
421
422 >>> browser.open(
423 ... 'http://code.launchpad.dev/~name12/gnome-terminal/scanned')
424- >>> print extract_text(find_tag_by_id(
425- ... browser.contents, "recent-revisions"))
426+ >>> print(extract_text(find_tag_by_id(
427+ ... browser.contents, "recent-revisions")))
428 Recent revisions
429 This branch is empty.
430
431@@ -301,7 +301,7 @@
432
433 >>> browser.open(
434 ... 'http://code.launchpad.dev/~name12/+junk/junk.dev')
435- >>> print browser.getLink('All revisions').url
436+ >>> print(browser.getLink('All revisions').url)
437 https://bazaar.launchpad.dev/~name12/+junk/junk.dev/changes
438
439 If the branch is private, the browse code link is not shown. In order to
440@@ -338,8 +338,8 @@
441
442 >>> browser.open(
443 ... 'http://code.launchpad.dev/~landscape-developers/landscape/trunk')
444- >>> print extract_text(find_tag_by_id(
445- ... browser.contents, 'branch-management'))
446+ >>> print(extract_text(find_tag_by_id(
447+ ... browser.contents, 'branch-management')))
448 Get this branch:
449 bzr branch lp://dev/~landscape-developers/landscape/trunk
450 ...
451@@ -348,8 +348,8 @@
452
453 >>> browser.open(
454 ... 'http://code.launchpad.dev/~name12/gnome-terminal/scanned')
455- >>> print extract_text(find_tag_by_id(
456- ... browser.contents, 'branch-management'))
457+ >>> print(extract_text(find_tag_by_id(
458+ ... browser.contents, 'branch-management')))
459 Get this branch: bzr branch lp://dev/~name12/gnome-terminal/scanned
460 ...
461
462@@ -367,12 +367,12 @@
463
464 The data that we specified is shown on the web page.
465
466- >>> print extract_text(find_tag_by_id(
467- ... browser.contents, 'branch-format'))
468+ >>> print(extract_text(find_tag_by_id(
469+ ... browser.contents, 'branch-format')))
470 Branch format: Branch format 5
471
472- >>> print extract_text(find_tag_by_id(
473- ... browser.contents, 'repository-format'))
474+ >>> print(extract_text(find_tag_by_id(
475+ ... browser.contents, 'repository-format')))
476 Repository format:
477 Bazaar pack repository format 1 (needs bzr 0.92)
478
479@@ -397,7 +397,7 @@
480
481 The stacked-on information appears in the branch summary:
482
483- >>> print extract_text(find_tag_by_id(browser.contents, 'stacked-on'))
484+ >>> print(extract_text(find_tag_by_id(browser.contents, 'stacked-on')))
485 Stacked on: lp://dev/~person-name.../product-name.../branch...
486
487 >>> browser.getLink(stacked_on_name).url == stacked_on_url
488@@ -410,7 +410,7 @@
489
490 >>> browser.open(url)
491 >>> content = find_tag_by_id(browser.contents, 'document')
492- >>> print extract_text(find_tag_by_id(content, 'privacy'))
493+ >>> print(extract_text(find_tag_by_id(content, 'privacy')))
494 This branch contains Public information...
495
496 Navigation Context
497
498=== modified file 'lib/lp/code/stories/branches/xx-branch-listings-merge-proposal-badge.txt'
499--- lib/lp/code/stories/branches/xx-branch-listings-merge-proposal-badge.txt 2017-10-23 00:16:39 +0000
500+++ lib/lp/code/stories/branches/xx-branch-listings-merge-proposal-badge.txt 2018-05-13 10:39:08 +0000
501@@ -6,10 +6,10 @@
502 ... cells = row.findAll('td')
503 ... first_cell = cells[0]
504 ... anchors = first_cell.findAll('a')
505- ... print anchors[0].get('href')
506+ ... print(anchors[0].get('href'))
507 ... # Badges in the next cell
508 ... for img in cells[1].findAll('img'):
509- ... print img['title']
510+ ... print(img['title'])
511
512
513 >>> login('foo.bar@canonical.com')
514
515=== modified file 'lib/lp/code/stories/branches/xx-branch-listings.txt'
516--- lib/lp/code/stories/branches/xx-branch-listings.txt 2017-10-23 00:16:39 +0000
517+++ lib/lp/code/stories/branches/xx-branch-listings.txt 2018-05-13 10:39:08 +0000
518@@ -23,13 +23,13 @@
519 >>> browser = setupBrowser(auth='Basic test@canonical.com:test')
520 >>> browser.open('http://code.launchpad.dev/~name12')
521 >>> links = find_tag_by_id(browser.contents, 'branch-batch-links')
522- >>> print links.renderContents()
523+ >>> print(links.renderContents())
524 <BLANKLINE>
525 ...1...&rarr;...6...of 10 results...
526
527 >>> table = find_tag_by_id(browser.contents, 'branchtable')
528 >>> for row in table.thead.findAll('tr'):
529- ... print extract_text(row)
530+ ... print(extract_text(row))
531 Name
532 Status
533 Last Modified
534@@ -40,7 +40,7 @@
535 and are really just branch metadata without the revisions behind them.
536
537 >>> for row in table.tbody.findAll('tr'):
538- ... print extract_text(row)
539+ ... print(extract_text(row))
540 lp://dev/~name12/firefox/main Development ...
541 lp://dev/~name12/gnome-terminal/2.6 Mature ...
542 lp://dev/~name12/gnome-terminal/main Development ...
543@@ -50,13 +50,13 @@
544
545 >>> browser.getLink('Next').click()
546 >>> links = find_tag_by_id(browser.contents, 'branch-batch-links')
547- >>> print links.renderContents()
548+ >>> print(links.renderContents())
549 <BLANKLINE>
550 ...7...&rarr;...10...of 10 results...
551
552 >>> table = find_tag_by_id(browser.contents, 'branchtable')
553 >>> for row in table.tbody.findAll('tr'):
554- ... print extract_text(row)
555+ ... print(extract_text(row))
556 lp://dev/~name12/gnome-terminal/klingon Experimental ...
557 lp://dev/~name12/+junk/junk.contrib Development ...
558 lp://dev/~name12/+junk/junk.dev Experimental ...
559@@ -83,7 +83,7 @@
560 >>> browser.open('http://code.launchpad.dev/~name12')
561 >>> table = find_tag_by_id(browser.contents, 'branchtable')
562 >>> for row in table.tbody.findAll('tr'):
563- ... print extract_text(row)
564+ ... print(extract_text(row))
565 lp://dev/~name12/firefox/main Development ...
566 lp://dev/~name12/gnome-terminal/2.6 Mature ...
567 lp://dev/~name12/gnome-terminal/main Development ...
568@@ -112,13 +112,13 @@
569 Now all types of branches should be shown.
570
571 >>> links = find_tag_by_id(browser.contents, 'branch-batch-links')
572- >>> print links.renderContents()
573+ >>> print(links.renderContents())
574 <BLANKLINE>
575 ...1...&rarr;...6...of 12 results...
576
577 >>> table = find_tag_by_id(browser.contents, 'branchtable')
578 >>> for row in table.tbody.findAll('tr'):
579- ... print extract_text(row)
580+ ... print(extract_text(row))
581 lp://dev/~name12/firefox/main Development ...
582 lp://dev/~name12/gnome-terminal/2.4 Abandoned ...
583 lp://dev/~name12/gnome-terminal/slowness Merged ...
584@@ -128,13 +128,13 @@
585
586 >>> browser.getLink('Next').click()
587 >>> links = find_tag_by_id(browser.contents, 'branch-batch-links')
588- >>> print links.renderContents()
589+ >>> print(links.renderContents())
590 <BLANKLINE>
591 ...7...&rarr;...12...of 12 results...
592
593 >>> table = find_tag_by_id(browser.contents, 'branchtable')
594 >>> for row in table.tbody.findAll('tr'):
595- ... print extract_text(row)
596+ ... print(extract_text(row))
597 lp://dev/~name12/gnome-terminal/pushed Development ...
598 lp://dev/~name12/gnome-terminal/scanned Development ...
599 lp://dev/~name12/gnome-terminal/klingon Experimental ...
600@@ -149,7 +149,7 @@
601 >>> browser.getControl('Filter').click()
602 >>> table = find_tag_by_id(browser.contents, 'branchtable')
603 >>> for row in table.tbody.findAll('tr'):
604- ... print extract_text(row)
605+ ... print(extract_text(row))
606 lp://dev/~name12/gnome-terminal/2.4 Abandoned ...
607
608 If anyone tries to hack the URL, and put in an invalid
609@@ -161,7 +161,7 @@
610 ['Any active status']
611 >>> table = find_tag_by_id(browser.contents, 'branchtable')
612 >>> for row in table.tbody.findAll('tr'):
613- ... print extract_text(row)
614+ ... print(extract_text(row))
615 lp://dev/~name12/firefox/main Development ...
616 lp://dev/~name12/gnome-terminal/2.6 Mature ...
617 lp://dev/~name12/gnome-terminal/main Development ...
618@@ -177,7 +177,7 @@
619 >>> browser.getControl(name='field.lifecycle').displayValue
620 ['Mature']
621 >>> message = find_tag_by_id(browser.contents, 'no-branch-message')
622- >>> print message.renderContents()
623+ >>> print(message.renderContents())
624 There are branches related to Launchpad Developers...
625
626 Personal branch listings shouldn't show an option for sorting by "most
627@@ -189,7 +189,7 @@
628 ... 'field.category=subscribed')
629 >>> table = find_tag_by_id(browser.contents, 'branchtable')
630 >>> for row in table.tbody.findAll('tr'):
631- ... print extract_text(row)
632+ ... print(extract_text(row))
633 lp://dev/~name12/firefox/main ...
634 lp://dev/~launchpad/gnome-terminal/launchpad ...
635 lp://dev/~name12/+junk/junk.dev ...
636@@ -218,10 +218,10 @@
637 ... cells = row.findAll('td')
638 ... first_cell = cells[0]
639 ... anchors = first_cell.findAll('a')
640- ... print anchors[0].get('href')
641+ ... print(anchors[0].get('href'))
642 ... # Badges in the next cell
643 ... for img in cells[1].findAll('img'):
644- ... print img['title']
645+ ... print(img['title'])
646
647 >>> browser.open(
648 ... 'http://code.launchpad.dev/firefox/+branches'
649@@ -280,7 +280,7 @@
650 >>> sort_by_control.value
651 ['most recently changed first']
652 >>> for option in sort_by_control.options:
653- ... print option
654+ ... print(option)
655 by project name
656 by status
657 by branch name
658@@ -300,9 +300,9 @@
659 >>> sort_by_control.value = ['by project name']
660 Traceback (most recent call last):
661 ...
662- ItemNotFoundError: insufficient items with name 'by project name'
663+ ItemNotFoundError: insufficient items with name u'by project name'
664 >>> for option in sort_by_control.options:
665- ... print option
666+ ... print(option)
667 by most interesting
668 by status
669 by branch name
670@@ -328,14 +328,14 @@
671 >>> browser.getControl(name='field.sort_by').value
672 Traceback (most recent call last):
673 ...
674- LookupError: name 'field.sort_by'
675+ LookupError: name u'field.sort_by'
676
677 Finally, sorting by a particular criterion has the desired effect.
678
679 >>> browser.open('http://code.launchpad.dev/gnome-terminal/+branches')
680 >>> table = find_tag_by_id(browser.contents, 'branchtable')
681 >>> for row in table.tbody.findAll('tr'):
682- ... print extract_text(row)
683+ ... print(extract_text(row))
684 A development focus ...
685 lp://dev/~name12/gnome-terminal/2.6 Mature ...
686 lp://dev/~launchpad/gnome-terminal/launchpad Development ...
687@@ -348,7 +348,7 @@
688 >>> browser.getControl('Filter').click()
689 >>> table = find_tag_by_id(browser.contents, 'branchtable')
690 >>> for row in table.tbody.findAll('tr'):
691- ... print extract_text(row)
692+ ... print(extract_text(row))
693 A development focus ...
694 lp://dev/~name12/gnome-terminal/2.6 Mature ...
695 lp://dev/~vcs-imports/gnome-terminal/import Development ...
696@@ -382,7 +382,7 @@
697 >>> # The development focus is always first.
698 >>> row = table.tbody.findAll('tr')[0]
699 >>> cols = row.findAll('td')
700- >>> print extract_text(cols[0])
701+ >>> print(extract_text(cols[0]))
702 lp://dev/gnome-terminal Series: trunk
703
704 If a branch is associated with more than one series, then the links
705@@ -408,7 +408,7 @@
706
707 >>> browser.open('http://code.launchpad.dev/gnome-terminal')
708 >>> table = find_tag_by_id(browser.contents, 'branchtable')
709- >>> print extract_text(table.tbody.findAll('tr')[0])
710+ >>> print(extract_text(table.tbody.findAll('tr')[0]))
711 lp://dev/gnome-terminal Series: trunk, alpha, pre-1.0 ...
712
713
714@@ -422,7 +422,7 @@
715 >>> browser.open('http://code.launchpad.dev/gnome-terminal')
716 >>> table = find_tag_by_id(browser.contents, 'branchtable')
717 >>> for row in table.tbody.findAll('tr'):
718- ... print extract_text(row)
719+ ... print(extract_text(row))
720 lp://dev/gnome-terminal Series: trunk... Development ...
721 lp://dev/~name12/gnome-terminal/2.6 Mature ...
722 lp://dev/~launchpad/gnome-terminal/launchpad Development ...
723@@ -447,7 +447,7 @@
724 >>> browser.getControl('Filter').click()
725 >>> table = find_tag_by_id(browser.contents, 'branchtable')
726 >>> for row in table.tbody.findAll('tr'):
727- ... print extract_text(row)
728+ ... print(extract_text(row))
729 lp://dev/~name12/gnome-terminal/klingon Experimental ...
730
731 If the development focus matches the lifecycle selected, it is still shown
732@@ -457,7 +457,7 @@
733 >>> browser.getControl('Filter').click()
734 >>> table = find_tag_by_id(browser.contents, 'branchtable')
735 >>> for row in table.tbody.findAll('tr'):
736- ... print extract_text(row)
737+ ... print(extract_text(row))
738 lp://dev/gnome-terminal Series: trunk... Development ...
739
740
741@@ -471,7 +471,7 @@
742
743 >>> browser.open('http://code.launchpad.dev/firefox/+branches')
744 >>> for commit in find_tags_by_class(browser.contents, 'lastCommit'):
745- ... print extract_text(commit)
746+ ... print(extract_text(commit))
747 1. Import of Mozilla Firefox 0.9.1
748 1. Import of Mozilla Firefox 0.9
749 1. Import of Mozilla Firefox 0.9.2
750@@ -480,7 +480,7 @@
751 the user moves the mouse over the last commit for a particular branch.
752
753 >>> for commit in find_tags_by_class(browser.contents, 'popupTitle'):
754- ... print extract_text(commit)
755+ ... print(extract_text(commit))
756 Author: mark.shuttleworth
757 Revision Date: 2005-03-09 23:45:00 AWST
758 Import of Mozilla Firefox 0.9.1
759
760=== modified file 'lib/lp/code/stories/branches/xx-branch-mirror-failures.txt'
761--- lib/lp/code/stories/branches/xx-branch-mirror-failures.txt 2012-01-15 13:32:27 +0000
762+++ lib/lp/code/stories/branches/xx-branch-mirror-failures.txt 2018-05-13 10:39:08 +0000
763@@ -20,9 +20,9 @@
764 >>> def print_browser_tag(browser, tag_id):
765 ... tag = find_tag_by_id(browser.contents, tag_id)
766 ... if tag is None:
767- ... print tag
768+ ... print(tag)
769 ... else:
770- ... print extract_text(tag)
771+ ... print(extract_text(tag))
772
773 The initial error message doesn't give a count or last failure.
774
775@@ -196,7 +196,7 @@
776
777 >>> browser = setupBrowser()
778 >>> browser.open(branch_location)
779- >>> print find_tag_by_id(browser.contents, 'mirror-failure')
780+ >>> print(find_tag_by_id(browser.contents, 'mirror-failure'))
781 None
782- >>> print find_tag_by_id(browser.contents, 'mirror-of-ssh')
783+ >>> print(find_tag_by_id(browser.contents, 'mirror-of-ssh'))
784 None
785
786=== modified file 'lib/lp/code/stories/branches/xx-branch-tag-cloud.txt'
787--- lib/lp/code/stories/branches/xx-branch-tag-cloud.txt 2017-10-23 00:16:39 +0000
788+++ lib/lp/code/stories/branches/xx-branch-tag-cloud.txt 2018-05-13 10:39:08 +0000
789@@ -16,7 +16,7 @@
790 >>> logout()
791
792 >>> anon_browser.open("http://code.launchpad.dev/projects")
793- >>> print anon_browser.title
794+ >>> print(anon_browser.title)
795 Projects with active branches
796
797 The `Projects with active branches` page shows a link for each project that has
798@@ -25,6 +25,6 @@
799
800 >>> tags = find_tag_by_id(anon_browser.contents, 'project-tags')
801 >>> for anchor in tags.findAll('a'):
802- ... print anchor.renderContents(), anchor['class']
803+ ... print(anchor.renderContents(), anchor['class'])
804 linux cloud-size-largest cloud-medium
805 wibble cloud-size-smallest cloud-dark
806
807=== modified file 'lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt'
808--- lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt 2016-07-02 07:56:08 +0000
809+++ lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt 2018-05-13 10:39:08 +0000
810@@ -68,7 +68,7 @@
811 The 'active reviews' text links to the active reviews page.
812
813 >>> browser.getLink('active reviews').click()
814- >>> print browser.title
815+ >>> print(browser.title)
816 Active reviews : Code : Fooix
817
818 The proposals are listed in a table that shows the source and target branches,
819@@ -147,7 +147,7 @@
820 3 branches proposed for merging into this one.
821
822 >>> browser.getLink('3 branches').click()
823- >>> print browser.title
824+ >>> print(browser.title)
825 Active reviews : trunk : Code : Fooix
826
827
828
829=== modified file 'lib/lp/code/stories/branches/xx-branchmergeproposals.txt'
830--- lib/lp/code/stories/branches/xx-branchmergeproposals.txt 2018-03-16 21:20:00 +0000
831+++ lib/lp/code/stories/branches/xx-branchmergeproposals.txt 2018-05-13 10:39:08 +0000
832@@ -69,14 +69,14 @@
833 Registering the merge proposal takes the user to the new merge proposal.
834
835 >>> klingon_proposal = nopriv_browser.url
836- >>> print klingon_proposal
837+ >>> print(klingon_proposal)
838 http://code.launchpad.dev/~name12/gnome-terminal/klingon/+merge/...
839
840 The summary reflects the selected target and prerequisite.
841
842 >>> def print_summary(browser):
843- ... print extract_text(find_tag_by_id(
844- ... browser.contents, 'proposal-summary'))
845+ ... print(extract_text(find_tag_by_id(
846+ ... browser.contents, 'proposal-summary')))
847 >>> print_summary(nopriv_browser)
848 Status:
849 ...
850@@ -151,7 +151,7 @@
851 >>> sample_browser.open(klingon_proposal)
852 >>> pending = find_tag_by_id(
853 ... sample_browser.contents, 'code-review-votes')
854- >>> print extract_text(pending)
855+ >>> print(extract_text(pending))
856 Reviewer Review Type Date Requested Status
857 Sample Person ... ago Pending [Review]
858 Review via email: mp+...@code.launchpad.dev
859@@ -181,7 +181,7 @@
860
861 >>> pending = find_tag_by_id(
862 ... sample_browser.contents, 'code-review-votes')
863- >>> print extract_text(pending)
864+ >>> print(extract_text(pending))
865 Reviewer Review Type Date Requested Status
866 Mark Shuttleworth ... ago Pending
867 Sample Person second ... ago Pending [Review]
868@@ -210,7 +210,7 @@
869 >>> nopriv_browser.getControl('Save Comment').click()
870 >>> pending = find_tag_by_id(
871 ... nopriv_browser.contents, 'code-review-votes')
872- >>> print extract_text(pending)
873+ >>> print(extract_text(pending))
874 Reviewer Review Type Date Requested Status
875 No Privileges Person (community) Disapprove
876 ...
877@@ -224,7 +224,7 @@
878 >>> sample_browser.getControl('Request Review').click()
879 >>> pending = find_tag_by_id(
880 ... sample_browser.contents, 'code-review-votes')
881- >>> print extract_text(pending)
882+ >>> print(extract_text(pending))
883 Reviewer Review Type Date Requested Status...
884 HWDB Team claimable ... ago Pending ...
885 >>> foobar_browser = setupBrowser(auth="Basic foo.bar@canonical.com:test")
886@@ -235,7 +235,7 @@
887
888 After claiming a review, the claimant is listed instead of their team.
889
890- >>> print extract_text(pending)
891+ >>> print(extract_text(pending))
892 Reviewer Review Type Date Requested Status...
893 Foo Bar claimable ... ago Pending ...
894
895@@ -286,8 +286,8 @@
896 The new merge proposal is created as needs review, and there is
897 a link back to the superseded proposal.
898
899- >>> print extract_text(find_tag_by_id(
900- ... eric_browser.contents, 'superseded-proposal'))
901+ >>> print(extract_text(find_tag_by_id(
902+ ... eric_browser.contents, 'superseded-proposal')))
903 This proposal supersedes a proposal from ...
904
905 >>> import re
906@@ -300,8 +300,8 @@
907 The earlier superseded proposal also has a link back to the
908 new proposal that supersedes it.
909
910- >>> print extract_text(find_tag_by_id(
911- ... eric_browser.contents, 'superseded-by'))
912+ >>> print(extract_text(find_tag_by_id(
913+ ... eric_browser.contents, 'superseded-by')))
914 This proposal has been superseded by a proposal from ...
915 >>> link = eric_browser.getLink(re.compile('proposal from .*'))
916 >>> superseding_url = link.url
917@@ -313,7 +313,7 @@
918 >>> eric_browser.getLink('Edit status').click()
919 >>> def print_options(field):
920 ... for option in field.options:
921- ... print option
922+ ... print(option)
923 >>> print_options(eric_browser.getControl(name='field.queue_status'))
924 REJECTED
925 MERGED
926@@ -382,7 +382,7 @@
927 ... 'http://code.launchpad.dev/~mark/firefox/release-0.8')
928 >>> nopriv_browser.getLink('Propose for merging').click()
929 >>> for widget in get_target_branch_widgets(nopriv_browser):
930- ... print widget
931+ ... print(widget)
932 <input type="text" ...
933
934 Test validation of errors...
935@@ -424,7 +424,7 @@
936 ... checked = widget['checked']
937 ... except KeyError:
938 ... checked = ''
939- ... print widget['value'], checked
940+ ... print(widget['value'], checked)
941
942 Also the main development focus is selected.
943
944@@ -463,9 +463,9 @@
945 ... for id in 'related-bugs', 'related-blueprints':
946 ... links = find_tag_by_id(browser.contents, id)
947 ... if links == None:
948- ... print links
949+ ... print(links)
950 ... else:
951- ... print extract_text(links)
952+ ... print(extract_text(links))
953
954 >>> login('admin@canonical.com')
955 >>> bmp = factory.makeBranchMergeProposal()
956@@ -551,8 +551,8 @@
957 >>> from zope.security.proxy import removeSecurityProxy
958 >>> from difflib import unified_diff
959 >>> from lp.code.model.diff import PreviewDiff
960- >>> diff_text = ''.join(
961- ... unified_diff('', ['Fake Diff' + u'\u1010'.encode('utf-8')]))
962+ >>> diff_text = b''.join(
963+ ... unified_diff(b'', [b'Fake Diff' + u'\u1010'.encode('utf-8')]))
964 >>> bmp = factory.makeBranchMergeProposal()
965 >>> preview_diff = PreviewDiff.create(
966 ... bmp, diff_text, u'a', u'b', None, u'')
967@@ -565,7 +565,7 @@
968
969 The text of the review diff is in the page.
970
971- >>> print repr(extract_text(get_review_diff()))
972+ >>> print(repr(extract_text(get_review_diff())))
973 u'Preview Diff\n[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk\nDownload diff\nSide-by-side diff\n1\n---\n2\n+++\n3\n@@ -0,0 +1 @@\n4\n+Fake Diff\u1010'
974
975 There is also a link to the diff URL, which is the preview diff URL plus
976@@ -573,17 +573,17 @@
977 restricted librarian.
978
979 >>> link = get_review_diff().find('a')
980- >>> print extract_text(link)
981+ >>> print(extract_text(link))
982 Download diff
983
984- >>> print link['href']
985+ >>> print(link['href'])
986 http://.../+preview-diff/.../+files/preview.diff
987
988 >>> from lazr.uri import URI
989- >>> print http(r"""
990+ >>> print(http(r"""
991 ... GET %s HTTP/1.1
992 ... Authorization: Basic no-priv@canonical.com:test
993- ... """ % URI(link['href']).path)
994+ ... """ % URI(link['href']).path))
995 HTTP/1.1 303 See Other
996 ...
997 Location: https://...restricted.../...txt?token=...
998@@ -595,15 +595,15 @@
999 >>> Store.of(preview_diff).remove(preview_diff)
1000 >>> from lp.services.propertycache import get_property_cache
1001 >>> del get_property_cache(bmp).preview_diffs
1002- >>> print get_review_diff()
1003+ >>> print(get_review_diff())
1004 None
1005
1006 If the review diff is empty, then we say it is empty.
1007
1008 >>> login('admin@canonical.com')
1009- >>> preview_diff = PreviewDiff.create(bmp, '', u'c', u'd', None, u'')
1010+ >>> preview_diff = PreviewDiff.create(bmp, b'', u'c', u'd', None, u'')
1011 >>> logout()
1012- >>> print extract_text(get_review_diff())
1013+ >>> print(extract_text(get_review_diff()))
1014 Preview Diff
1015 Empty
1016
1017@@ -613,7 +613,7 @@
1018
1019 >>> update = find_tag_by_id(
1020 ... nopriv_browser.contents, 'diff-pending-update')
1021- >>> print extract_text(update)
1022+ >>> print(extract_text(update))
1023 Updating diff...
1024 An updated diff will be available in a few minutes. Reload to see the
1025 changes.
1026@@ -622,7 +622,7 @@
1027 >>> job.complete()
1028 >>> transaction.commit()
1029 >>> nopriv_browser.open(url)
1030- >>> print find_tag_by_id(nopriv_browser.contents, 'diff-pending-update')
1031+ >>> print(find_tag_by_id(nopriv_browser.contents, 'diff-pending-update'))
1032 None
1033
1034
1035
1036=== modified file 'lib/lp/code/stories/branches/xx-bug-branch-links.txt'
1037--- lib/lp/code/stories/branches/xx-bug-branch-links.txt 2017-05-23 13:44:44 +0000
1038+++ lib/lp/code/stories/branches/xx-bug-branch-links.txt 2018-05-13 10:39:08 +0000
1039@@ -26,10 +26,10 @@
1040 >>> def printBugBranchLinks(browser):
1041 ... tags = find_tags_by_class(browser.contents, 'buglink-summary')
1042 ... if len(tags) == 0:
1043- ... print 'No bug branch links'
1044+ ... print('No bug branch links')
1045 ... else:
1046 ... for tag in tags:
1047- ... print extract_text(tag)
1048+ ... print(extract_text(tag))
1049
1050 >>> browser = setupBrowser(auth="Basic test@canonical.com:test")
1051 >>> browser.open(
1052@@ -38,7 +38,7 @@
1053 No bug branch links
1054
1055 >>> browser.getLink('Link a bug report').click()
1056- >>> print browser.title
1057+ >>> print(browser.title)
1058 Link branch...
1059
1060 When linking from a branch to a bug, the bug widget is used. This
1061@@ -76,7 +76,7 @@
1062 >>> admin_browser.open('http://launchpad.dev/firefox/+bug/4/+secrecy')
1063 >>> admin_browser.getControl('Private', index=1).click()
1064 >>> admin_browser.getControl('Change').click()
1065- >>> print extract_text(find_tag_by_id(admin_browser.contents, 'privacy'))
1066+ >>> print(extract_text(find_tag_by_id(admin_browser.contents, 'privacy')))
1067 This report contains Private information...
1068
1069 Sample person can see it...
1070@@ -155,7 +155,7 @@
1071 >>> admin_browser.open(grub_url)
1072 >>> admin_browser.getLink('Delete branch').click()
1073
1074- >>> print find_tag_by_id(admin_browser.contents, 'deletion-items')
1075+ >>> print(find_tag_by_id(admin_browser.contents, 'deletion-items'))
1076 <ul ...
1077 <a href...>Bug #...: bug-title...</a>...
1078
1079
1080=== modified file 'lib/lp/code/stories/branches/xx-claiming-team-code-reviews.txt'
1081--- lib/lp/code/stories/branches/xx-claiming-team-code-reviews.txt 2018-03-16 21:20:00 +0000
1082+++ lib/lp/code/stories/branches/xx-claiming-team-code-reviews.txt 2018-05-13 10:39:08 +0000
1083@@ -27,8 +27,8 @@
1084
1085 The reviewer table shows both the Vikings team and Eric himself.
1086
1087- >>> print extract_text(find_tag_by_id(
1088- ... eric_browser.contents, 'code-review-votes'))
1089+ >>> print(extract_text(find_tag_by_id(
1090+ ... eric_browser.contents, 'code-review-votes')))
1091 Reviewer Review Type Date Requested Status
1092 Vikings ... Pending [Review]
1093 Review via email: mp+...@code.launchpad.dev
1094@@ -44,8 +44,8 @@
1095
1096 The team review has been claimed.
1097
1098- >>> print extract_text(find_tag_by_id(
1099- ... eric_browser.contents, 'code-review-votes'))
1100+ >>> print(extract_text(find_tag_by_id(
1101+ ... eric_browser.contents, 'code-review-votes')))
1102 Reviewer Review Type Date Requested Status
1103 Eric the Viking Approve ... ago
1104 Review via email: mp+...@code.launchpad.dev
1105
1106=== modified file 'lib/lp/code/stories/branches/xx-code-review-comments.txt'
1107--- lib/lp/code/stories/branches/xx-code-review-comments.txt 2017-07-21 11:01:00 +0000
1108+++ lib/lp/code/stories/branches/xx-code-review-comments.txt 2018-05-13 10:39:08 +0000
1109@@ -35,7 +35,7 @@
1110 ... tags = find_tags_by_class(browser.contents, klass)
1111 ... for count, tag in enumerate(tags):
1112 ... if count == index:
1113- ... print extract_text(tag)
1114+ ... print(extract_text(tag))
1115
1116 >>> print_comments('boardCommentDetails')
1117 Eric the Viking (eric) wrote ...
1118@@ -48,7 +48,7 @@
1119
1120 The person's name links back to the main site for that person.
1121
1122- >>> print anon_browser.getLink('Eric the Viking').url
1123+ >>> print(anon_browser.getLink('Eric the Viking').url)
1124 http://launchpad.dev/~eric
1125
1126 Reply link is displayed even if the user isn't logged in.
1127@@ -66,8 +66,8 @@
1128 XXX: Bjorn Tillenius 2010-05-19 bug=582842: Following test disabled,
1129 since it failed spuriously in buildbot.
1130
1131-# >>> print eric_browser.getControl(name='field.comment').value.replace(
1132-# ... '\r\n', '\n')
1133+# >>> print(eric_browser.getControl(name='field.comment').value.replace(
1134+# ... '\r\n', '\n'))
1135 # This is a very long comment about what things should be done to the
1136 # source branch to land it. When this comment is replied to, it should
1137 # wrap the line properly.
1138@@ -115,7 +115,7 @@
1139 >>> details = find_tags_by_class(
1140 ... anon_browser.contents, 'boardCommentDetails')[0]
1141 >>> links = details.findAll('a')
1142- >>> print links[1]['href'] == merge_proposal_path
1143+ >>> print(links[1]['href'] == merge_proposal_path)
1144 True
1145
1146
1147@@ -143,8 +143,8 @@
1148 The summary of the votes that have been made for a code review are shown
1149 in a table at the top of the page.
1150
1151- >>> print extract_text(find_tag_by_id(
1152- ... eric_browser.contents, 'code-review-votes'))
1153+ >>> print(extract_text(find_tag_by_id(
1154+ ... eric_browser.contents, 'code-review-votes')))
1155 Reviewer Review Type Date Requested Status
1156 Eric the Viking (community) timeless ... Abstain...
1157 a moment ago
1158
1159=== modified file 'lib/lp/code/stories/branches/xx-distribution-branches.txt'
1160--- lib/lp/code/stories/branches/xx-distribution-branches.txt 2011-08-03 11:00:11 +0000
1161+++ lib/lp/code/stories/branches/xx-distribution-branches.txt 2018-05-13 10:39:08 +0000
1162@@ -36,5 +36,5 @@
1163 lp://dev/~eric/mint/old/twisted/old Development ...
1164 ...
1165 >>> ordering_control = browser.getControl(name='field.sort_by')
1166- >>> print ordering_control.displayValue
1167+ >>> print(ordering_control.displayValue)
1168 ['most recently changed first']
1169
1170=== modified file 'lib/lp/code/stories/branches/xx-distroseries-branches.txt'
1171--- lib/lp/code/stories/branches/xx-distroseries-branches.txt 2014-11-26 23:50:26 +0000
1172+++ lib/lp/code/stories/branches/xx-distroseries-branches.txt 2018-05-13 10:39:08 +0000
1173@@ -30,5 +30,5 @@
1174 lp://dev/~eric/mint/stable/zope/new Development ...
1175 ...
1176 >>> ordering_control = browser.getControl(name='field.sort_by')
1177- >>> print ordering_control.displayValue
1178+ >>> print(ordering_control.displayValue)
1179 ['most recently changed first']
1180
1181=== modified file 'lib/lp/code/stories/branches/xx-nearby-branches.txt'
1182--- lib/lp/code/stories/branches/xx-nearby-branches.txt 2014-12-06 10:45:17 +0000
1183+++ lib/lp/code/stories/branches/xx-nearby-branches.txt 2018-05-13 10:39:08 +0000
1184@@ -19,6 +19,6 @@
1185
1186 >>> div = find_tag_by_id(browser.contents, 'nearby-branches')
1187 >>> for anchor in div.findAll('a'):
1188- ... print anchor['href'], anchor.string
1189+ ... print(anchor['href'], anchor.string)
1190 /fooix Other Fooix branches
1191 /~vikings Other branches owned by Vikings
1192
1193=== modified file 'lib/lp/code/stories/branches/xx-person-branches.txt'
1194--- lib/lp/code/stories/branches/xx-person-branches.txt 2017-10-23 00:16:39 +0000
1195+++ lib/lp/code/stories/branches/xx-person-branches.txt 2018-05-13 10:39:08 +0000
1196@@ -7,7 +7,7 @@
1197
1198 >>> browser = setupBrowser(auth='Basic test@canonical.com:test')
1199 >>> browser.open('http://code.launchpad.dev/~name12')
1200- >>> print browser.title
1201+ >>> print(browser.title)
1202 Code : Sample Person
1203
1204
1205@@ -21,8 +21,8 @@
1206 message.
1207
1208 >>> browser.open('http://code.launchpad.dev/~kinnison')
1209- >>> print extract_text(
1210- ... find_tag_by_id(browser.contents, 'no-branch-message'))
1211+ >>> print(extract_text(
1212+ ... find_tag_by_id(browser.contents, 'no-branch-message')))
1213 There are no branches related to Daniel Silverstone in Launchpad today.
1214
1215
1216@@ -32,8 +32,8 @@
1217 On the user's own code page, they will see directions on pushing a branch.
1218
1219 >>> browser.open('http://code.launchpad.dev/~name12')
1220- >>> print extract_text(
1221- ... find_tag_by_id(browser.contents, 'junk-branch-directions'))
1222+ >>> print(extract_text(
1223+ ... find_tag_by_id(browser.contents, 'junk-branch-directions')))
1224 You can push (upload) personal branches
1225 (those not related to a project) with the following command:
1226 bzr push lp:~name12/+junk/BRANCHNAME
1227@@ -47,7 +47,7 @@
1228 >>> browser.open('http://code.launchpad.dev/~name12')
1229 >>> table = find_tag_by_id(browser.contents, 'branchtable')
1230 >>> for row in table.tbody.findAll('tr'):
1231- ... print extract_text(row)
1232+ ... print(extract_text(row))
1233 lp://dev/~name12/landscape/feature-x Development
1234 ...
1235
1236@@ -61,11 +61,11 @@
1237 >>> browser.getControl(name='field.category').displayValue = [
1238 ... 'Registered']
1239 >>> browser.getControl('Filter').click()
1240- >>> print browser.title
1241+ >>> print(browser.title)
1242 Code : Sample Person
1243 >>> table = find_tag_by_id(browser.contents, 'branchtable')
1244 >>> for row in table.tbody.findAll('tr'):
1245- ... print extract_text(row)
1246+ ... print(extract_text(row))
1247 lp://dev/~name12/landscape/feature-x Development
1248 ...
1249
1250@@ -80,11 +80,11 @@
1251 >>> browser.getControl(name='field.category').displayValue = [
1252 ... 'Subscribed']
1253 >>> browser.getControl('Filter').click()
1254- >>> print browser.title
1255+ >>> print(browser.title)
1256 Code : Sample Person
1257 >>> table = find_tag_by_id(browser.contents, 'branchtable')
1258 >>> for row in table.tbody.findAll('tr'):
1259- ... print extract_text(row)
1260+ ... print(extract_text(row))
1261 lp://dev/~launchpad/gnome-terminal/launchpad Development ...
1262 lp://dev/~name12/+junk/junk.dev Experimental ...
1263
1264
1265=== modified file 'lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt'
1266--- lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt 2012-01-15 13:32:27 +0000
1267+++ lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt 2018-05-13 10:39:08 +0000
1268@@ -23,7 +23,7 @@
1269
1270 >>> browser.open('http://code.launchpad.dev/~eric')
1271 >>> portlet = find_tag_by_id(browser.contents, 'portlet-team-branches')
1272- >>> print portlet
1273+ >>> print(portlet)
1274 None
1275
1276 >>> login(ANONYMOUS)
1277@@ -32,9 +32,9 @@
1278
1279 >>> browser.open('http://code.launchpad.dev/~eric')
1280 >>> tb = find_tag_by_id(browser.contents, 'portlet-team-branches')
1281- >>> print extract_text(tb.h2)
1282+ >>> print(extract_text(tb.h2))
1283 Branches owned by
1284- >>> print tb.li
1285+ >>> print(tb.li)
1286 <li>
1287 <img src="http://.../vikings.png" width="14" height="14" />
1288 <a href="/~vikings">Vikings</a>
1289
1290=== modified file 'lib/lp/code/stories/branches/xx-private-branch-listings.txt'
1291--- lib/lp/code/stories/branches/xx-private-branch-listings.txt 2017-10-23 00:16:39 +0000
1292+++ lib/lp/code/stories/branches/xx-private-branch-listings.txt 2018-05-13 10:39:08 +0000
1293@@ -50,7 +50,7 @@
1294 ... browser.open('http://code.launchpad.dev')
1295 ... branches = find_tag_by_id(browser.contents, 'recently-registered')
1296 ... for list_item in branches.ul.findAll('li'):
1297- ... print "%r" % list_item.renderContents()
1298+ ... print("%r" % list_item.renderContents())
1299
1300 When there is no logged in user, only public branches should be visible.
1301
1302@@ -110,11 +110,11 @@
1303 ... # If there are no branches, the table is not shown.
1304 ... # So print the text shown in the application summary.
1305 ... if table is None:
1306- ... print extract_text(find_tag_by_id(
1307- ... browser.contents, 'branch-summary'))
1308+ ... print(extract_text(find_tag_by_id(
1309+ ... browser.contents, 'branch-summary')))
1310 ... else:
1311 ... for row in table.tbody.findAll('tr'):
1312- ... print extract_text(row)
1313+ ... print(extract_text(row))
1314
1315 >>> print_landscape_code_listing(anon_browser)
1316 Launchpad does not know where The Landscape Project hosts its code...
1317@@ -157,12 +157,12 @@
1318 ... branches.append(extract_text(row))
1319 ... landscape_branches = [branch for branch in branches
1320 ... if 'landscape' in branch]
1321- ... print "Total of %d branches listed" % len(branches)
1322+ ... print("Total of %d branches listed" % len(branches))
1323 ... if landscape_branches:
1324 ... for branch in landscape_branches:
1325- ... print branch
1326+ ... print(branch)
1327 ... else:
1328- ... print "No landscape branches"
1329+ ... print("No landscape branches")
1330
1331 >>> print_person_code_listing(anon_browser)
1332 Total of 9 branches listed
1333@@ -220,10 +220,10 @@
1334 >>> def printBugBranchLinks(browser):
1335 ... tags = find_tags_by_class(browser.contents, 'buglink-summary')
1336 ... if len(tags) == 0:
1337- ... print 'No bug branch links'
1338+ ... print('No bug branch links')
1339 ... else:
1340 ... for tag in tags:
1341- ... print extract_text(tag)
1342+ ... print(extract_text(tag))
1343
1344 >>> printBugBranchLinks(landscape_dev_browser)
1345 No bug branch links
1346@@ -261,21 +261,21 @@
1347 Since the admin user is able to see all private branches the branch details
1348 are shown.
1349
1350- >>> print extract_text(
1351- ... find_tag_by_id(admin_browser.contents, 'branch-details'))
1352+ >>> print(extract_text(
1353+ ... find_tag_by_id(admin_browser.contents, 'branch-details')))
1354 lp://dev/... - Landscape Developers ...
1355
1356 Landscape developers can see it.
1357
1358 >>> landscape_dev_browser.open('http://launchpad.dev/landscape/trunk')
1359- >>> print extract_text(find_tag_by_id(
1360- ... landscape_dev_browser.contents, 'branch-details'))
1361+ >>> print(extract_text(find_tag_by_id(
1362+ ... landscape_dev_browser.contents, 'branch-details')))
1363 lp://dev/... - Landscape Developers ...
1364
1365 But normal people can't.
1366
1367 >>> anon_browser.open('http://launchpad.dev/landscape/trunk')
1368- >>> print extract_text(find_tag_by_id(
1369- ... anon_browser.contents, 'branch-details'))
1370+ >>> print(extract_text(find_tag_by_id(
1371+ ... anon_browser.contents, 'branch-details')))
1372 No revision control details recorded for
1373 The Landscape Project trunk series.
1374
1375=== modified file 'lib/lp/code/stories/branches/xx-product-branches.txt'
1376--- lib/lp/code/stories/branches/xx-product-branches.txt 2017-10-23 00:16:39 +0000
1377+++ lib/lp/code/stories/branches/xx-product-branches.txt 2018-05-13 10:39:08 +0000
1378@@ -28,7 +28,7 @@
1379 overview page.
1380
1381 >>> browser.open('http://code.launchpad.dev/applets')
1382- >>> print browser.title
1383+ >>> print(browser.title)
1384 Code : Gnome Applets
1385
1386 If there are not any branches, a helpful message is shown.
1387@@ -36,7 +36,7 @@
1388 >>> def get_summary(browser):
1389 ... return find_tag_by_id(browser.contents, 'branch-summary')
1390 >>> summary = get_summary(browser)
1391- >>> print extract_text(summary)
1392+ >>> print(extract_text(summary))
1393 Launchpad does not know where Gnome Applets
1394 hosts its code.
1395 There are no branches for Gnome Applets
1396@@ -55,7 +55,7 @@
1397 The 'Help' links go to the help wiki.
1398
1399 >>> for anchor in summary.findAll('a'):
1400- ... print anchor['href']
1401+ ... print(anchor['href'])
1402 https://help.launchpad.net/Code
1403
1404
1405@@ -66,7 +66,7 @@
1406 in downloads that may have been added for the product.
1407
1408 >>> browser.open('http://code.launchpad.dev/netapplet')
1409- >>> print extract_text(get_summary(browser))
1410+ >>> print(extract_text(get_summary(browser)))
1411 Launchpad does not know where NetApplet hosts its code...
1412 There are no branches for NetApplet in Launchpad.
1413 ...
1414@@ -87,7 +87,7 @@
1415
1416 >>> browser.open('http://code.launchpad.dev/evolution')
1417 >>> summary = get_summary(browser)
1418- >>> print extract_text(get_summary(browser))
1419+ >>> print(extract_text(get_summary(browser)))
1420 Evolution hosts its code externally.
1421 You can learn more at the project's web page.
1422 Launchpad imports the master branch and you can create branches from
1423@@ -124,7 +124,7 @@
1424 >>> browser.open('http://code.launchpad.dev/firefox')
1425 >>> table = find_tag_by_id(browser.contents, 'branchtable')
1426 >>> for row in table.tbody.findAll('tr')[0:2]:
1427- ... print extract_text(row)
1428+ ... print(extract_text(row))
1429 lp://dev/firefox
1430 Series: trunk, 1.0 Development ...
1431 lp://dev/~mark/firefox/release--0.9.1 Development ...
1432@@ -139,7 +139,7 @@
1433 >>> browser.open('http://code.launchpad.dev/firefox')
1434 >>> table = find_tag_by_id(browser.contents, 'branchtable')
1435 >>> for row in table.tbody.findAll('tr')[0:2]:
1436- ... print extract_text(row)
1437+ ... print(extract_text(row))
1438 lp://dev/firefox
1439 Series: trunk Development ...
1440 lp://dev/firefox/1.0
1441@@ -160,7 +160,7 @@
1442 >>> browser.open('http://code.launchpad.dev/firefox')
1443 >>> table = find_tag_by_id(browser.contents, 'branchtable')
1444 >>> for row in table.tbody.findAll('tr')[0:2]:
1445- ... print extract_text(row)
1446+ ... print(extract_text(row))
1447 lp://dev/~mark/firefox/release-0.8 Development ...
1448
1449
1450@@ -185,10 +185,10 @@
1451 >>> def print_links(browser):
1452 ... links = find_tag_by_id(browser.contents, 'involvement')
1453 ... if links is None:
1454- ... print 'None'
1455+ ... print('None')
1456 ... return
1457 ... for link in links.findAll('a'):
1458- ... print extract_text(link)
1459+ ... print(extract_text(link))
1460
1461 >>> def setup_code_hosting(productname):
1462 ... with celebrity_logged_in('admin'):
1463@@ -199,7 +199,7 @@
1464 The involvement portlet is not shown if the product does not have code
1465 hosting configured or if it is not using Launchpad.
1466
1467- >>> print product.codehosting_usage.name
1468+ >>> print(product.codehosting_usage.name)
1469 UNKNOWN
1470 >>> logout()
1471 >>> admin_browser.open('http://code.launchpad.dev/firefox')
1472@@ -208,7 +208,7 @@
1473
1474 >>> setup_code_hosting('firefox')
1475 >>> login(ANONYMOUS)
1476- >>> print product.codehosting_usage.name
1477+ >>> print(product.codehosting_usage.name)
1478 LAUNCHPAD
1479 >>> logout()
1480 >>> admin_browser.open('http://code.launchpad.dev/firefox')
1481@@ -257,9 +257,9 @@
1482 ... browser.open('http://code.launchpad.dev/%s' % product)
1483 ... portlet = get_stats_portlet(browser)
1484 ... if portlet is None:
1485- ... print 'None'
1486+ ... print('None')
1487 ... else:
1488- ... print normalize_whitespace(extract_text(portlet))
1489+ ... print(normalize_whitespace(extract_text(portlet)))
1490
1491 >>> setup_code_hosting('gnome-terminal')
1492 >>> print_portlet('gnome-terminal')
1493@@ -306,7 +306,7 @@
1494 None
1495
1496 >>> message = find_tag_by_id(browser.contents, 'no-branch-message')
1497- >>> print extract_text(message)
1498+ >>> print(extract_text(message))
1499 There are branches registered for iso-codes but none of them match the
1500 current filter criteria for this page. Try filtering on "Any Status".
1501
1502@@ -321,6 +321,6 @@
1503 ... 'http://code.launchpad.dev/firefox/+branches'
1504 ... '?field.lifecycle=Mature')
1505 >>> message = find_tag_by_id(browser.contents, 'no-branch-message')
1506- >>> print extract_text(message)
1507+ >>> print(extract_text(message))
1508 There are branches registered for Mozilla Firefox but none of them match
1509 the current filter criteria for this page. Try filtering on "Any Status".
1510
1511=== modified file 'lib/lp/code/stories/branches/xx-product-overview.txt'
1512--- lib/lp/code/stories/branches/xx-product-overview.txt 2017-10-23 00:16:39 +0000
1513+++ lib/lp/code/stories/branches/xx-product-overview.txt 2018-05-13 10:39:08 +0000
1514@@ -8,10 +8,10 @@
1515 ... browser.open(url)
1516 ... branches = find_portlet(browser.contents, 'Latest branches')
1517 ... if branches is None:
1518- ... print "No 'Latest branches' portlet found at %s" % (url,)
1519+ ... print("No 'Latest branches' portlet found at %s" % (url,))
1520 ... return
1521 ... for list_item in branches.findAll('li'):
1522- ... print extract_text(list_item)
1523+ ... print(extract_text(list_item))
1524
1525 >>> def make_branch_on_product(product, branch_name, person_name):
1526 ... """Make a branch on `product`.
1527
1528=== modified file 'lib/lp/code/stories/branches/xx-project-branches.txt'
1529--- lib/lp/code/stories/branches/xx-project-branches.txt 2017-10-23 00:16:39 +0000
1530+++ lib/lp/code/stories/branches/xx-project-branches.txt 2018-05-13 10:39:08 +0000
1531@@ -10,7 +10,7 @@
1532
1533 >>> browser.open('http://launchpad.dev/mozilla')
1534 >>> browser.getLink('Code').click()
1535- >>> print browser.title
1536+ >>> print(browser.title)
1537 Code : The Mozilla Project
1538
1539
1540@@ -25,7 +25,7 @@
1541 >>> browser.open('http://code.launchpad.dev/mozilla')
1542 >>> table = find_tag_by_id(browser.contents, 'branchtable')
1543 >>> for row in table.tbody.findAll('tr'):
1544- ... print extract_text(row)
1545+ ... print(extract_text(row))
1546 lp://dev/~mark/firefox/release--0.9.1 Development firefox ...
1547 lp://dev/~mark/firefox/release-0.8 Development firefox ...
1548 lp://dev/~mark/firefox/release-0.9 Development firefox ...
1549@@ -36,10 +36,10 @@
1550 If there are not any branches, a relevant message is shown.
1551
1552 >>> browser.open('http://code.launchpad.dev/aaa')
1553- >>> print browser.title
1554+ >>> print(browser.title)
1555 Code : the Test Project
1556 >>> message = find_tag_by_id(browser.contents, 'no-branchtable')
1557- >>> print extract_text(message)
1558+ >>> print(extract_text(message))
1559 Launchpad does not know where any of
1560 the Test Project's
1561 projects host their code.
1562
1563=== modified file 'lib/lp/code/stories/branches/xx-propose-for-merging.txt'
1564--- lib/lp/code/stories/branches/xx-propose-for-merging.txt 2010-12-19 22:59:04 +0000
1565+++ lib/lp/code/stories/branches/xx-propose-for-merging.txt 2018-05-13 10:39:08 +0000
1566@@ -33,7 +33,7 @@
1567 ... checked = '( )'
1568 ... except KeyError:
1569 ... checked = '( )'
1570- ... print checked, button['value']
1571+ ... print(checked, button['value'])
1572
1573 >>> print_radio_buttons(browser)
1574 (*) ~eric/fooix/trunk
1575
1576=== modified file 'lib/lp/code/stories/branches/xx-source-package-branches-empty.txt'
1577--- lib/lp/code/stories/branches/xx-source-package-branches-empty.txt 2014-11-27 22:13:36 +0000
1578+++ lib/lp/code/stories/branches/xx-source-package-branches-empty.txt 2018-05-13 10:39:08 +0000
1579@@ -25,7 +25,7 @@
1580
1581 Since there are no branches, there is no branch listing table:
1582
1583- >>> print find_tag_by_id(browser.contents, 'branchtable')
1584+ >>> print(find_tag_by_id(browser.contents, 'branchtable'))
1585 None
1586
1587 >>> print_tag_with_id(browser.contents, 'branch-summary')
1588@@ -37,11 +37,11 @@
1589
1590 Since there are no branches, there is no branch listing table:
1591
1592- >>> print find_tag_by_id(browser.contents, 'branchtable')
1593+ >>> print(find_tag_by_id(browser.contents, 'branchtable'))
1594 None
1595
1596- >>> print repr(extract_text(
1597- ... find_tag_by_id(browser.contents, 'branch-summary')))
1598+ >>> print(repr(extract_text(
1599+ ... find_tag_by_id(browser.contents, 'branch-summary'))))
1600 u'There are no branches for the foo package in distro\nin Launchpad.'
1601
1602 >>> print_tag_with_id(browser.contents, 'distro-branch-warning')
1603
1604=== modified file 'lib/lp/code/stories/branches/xx-source-package-branches-listing.txt'
1605--- lib/lp/code/stories/branches/xx-source-package-branches-listing.txt 2017-10-23 00:16:39 +0000
1606+++ lib/lp/code/stories/branches/xx-source-package-branches-listing.txt 2018-05-13 10:39:08 +0000
1607@@ -35,7 +35,7 @@
1608 >>> def print_branches(browser):
1609 ... table = find_tag_by_id(browser.contents, 'branchtable')
1610 ... for row in table.tbody.findAll('tr'):
1611- ... print extract_text(row)
1612+ ... print(extract_text(row))
1613 >>> print_branches(browser)
1614 lp://dev/~owner1/distro/series/foo/branch1 ...
1615 lp://dev/~owner2/distro/series/foo/branch2 ...
1616
1617=== modified file 'lib/lp/code/stories/branches/xx-subscribing-branches.txt'
1618--- lib/lp/code/stories/branches/xx-subscribing-branches.txt 2017-10-23 00:16:39 +0000
1619+++ lib/lp/code/stories/branches/xx-subscribing-branches.txt 2018-05-13 10:39:08 +0000
1620@@ -7,17 +7,17 @@
1621 ... subscriptions = find_tags_by_class(
1622 ... contents, 'branch-subscribers')[0]
1623 ... if subscriptions == None:
1624- ... print subscriptions
1625+ ... print(subscriptions)
1626 ... return
1627 ... for subscriber in subscriptions.findAll('div'):
1628- ... print extract_text(subscriber.renderContents())
1629+ ... print(extract_text(subscriber.renderContents()))
1630
1631 Another to print the informational message.
1632
1633 >>> def print_informational_message(contents):
1634 ... message = find_tags_by_class(contents, 'informational message')
1635 ... if message:
1636- ... print extract_text(message[0])
1637+ ... print(extract_text(message[0]))
1638
1639
1640 Subscribing to Branches
1641@@ -238,7 +238,7 @@
1642
1643 >>> browser.getLink(url='+subscription/landscape').click()
1644 >>> main_content = find_main_content(browser.contents)
1645- >>> print extract_text(main_content.h1)
1646+ >>> print(extract_text(main_content.h1))
1647 Edit subscription to branch for Landscape Developers
1648
1649 From this page the branch subscription can be altered...
1650
1651=== modified file 'lib/lp/code/stories/branches/xx-upgrading-branches.txt'
1652--- lib/lp/code/stories/branches/xx-upgrading-branches.txt 2013-09-27 04:13:23 +0000
1653+++ lib/lp/code/stories/branches/xx-upgrading-branches.txt 2018-05-13 10:39:08 +0000
1654@@ -39,7 +39,7 @@
1655 ... auth='Basic fats@domino.com:test')
1656 >>> domino_browser.open(branch_url)
1657 >>> domino_browser.getLink("Upgrade this branch").click()
1658- >>> print domino_browser.url
1659+ >>> print(domino_browser.url)
1660 http://code.launchpad.dev/~domino/.../+upgrade
1661 >>> domino_browser.getControl('Upgrade').click()
1662
1663
1664=== modified file 'lib/lp/code/stories/branches/xx-upload-directions.txt'
1665--- lib/lp/code/stories/branches/xx-upload-directions.txt 2016-11-17 23:16:12 +0000
1666+++ lib/lp/code/stories/branches/xx-upload-directions.txt 2018-05-13 10:39:08 +0000
1667@@ -49,7 +49,7 @@
1668 >>> anon_browser.open(branch_page)
1669 >>> content = anon_browser.contents
1670 >>> instructions = find_tag_by_id(content, 'upload-directions')
1671- >>> print instructions.renderContents()
1672+ >>> print(instructions.renderContents())
1673 Only
1674 <a href="http://launchpad.dev/~name12">Sample Person</a>
1675 can upload to this branch. If you are Sample Person please
1676@@ -61,7 +61,7 @@
1677 >>> ddaa_browser.open(branch_page)
1678 >>> content = ddaa_browser.contents
1679 >>> instructions = find_tag_by_id(content, 'upload-directions')
1680- >>> print instructions.renderContents()
1681+ >>> print(instructions.renderContents())
1682 <div...
1683 You cannot upload to this branch. Only
1684 <a href="http://launchpad.dev/~name12">Sample Person</a>
1685@@ -74,7 +74,7 @@
1686 >>> name12_browser.open(branch_page)
1687 >>> content = name12_browser.contents
1688 >>> instructions = find_tag_by_id(content, 'upload-directions')
1689- >>> print extract_text(instructions)
1690+ >>> print(extract_text(instructions))
1691 Update this branch:
1692 bzr push --use-existing-dir lp://dev/~name12/gnome-terminal/pushed
1693
1694@@ -95,7 +95,7 @@
1695 >>> name12_browser.open(branch_page)
1696 >>> content = name12_browser.contents
1697 >>> instructions = find_tag_by_id(content, 'ssh-key-directions')
1698- >>> print instructions.renderContents()
1699+ >>> print(instructions.renderContents())
1700 To authenticate with the Launchpad branch upload service, you need to
1701 <a href="http://launchpad.dev/~name12/+editsshkeys">
1702 register an SSH key</a>.
1703@@ -110,7 +110,7 @@
1704
1705 >>> name12_browser.open(branch_page)
1706 >>> content = name12_browser.contents
1707- >>> print find_tag_by_id(content, 'ssh-key-directions')
1708+ >>> print(find_tag_by_id(content, 'ssh-key-directions'))
1709 None
1710
1711 If the user is not logged in, or does have the permission to upload to the
1712@@ -120,12 +120,12 @@
1713
1714 >>> anon_browser.open(branch_page)
1715 >>> content = anon_browser.contents
1716- >>> print find_tag_by_id(content, 'ssh-key-directions')
1717+ >>> print(find_tag_by_id(content, 'ssh-key-directions'))
1718 None
1719
1720 >>> ddaa_browser.open(branch_page)
1721 >>> content = ddaa_browser.contents
1722- >>> print find_tag_by_id(content, 'ssh-key-directions')
1723+ >>> print(find_tag_by_id(content, 'ssh-key-directions'))
1724 None
1725
1726
1727@@ -154,7 +154,7 @@
1728 >>> anon_browser.open(branch_page)
1729 >>> content = anon_browser.contents
1730 >>> instructions = find_tag_by_id(content, 'upload-directions')
1731- >>> print instructions.renderContents()
1732+ >>> print(instructions.renderContents())
1733 Members of <a
1734 href="http://launchpad.dev/~landscape-developers">Landscape
1735 Developers</a> can upload to this branch. <a href="+login">Log in</a> for
1736@@ -166,7 +166,7 @@
1737 >>> ddaa_browser.open(branch_page)
1738 >>> content = ddaa_browser.contents
1739 >>> instructions = find_tag_by_id(content, 'upload-directions')
1740- >>> print instructions.renderContents()
1741+ >>> print(instructions.renderContents())
1742 <div...
1743 You cannot upload to this branch. Members of <a
1744 href="http://launchpad.dev/~landscape-developers">Landscape
1745@@ -181,7 +181,7 @@
1746 >>> name12_browser.open(branch_page)
1747 >>> content = name12_browser.contents
1748 >>> instructions = find_tag_by_id(content, 'upload-directions')
1749- >>> print extract_text(instructions)
1750+ >>> print(extract_text(instructions))
1751 Update this branch:
1752 bzr push --use-existing-dir
1753 lp://dev/~landscape-developers/gnome-terminal/pushed
1754@@ -196,5 +196,5 @@
1755 >>> anon_browser.open(import_branch_page)
1756 >>> content = anon_browser.contents
1757 >>> instructions = find_tag_by_id(content, 'upload-directions')
1758- >>> print instructions
1759+ >>> print(instructions)
1760 None
1761
1762=== modified file 'lib/lp/code/stories/codeimport/xx-admin-codeimport.txt'
1763--- lib/lp/code/stories/codeimport/xx-admin-codeimport.txt 2016-10-13 14:46:41 +0000
1764+++ lib/lp/code/stories/codeimport/xx-admin-codeimport.txt 2018-05-13 10:39:08 +0000
1765@@ -69,7 +69,7 @@
1766 ... if details is None:
1767 ... details = find_tag_by_id(
1768 ... browser.contents, 'repository-import-details')
1769- ... print extract_text(details.div.div)
1770+ ... print(extract_text(details.div.div))
1771
1772 >>> import_browser.open(svn_import_location)
1773 >>> print_import_details(import_browser)
1774@@ -116,7 +116,7 @@
1775 >>> def print_form_fields(browser):
1776 ... tags = find_tags_by_class(browser.contents, 'textType')
1777 ... for tag in tags:
1778- ... print '%s: %s' % (tag['name'], tag['value'])
1779+ ... print('%s: %s' % (tag['name'], tag['value']))
1780
1781 >>> print_form_fields(import_browser)
1782 field.url: svn://svn.example.com/fooix/trunk
1783@@ -333,7 +333,7 @@
1784 >>> anon_browser.getControl('Import Now')
1785 Traceback (most recent call last):
1786 ...
1787- LookupError: label 'Import Now'
1788+ LookupError: label u'Import Now'
1789
1790 If the logged in user clicks this button, the import will be scheduled
1791 to run ASAP and the fact that the import has been requested is
1792
1793=== modified file 'lib/lp/code/stories/codeimport/xx-codeimport-machines.txt'
1794--- lib/lp/code/stories/codeimport/xx-codeimport-machines.txt 2011-12-24 15:18:32 +0000
1795+++ lib/lp/code/stories/codeimport/xx-codeimport-machines.txt 2018-05-13 10:39:08 +0000
1796@@ -13,7 +13,7 @@
1797 >>> def print_table(browser):
1798 ... table = find_tag_by_id(
1799 ... browser.contents, 'code-import-machine-listing')
1800- ... print extract_text(table)
1801+ ... print(extract_text(table))
1802
1803 Initially only the machine in sample data is shown.
1804
1805@@ -66,13 +66,13 @@
1806 current status.
1807
1808 >>> def print_heading(browser):
1809- ... print find_main_content(browser.contents).h1.renderContents()
1810+ ... print(find_main_content(browser.contents).h1.renderContents())
1811 >>> print_heading(browser)
1812 apollo: Online
1813
1814 The page also shows the current running jobs for that machine.
1815
1816- >>> print extract_text(find_tag_by_id(browser.contents, 'current-jobs'))
1817+ >>> print(extract_text(find_tag_by_id(browser.contents, 'current-jobs')))
1818 Current jobs
1819 lp://dev/~.../.../... Started: ... ago Last heartbeat: ... ago
1820 Creating changeset 1
1821@@ -84,7 +84,7 @@
1822
1823 >>> def print_events(browser):
1824 ... recent_events = find_tag_by_id(browser.contents, 'recent-events')
1825- ... print extract_text(recent_events)
1826+ ... print(extract_text(recent_events))
1827 >>> print_events(browser)
1828 Related events
1829 ...: Job Started lp://dev/~.../.../...
1830@@ -97,13 +97,13 @@
1831 If the user is an admin or member of VCS Imports, they are able to change
1832 the status of the machine.
1833
1834- >>> print find_tag_by_id(browser.contents, 'update-status')
1835+ >>> print(find_tag_by_id(browser.contents, 'update-status'))
1836 None
1837
1838 >>> admin_browser.open(browser.url)
1839
1840- >>> print find_tag_by_id(admin_browser.contents,
1841- ... 'update-status').h2.renderContents()
1842+ >>> print(find_tag_by_id(admin_browser.contents,
1843+ ... 'update-status').h2.renderContents())
1844 Update machine status
1845
1846 >>> admin_browser.getControl('Reason').value = (
1847
1848=== modified file 'lib/lp/code/stories/codeimport/xx-codeimport-results.txt'
1849--- lib/lp/code/stories/codeimport/xx-codeimport-results.txt 2017-10-23 00:16:39 +0000
1850+++ lib/lp/code/stories/codeimport/xx-codeimport-results.txt 2018-05-13 10:39:08 +0000
1851@@ -30,7 +30,7 @@
1852
1853 >>> browser.open(branch_url_1)
1854 >>> import_results = find_tag_by_id(browser.contents, 'import-results')
1855- >>> print extract_text(import_results).replace('&mdash;', '--')
1856+ >>> print(extract_text(import_results).replace('&mdash;', '--'))
1857 Import started on 2007-12-07 on odin and finished on 2007-12-07
1858 taking 7 hours -- see the log
1859 Import started on 2007-12-06 on odin and finished on 2007-12-06
1860@@ -53,7 +53,7 @@
1861 >>> # The ordering here is dependant on the order the status values
1862 >>> # are declared in the enumeration.
1863 >>> for img in import_results.findAll('img'):
1864- ... print img
1865+ ... print(img)
1866 <img src="/@@/no" title="Unsupported feature" />
1867 <img src="/@@/no" title="Foreign branch invalid" />
1868 <img src="/@@/no" title="Internal Failure" />
1869@@ -65,7 +65,7 @@
1870 >>> browser.open(branch_url_2)
1871 >>> import_results = find_tag_by_id(browser.contents, 'import-results')
1872 >>> for img in import_results.findAll('img'):
1873- ... print img
1874+ ... print(img)
1875 <img src="/@@/no" title="Job killed" />
1876 <img src="/@@/no" title="Job reclaimed" />
1877 <img src="/@@/no" title="Broken remote branch" />
1878
1879=== modified file 'lib/lp/code/stories/codeimport/xx-codeimport-view.txt'
1880--- lib/lp/code/stories/codeimport/xx-codeimport-view.txt 2016-10-13 14:21:35 +0000
1881+++ lib/lp/code/stories/codeimport/xx-codeimport-view.txt 2018-05-13 10:39:08 +0000
1882@@ -32,13 +32,13 @@
1883
1884 >>> browser.open('http://code.launchpad.dev')
1885 >>> browser.getLink('3 imported branches').click()
1886- >>> print browser.title
1887+ >>> print(browser.title)
1888 Code Imports
1889
1890 Any user can look at the current list of imports.
1891
1892 >>> anon_browser.open('http://code.launchpad.dev/+code-imports')
1893- >>> print anon_browser.title
1894+ >>> print(anon_browser.title)
1895 Code Imports
1896
1897 There are two CodeImports in the sample data and they both show up in
1898@@ -47,7 +47,7 @@
1899 >>> table = find_tag_by_id(browser.contents, 'code-import-listing')
1900 >>> names = [extract_text(tr.td) for tr in table.tbody('tr')]
1901 >>> for name in names:
1902- ... print name
1903+ ... print(name)
1904 ~vcs-imports/gnome-terminal/import
1905 ~vcs-imports/evolution/import
1906 ~name12/gnome-terminal/+git/gnome-terminal
1907@@ -76,8 +76,8 @@
1908 ['Any']
1909 >>> control.displayValue = ["Invalid"]
1910 >>> browser.getControl(name="submit").click()
1911- >>> print extract_text(
1912- ... find_tag_by_id(browser.contents, 'no-imports'))
1913+ >>> print(extract_text(
1914+ ... find_tag_by_id(browser.contents, 'no-imports')))
1915 No matching code imports found.
1916
1917 Of course selecting the "Any" filtering option ensures that all
1918@@ -88,7 +88,7 @@
1919 >>> table = find_tag_by_id(browser.contents, 'code-import-listing')
1920 >>> rows = [extract_text(tr) for tr in table('tr')]
1921 >>> for row in rows:
1922- ... print row
1923+ ... print(row)
1924 Import Created Source type Target type Location Status
1925 ~vcs-imports/gnome-terminal/import 2007-... Subversion via ... Bazaar http://sv... Reviewed
1926 ~vcs-imports/evolution/import 2007-... Concurrent Vers... Bazaar :pserver:... Pending Review
1927@@ -105,7 +105,7 @@
1928 >>> table = find_tag_by_id(browser.contents, 'code-import-listing')
1929 >>> rows = [extract_text(tr) for tr in table('tr')]
1930 >>> for row in rows:
1931- ... print row
1932+ ... print(row)
1933 Import Created Source type Target type Location Status
1934 ~vcs-imports/evolution/import 2007-... Concurrent Vers... Bazaar :pserver:... Pending Review
1935
1936@@ -120,7 +120,7 @@
1937 >>> table = find_tag_by_id(browser.contents, 'code-import-listing')
1938 >>> rows = [extract_text(tr) for tr in table('tr')]
1939 >>> for row in rows:
1940- ... print row
1941+ ... print(row)
1942 Import Created Source type Target type Location Status
1943 ~name12/gnome-terminal/+git/gnome-terminal ... Git Git git://git... Reviewed
1944 ~name12/evolution/+git/evolution ... Git Git https://g... Reviewed
1945
1946=== modified file 'lib/lp/code/stories/codeimport/xx-create-codeimport.txt'
1947--- lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2016-11-12 02:24:09 +0000
1948+++ lib/lp/code/stories/codeimport/xx-create-codeimport.txt 2018-05-13 10:39:08 +0000
1949@@ -7,20 +7,20 @@
1950
1951 >>> browser = setupBrowser(auth="Basic no-priv@canonical.com:test")
1952 >>> browser.open("http://code.launchpad.dev")
1953- >>> print find_tag_by_id(browser.contents, "new-code-import")
1954+ >>> print(find_tag_by_id(browser.contents, "new-code-import"))
1955 <a href="/+code-imports/+new" id="new-code-import">
1956 <img alt="Import your project" ...>
1957 </a>
1958
1959 >>> browser.getLink(id="new-code-import").click()
1960- >>> print browser.title
1961+ >>> print(browser.title)
1962 Request a code import...
1963
1964 There is a cancel link on this page near the buttons to take the
1965 user back to the main code page.
1966
1967 >>> browser.getLink('Cancel').click()
1968- >>> print browser.url
1969+ >>> print(browser.url)
1970 http://code.launchpad.dev/
1971
1972 For projects that don't officially use Launchpad for code, there is also a
1973@@ -73,7 +73,7 @@
1974
1975 When the user clicks continue, the import branch is created
1976
1977- >>> print extract_text(find_tag_by_id(browser.contents, "import-details"))
1978+ >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
1979 Import Status: Reviewed
1980 This branch is an import of the Bazaar branch
1981 at http://bzr.example.com/firefox/trunk.
1982@@ -92,7 +92,7 @@
1983 ... "http://user:password@bzr.example.com/firefox/trunk")
1984 >>> browser.getControl('Project').value = "firefox"
1985 >>> browser.getControl('Request Import').click()
1986- >>> print extract_text(find_tag_by_id(browser.contents, "import-details"))
1987+ >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
1988 Import Status: Reviewed
1989 This branch is an import of the Bazaar branch
1990 at http://user:password@bzr.example.com/firefox/trunk.
1991@@ -121,7 +121,7 @@
1992 >>> browser.getControl('Repo URL', index=0).value = (
1993 ... "git://git.launchpad.net/firefox.git")
1994 >>> browser.getControl('Request Import').click()
1995- >>> print extract_text(find_tag_by_id(browser.contents, "import-details"))
1996+ >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
1997 Import Status: Reviewed
1998 This branch is an import of the HEAD branch of the Git repository at
1999 git://git.launchpad.net/firefox.git.
2000@@ -143,7 +143,7 @@
2001
2002 When the user clicks continue, the import branch is created
2003
2004- >>> print extract_text(find_tag_by_id(browser.contents, "import-details"))
2005+ >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
2006 Import Status: Reviewed
2007 This branch is an import of the Subversion branch
2008 from http://svn.example.com/firefox/trunk.
2009@@ -157,9 +157,9 @@
2010 attribute on the text of 'Subversion'.
2011
2012 >>> svn_span = find_tag_by_id(browser.contents, 'svn-import-details').span
2013- >>> print extract_text(svn_span)
2014+ >>> print(extract_text(svn_span))
2015 Subversion
2016- >>> print svn_span['title']
2017+ >>> print(svn_span['title'])
2018 Subversion via bzr-svn
2019
2020 If the user wants, they can include a username and password in the
2021@@ -172,7 +172,7 @@
2022 ... "http://user:password@svn.example.com/firefox/trunk")
2023 >>> browser.getControl('Project').value = "firefox"
2024 >>> browser.getControl('Request Import').click()
2025- >>> print extract_text(find_tag_by_id(browser.contents, "import-details"))
2026+ >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
2027 Import Status: Reviewed
2028 This branch is an import of the Subversion branch
2029 from http://user:password@svn.example.com/firefox/trunk.
2030@@ -196,7 +196,7 @@
2031
2032 When the user clicks continue, the approved import branch is created.
2033
2034- >>> print extract_text(find_tag_by_id(browser.contents, "import-details"))
2035+ >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
2036 Import Status: Reviewed
2037 This branch is an import of the HEAD branch of the Git repository at
2038 git://example.com/firefox.git.
2039@@ -229,7 +229,7 @@
2040
2041 When the user clicks continue, the approved import repository is created.
2042
2043- >>> print extract_text(find_tag_by_id(browser.contents, "import-details"))
2044+ >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
2045 Import Status: Reviewed
2046 This repository is an import of the Git repository at
2047 git://example.com/firefox.git.
2048@@ -251,7 +251,7 @@
2049 >>> browser.getControl('Module').value = "firefox"
2050 >>> browser.getControl('Request Import').click()
2051
2052- >>> print extract_text(find_tag_by_id(browser.contents, "import-details"))
2053+ >>> print(extract_text(find_tag_by_id(browser.contents, "import-details")))
2054 Import Status: Reviewed
2055 This branch is an import of the CVS module firefox from
2056 :pserver:anonymous@cvs.example.com:/mozilla/cvs.
2057
2058=== modified file 'lib/lp/code/stories/codeimport/xx-edit-codeimport.txt'
2059--- lib/lp/code/stories/codeimport/xx-edit-codeimport.txt 2013-09-27 04:13:23 +0000
2060+++ lib/lp/code/stories/codeimport/xx-edit-codeimport.txt 2018-05-13 10:39:08 +0000
2061@@ -40,7 +40,7 @@
2062 >>> def print_import_details(browser):
2063 ... div = find_tag_by_id(
2064 ... browser.contents, 'branch-import-details').div.div
2065- ... print extract_text(div)
2066+ ... print(extract_text(div))
2067 >>> anon_browser.open(svn_import_location)
2068 >>> print_import_details(anon_browser)
2069 Import Status: Reviewed
2070@@ -129,7 +129,7 @@
2071 >>> anon_browser.getControl('Import Now')
2072 Traceback (most recent call last):
2073 ...
2074- LookupError: label 'Import Now'
2075+ LookupError: label u'Import Now'
2076
2077 If the logged in user clicks this button, the import will be scheduled
2078 to run ASAP and the fact that the import has been requested is
2079
2080=== modified file 'lib/lp/code/stories/codeimport/xx-failing-codeimport.txt'
2081--- lib/lp/code/stories/codeimport/xx-failing-codeimport.txt 2011-12-29 05:29:36 +0000
2082+++ lib/lp/code/stories/codeimport/xx-failing-codeimport.txt 2018-05-13 10:39:08 +0000
2083@@ -22,7 +22,8 @@
2084
2085 >>> user_browser.open(
2086 ... 'http://code.launchpad.dev/~import-owner/imported/trunk')
2087- >>> print extract_text(find_tag_by_id(user_browser.contents, 'failing-try-again'))
2088+ >>> print(extract_text(
2089+ ... find_tag_by_id(user_browser.contents, 'failing-try-again')))
2090 The import has been suspended because it failed 5 or more times in succession.
2091
2092 Any logged in user will also see a button that can request the import
2093@@ -45,7 +46,7 @@
2094
2095 >>> def print_import_details(browser):
2096 ... div = find_tag_by_id(browser.contents, 'import-details')
2097- ... print extract_text(div)
2098+ ... print(extract_text(div))
2099 >>> user_browser.getControl('Try Again').click()
2100 >>> print_import_details(user_browser)
2101 Import Status: Reviewed
2102
2103=== modified file 'lib/lp/code/stories/feeds/xx-branch-atom.txt'
2104--- lib/lp/code/stories/feeds/xx-branch-atom.txt 2015-01-29 14:14:01 +0000
2105+++ lib/lp/code/stories/feeds/xx-branch-atom.txt 2018-05-13 10:39:08 +0000
2106@@ -53,7 +53,7 @@
2107 [u'Branches for Mike Murphy']
2108 >>> def print_parse_ids(browser):
2109 ... for id in parse_ids(browser.contents):
2110- ... print id
2111+ ... print(id)
2112
2113 Ignore the date associated with the id of 'mike' as this is the date created
2114 of the person, which will be different each time the test is run.
2115@@ -69,7 +69,7 @@
2116
2117 >>> def print_parse_links(browser):
2118 ... for link in parse_links(browser.contents, rel="self"):
2119- ... print link
2120+ ... print(link)
2121 >>> print_parse_links(anon_browser)
2122 <link rel="self" href="http://feeds.launchpad.dev/~mike/branches.atom" />
2123
2124@@ -114,7 +114,7 @@
2125 ... test_user).getBranches().order_by(Branch.id)
2126 >>> for branch in branches:
2127 ... branch = removeSecurityProxy(branch)
2128- ... print branch.unique_name, branch.private
2129+ ... print(branch.unique_name, branch.private)
2130 ~landscape-developers/landscape/trunk True
2131 ~name12/landscape/feature-x True
2132 >>> logout()
2133@@ -208,7 +208,7 @@
2134 No Errors
2135 >>> BSS(browser.contents).title.contents
2136 [u'Latest Revisions for Branch lp://dev/~mark/firefox/release--0.9.1']
2137- >>> print browser.url
2138+ >>> print(browser.url)
2139 http://feeds.launchpad.dev/~mark/firefox/release--0.9.1/branch.atom
2140
2141 The first <id> in a feed identifies the feed. Each entry then has its
2142@@ -217,7 +217,7 @@
2143 >>> soup = BSS(browser.contents, parseOnlyThese=SoupStrainer('id'))
2144 >>> ids = parse_ids(browser.contents)
2145 >>> for id_ in ids:
2146- ... print id_
2147+ ... print(id_)
2148 <id>tag:launchpad.net,2006-10-16:/code/~mark/firefox/release--0.9.1</id>
2149 <id>tag:launchpad.net,2005-03-09:/code/~mark/firefox/release--0.9.1/revision/1</id>
2150 >>> print_parse_links(browser)
2151
2152=== modified file 'lib/lp/code/stories/feeds/xx-revision-atom.txt'
2153--- lib/lp/code/stories/feeds/xx-revision-atom.txt 2015-01-29 14:14:01 +0000
2154+++ lib/lp/code/stories/feeds/xx-revision-atom.txt 2018-05-13 10:39:08 +0000
2155@@ -79,7 +79,7 @@
2156 [u'Latest Revisions by Mike Murphy']
2157 >>> def print_parse_ids(browser):
2158 ... for id in parse_ids(browser.contents):
2159- ... print id
2160+ ... print(id)
2161
2162 Ignore the date associated with the id of 'mike' as this is the date created
2163 of the person, which will be different each time the test is run.
2164@@ -94,7 +94,7 @@
2165
2166 >>> def print_parse_links(browser):
2167 ... for link in parse_links(browser.contents, rel="self"):
2168- ... print link
2169+ ... print(link)
2170 >>> print_parse_links(anon_browser)
2171 <link rel="self" href="http://feeds.launchpad.dev/~mike/revisions.atom" />
2172
2173
2174=== modified file 'lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt'
2175--- lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt 2017-10-23 00:16:39 +0000
2176+++ lib/lp/code/stories/sourcepackagerecipes/xx-recipe-listings.txt 2018-05-13 10:39:08 +0000
2177@@ -8,12 +8,12 @@
2178 >>> def print_recipe_listing_head(browser):
2179 ... table = find_tag_by_id(browser.contents, 'recipetable')
2180 ... for row in table.thead.findAll('tr'):
2181- ... print extract_text(row)
2182+ ... print(extract_text(row))
2183
2184 >>> def print_recipe_listing_contents(browser):
2185 ... table = find_tag_by_id(browser.contents, 'recipetable')
2186 ... for row in table.tbody.findAll('tr'):
2187- ... print extract_text(row)
2188+ ... print(extract_text(row))
2189
2190
2191 Branch Recipe Listings
2192@@ -49,7 +49,7 @@
2193
2194 >>> nopriv_browser.open(branch_url)
2195 >>> nopriv_browser.getLink('3 recipes').click()
2196- >>> print nopriv_browser.url
2197+ >>> print(nopriv_browser.url)
2198 http://code.launchpad.dev/%7Eperson-name.../product-name.../branch.../+recipes
2199
2200 The "Base Source" column should not be shown.
2201@@ -97,7 +97,7 @@
2202
2203 >>> nopriv_browser.open(repository_url)
2204 >>> nopriv_browser.getLink('4 recipes').click()
2205- >>> print nopriv_browser.url
2206+ >>> print(nopriv_browser.url)
2207 http://code.launchpad.dev/%7Eperson-name.../product-name.../+git/gitrepository.../+recipes
2208
2209 The "Base Source" column should not be shown.
2210@@ -124,7 +124,7 @@
2211 >>> with GitHostingFixture():
2212 ... nopriv_browser.open(ref1_url)
2213 >>> nopriv_browser.getLink('2 recipes').click()
2214- >>> print nopriv_browser.url
2215+ >>> print(nopriv_browser.url)
2216 http://code.launchpad.dev/%7Eperson-name.../product-name.../+git/gitrepository.../+ref/a/+recipes
2217
2218 >>> print_recipe_listing_head(nopriv_browser)
2219@@ -144,7 +144,7 @@
2220
2221 >>> nopriv_browser.open(product_url)
2222 >>> nopriv_browser.getLink('View source package recipes').click()
2223- >>> print nopriv_browser.url
2224+ >>> print(nopriv_browser.url)
2225 http://code.launchpad.dev/product-name.../+recipes
2226
2227 >>> print_recipe_listing_head(nopriv_browser)
2228@@ -165,7 +165,7 @@
2229
2230 >>> nopriv_browser.open(target_url)
2231 >>> nopriv_browser.getLink('View source package recipes').click()
2232- >>> print nopriv_browser.url
2233+ >>> print(nopriv_browser.url)
2234 http://code.launchpad.dev/product-name.../+recipes
2235
2236 >>> print_recipe_listing_head(nopriv_browser)
2237@@ -196,7 +196,7 @@
2238
2239 >>> nopriv_browser.open(person_url)
2240 >>> nopriv_browser.getLink('View source package recipes').click()
2241- >>> print nopriv_browser.url
2242+ >>> print(nopriv_browser.url)
2243 http://code.launchpad.dev/~person-name.../+recipes
2244
2245 The "Owner" section should be missing.
2246
2247=== modified file 'lib/lp/code/stories/webservice/xx-branch-links.txt'
2248--- lib/lp/code/stories/webservice/xx-branch-links.txt 2012-08-08 07:22:51 +0000
2249+++ lib/lp/code/stories/webservice/xx-branch-links.txt 2018-05-13 10:39:08 +0000
2250@@ -43,7 +43,7 @@
2251 ... robots['self_link'], 'unlinkBug', bug=bug['self_link'])
2252 >>> bugs = webservice.get(
2253 ... robots['linked_bugs_collection_link']).jsonBody()
2254- >>> print len(bugs['entries'])
2255+ >>> print(len(bugs['entries']))
2256 0
2257
2258
2259@@ -73,5 +73,5 @@
2260 ... robots['self_link'], 'unlinkSpecification', spec=spec['self_link'])
2261 >>> spec_links = webservice.get(
2262 ... robots['spec_links_collection_link']).jsonBody()
2263- >>> print len(spec_links['entries'])
2264+ >>> print(len(spec_links['entries']))
2265 0
2266
2267=== modified file 'lib/lp/code/stories/webservice/xx-branch.txt'
2268--- lib/lp/code/stories/webservice/xx-branch.txt 2015-09-29 16:59:09 +0000
2269+++ lib/lp/code/stories/webservice/xx-branch.txt 2018-05-13 10:39:08 +0000
2270@@ -46,7 +46,7 @@
2271
2272 At the moment, it's not scheduled to be mirrored.
2273
2274- >>> print branch.next_mirror_time
2275+ >>> print(branch.next_mirror_time)
2276 None
2277
2278 But we can ask for it to be mirrored using the webservice:
2279@@ -62,7 +62,7 @@
2280 The new "next mirror time" is the time when we actually submitted the
2281 request for a mirror:
2282
2283- >>> print start_time < branch.next_mirror_time < end_time
2284+ >>> print(start_time < branch.next_mirror_time < end_time)
2285 True
2286
2287
2288@@ -153,7 +153,7 @@
2289 >>> landing_candidates = webservice.get(
2290 ... fooix_trunk['landing_candidates_collection_link']).jsonBody()
2291 >>> for candidate in landing_candidates['entries']:
2292- ... print candidate['source_branch_link']
2293+ ... print(candidate['source_branch_link'])
2294 http://.../~eric/fooix/feature-branch
2295
2296
2297@@ -163,13 +163,13 @@
2298 >>> feature_branch_link = \
2299 ... '/~eric/fooix/feature-branch'
2300 >>> feature_branch = webservice.get(feature_branch_link).jsonBody()
2301- >>> print feature_branch['unique_name']
2302+ >>> print(feature_branch['unique_name'])
2303 ~eric/fooix/feature-branch
2304
2305 >>> landing_targets = webservice.get(
2306 ... feature_branch['landing_targets_collection_link']).jsonBody()
2307 >>> for target in landing_targets['entries']:
2308- ... print target['target_branch_link']
2309+ ... print(target['target_branch_link'])
2310 http://.../~eric/fooix/trunk
2311
2312 The isPersonTrustedReviewer method is exposed, and takes a person link.
2313@@ -177,7 +177,7 @@
2314 >>> trusted = webservice.named_get(
2315 ... feature_branch['self_link'], 'isPersonTrustedReviewer',
2316 ... reviewer=feature_branch['owner_link']).jsonBody()
2317- >>> print trusted
2318+ >>> print(trusted)
2319 True
2320
2321
2322@@ -187,7 +187,7 @@
2323 The branches of a project are also available.
2324
2325 >>> def print_branch(branch):
2326- ... print branch['unique_name'] + ' - ' + branch['lifecycle_status']
2327+ ... print(branch['unique_name'] + ' - ' + branch['lifecycle_status'])
2328 >>> def print_branches(webservice, url, status=None, modified_since=None):
2329 ... branches = webservice.named_get(
2330 ... url, 'getBranches',
2331@@ -255,20 +255,20 @@
2332 the named operation 'setPrivate'.
2333
2334 >>> branch = webservice.get(branch_url).jsonBody()
2335- >>> print branch['private']
2336+ >>> print(branch['private'])
2337 False
2338
2339 >>> response = webservice.named_post(
2340 ... branch_url, 'setPrivate', api_version='beta', private=True)
2341 >>> branch = webservice.get(branch_url).jsonBody()
2342- >>> print branch['information_type']
2343+ >>> print(branch['information_type'])
2344 Private
2345
2346 In subsequent versions, 'setPrivate' is gone; you have to use the
2347 'transitionToInformationType' method.
2348
2349- >>> print webservice.named_post(
2350- ... branch_url, 'setPrivate', api_version='devel', private=True)
2351+ >>> print(webservice.named_post(
2352+ ... branch_url, 'setPrivate', api_version='devel', private=True))
2353 HTTP/1.1 400 Bad Request
2354 ...
2355 No such operation: setPrivate
2356@@ -281,19 +281,19 @@
2357
2358 >>> deletable = webservice.named_get('/~eric/fooix/feature-branch',
2359 ... 'canBeDeleted').jsonBody()
2360- >>> print deletable
2361+ >>> print(deletable)
2362 False
2363
2364 Deleting only works on branches that do not have anything else
2365 depending on them.
2366
2367 >>> response = webservice.delete('/~eric/fooix/feature-branch')
2368- >>> print response
2369+ >>> print(response)
2370 HTTP/1.1 200 Ok
2371 ...
2372
2373 >>> response = webservice.delete('/~mary/blob/bar')
2374- >>> print response
2375+ >>> print(response)
2376 HTTP/1.1 200 Ok
2377 ...
2378
2379
2380=== modified file 'lib/lp/code/stories/webservice/xx-branches.txt'
2381--- lib/lp/code/stories/webservice/xx-branches.txt 2011-12-20 11:30:27 +0000
2382+++ lib/lp/code/stories/webservice/xx-branches.txt 2018-05-13 10:39:08 +0000
2383@@ -44,18 +44,18 @@
2384
2385 We gave three URLs, so we get back a dict with three branches.
2386
2387- >>> print len(branches)
2388+ >>> print(len(branches))
2389 3
2390
2391 The URL that refers to a branch that doesn't exist maps to None.
2392
2393- >>> print branches[doesnt_exist]
2394+ >>> print(branches[doesnt_exist])
2395 None
2396
2397 The URLs that refer to real, honest-to-goodness existing branches map to those
2398 branches:
2399
2400- >>> print branches[branch_url]['unique_name'] == branch_unique_name
2401+ >>> print(branches[branch_url]['unique_name'] == branch_unique_name)
2402 True
2403- >>> print branches[branch2_url]['unique_name'] == branch2_unique_name
2404+ >>> print(branches[branch2_url]['unique_name'] == branch2_unique_name)
2405 True
2406
2407=== modified file 'lib/lp/code/stories/webservice/xx-branchmergeproposal.txt'
2408--- lib/lp/code/stories/webservice/xx-branchmergeproposal.txt 2016-06-24 15:44:48 +0000
2409+++ lib/lp/code/stories/webservice/xx-branchmergeproposal.txt 2018-05-13 10:39:08 +0000
2410@@ -85,12 +85,12 @@
2411
2412 If we try and create the merge proposal again, we should get a ValueError.
2413
2414- >>> print registrant_webservice.named_post(
2415+ >>> print(registrant_webservice.named_post(
2416 ... source_url, 'createMergeProposal', target_branch=target_url,
2417 ... prerequisite_branch=prerequisite_url,
2418 ... initial_comment='Merge\nit!', needs_review=True,
2419 ... commit_message='It was merged!\n', reviewers=[reviewer_url],
2420- ... review_types=['green'])
2421+ ... review_types=['green']))
2422 HTTP/1.1 400 Bad Request
2423 ...
2424 There is already a branch merge proposal registered for branch
2425@@ -192,7 +192,7 @@
2426
2427 >>> all_comments = webservice.get(
2428 ... merge_proposal['all_comments_collection_link']).jsonBody()
2429- >>> print len(all_comments['entries'])
2430+ >>> print(len(all_comments['entries']))
2431 2
2432 >>> pprint_entry(all_comments['entries'][0])
2433 as_quoted_email: u'> This is great work'
2434@@ -233,7 +233,7 @@
2435
2436 >>> votes = webservice.get(
2437 ... merge_proposal['votes_collection_link']).jsonBody()['entries']
2438- >>> print len(votes)
2439+ >>> print(len(votes))
2440 2
2441 >>> pprint_entry(votes[0])
2442 branch_merge_proposal_link: u'http://.../~source/fooix/fix-it/+merge/...'
2443@@ -260,7 +260,7 @@
2444 >>> reviewer = reviewer_webservice.named_post(
2445 ... merge_proposal['self_link'], 'nominateReviewer',
2446 ... reviewer=person['self_link'], review_type='code')
2447- >>> print reviewer
2448+ >>> print(reviewer)
2449 HTTP/1.1 200 Ok ...
2450 >>> reviewer_entry = reviewer.jsonBody()
2451 >>> pprint_entry(reviewer_entry)
2452@@ -275,7 +275,7 @@
2453 self_link: u'http://.../~source/fooix/fix-it/+merge/.../+review/...'
2454
2455 >>> vote = reviewer_webservice.get(reviewer_entry['self_link'])
2456- >>> print vote
2457+ >>> print(vote)
2458 HTTP/1.1 200 Ok ...
2459
2460 Now the code review should be made.
2461@@ -305,13 +305,13 @@
2462
2463 >>> _unused = reviewer_webservice.named_post(
2464 ... merge_proposal['self_link'], 'setStatus',
2465- ... status=u'Approved', revid=u'25')
2466+ ... status=u'Approved', revid='25')
2467 >>> merge_proposal = reviewer_webservice.get(
2468 ... merge_proposal['self_link']).jsonBody()
2469
2470- >>> print merge_proposal['queue_status']
2471+ >>> print(merge_proposal['queue_status'])
2472 Approved
2473- >>> print merge_proposal['reviewed_revid']
2474+ >>> print(merge_proposal['reviewed_revid'])
2475 25
2476
2477 However, there may have been breakage in the branch, and we need to revert back
2478@@ -323,9 +323,9 @@
2479 >>> merge_proposal = reviewer_webservice.get(
2480 ... merge_proposal['self_link']).jsonBody()
2481
2482- >>> print merge_proposal['queue_status']
2483+ >>> print(merge_proposal['queue_status'])
2484 Work in progress
2485- >>> print merge_proposal['reviewed_revid']
2486+ >>> print(merge_proposal['reviewed_revid'])
2487 None
2488
2489 == Getting a Project's Pending Merge Proposals ==
2490@@ -334,8 +334,7 @@
2491 proposals by their status.
2492
2493 >>> def print_proposal(proposal):
2494- ... print proposal['self_link'] + ' - ' + \
2495- ... proposal['queue_status']
2496+ ... print(proposal['self_link'] + ' - ' + proposal['queue_status'])
2497
2498
2499 >>> proposals = webservice.named_get(
2500
2501=== modified file 'lib/lp/code/stories/webservice/xx-branchsubscription.txt'
2502--- lib/lp/code/stories/webservice/xx-branchsubscription.txt 2011-01-26 19:35:17 +0000
2503+++ lib/lp/code/stories/webservice/xx-branchsubscription.txt 2018-05-13 10:39:08 +0000
2504@@ -44,7 +44,7 @@
2505 >>> def print_subscriber_count(branch):
2506 ... subscribers = webservice.get(
2507 ... corn['subscribers_collection_link']).jsonBody()
2508- ... print len(subscribers['entries'])
2509+ ... print(len(subscribers['entries']))
2510 >>> print_subscriber_count(corn)
2511 2
2512
2513@@ -52,7 +52,7 @@
2514 ... subscribers = webservice.get(
2515 ... corn['subscribers_collection_link']).jsonBody()
2516 ... for subscriber in subscribers['entries']:
2517- ... print subscriber['display_name']
2518+ ... print(subscriber['display_name'])
2519 >>> print_subscriber_names(corn)
2520 Farmer Bob
2521 Farmer Joe
2522@@ -68,7 +68,7 @@
2523 ... corn['self_link'], 'getSubscription',
2524 ... person=joe['self_link']).jsonBody()
2525
2526- >>> print subscription['self_link']
2527+ >>> print(subscription['self_link'])
2528 http://.../~farmer-bob/farm/corn/+subscription/farmer-joe
2529
2530
2531
2532=== modified file 'lib/lp/code/stories/webservice/xx-code-import.txt'
2533--- lib/lp/code/stories/webservice/xx-code-import.txt 2016-10-13 15:52:36 +0000
2534+++ lib/lp/code/stories/webservice/xx-code-import.txt 2018-05-13 10:39:08 +0000
2535@@ -35,7 +35,7 @@
2536 >>> branch_url = '/' + no_import_branch.unique_name
2537 >>> response = import_webservice.get(branch_url)
2538 >>> representation = response.jsonBody()
2539- >>> print representation['code_import_link']
2540+ >>> print(representation['code_import_link'])
2541 None
2542
2543 For a branch with an import we get a link to the import entry in its
2544@@ -44,7 +44,7 @@
2545 >>> branch_url = '/' + code_import.branch.unique_name
2546 >>> response = import_webservice.get(branch_url)
2547 >>> representation = response.jsonBody()
2548- >>> print representation['code_import_link']
2549+ >>> print(representation['code_import_link'])
2550 http://.../~import-owner/scruff/import/+code-import
2551
2552 We can get some information about the import using this URL.
2553@@ -52,23 +52,23 @@
2554 >>> import_url = representation['code_import_link']
2555 >>> response = import_webservice.get(import_url)
2556 >>> representation = response.jsonBody()
2557- >>> print representation['self_link'] == import_url
2558+ >>> print(representation['self_link'] == import_url)
2559 True
2560- >>> print representation['branch_link']
2561+ >>> print(representation['branch_link'])
2562 http://.../~import-owner/scruff/import
2563- >>> print representation['review_status']
2564+ >>> print(representation['review_status'])
2565 Reviewed
2566- >>> print representation['rcs_type']
2567+ >>> print(representation['rcs_type'])
2568 Subversion via bzr-svn
2569- >>> print representation['target_rcs_type']
2570+ >>> print(representation['target_rcs_type'])
2571 Bazaar
2572- >>> print representation['url']
2573+ >>> print(representation['url'])
2574 http://svn.domain.com/source
2575- >>> print representation['cvs_root']
2576- None
2577- >>> print representation['cvs_module']
2578- None
2579- >>> print representation['date_last_successful']
2580+ >>> print(representation['cvs_root'])
2581+ None
2582+ >>> print(representation['cvs_module'])
2583+ None
2584+ >>> print(representation['date_last_successful'])
2585 None
2586
2587
2588@@ -96,7 +96,7 @@
2589 >>> branch_url = '/' + code_import.branch.unique_name
2590 >>> response = import_webservice.get(branch_url)
2591 >>> representation = response.jsonBody()
2592- >>> print representation['code_import_link']
2593+ >>> print(representation['code_import_link'])
2594 http://.../~import-owner/scruffbuntu/manic/scruff/import/+code-import
2595
2596 and there is information available about the import itsef.
2597@@ -104,23 +104,23 @@
2598 >>> import_url = representation['code_import_link']
2599 >>> response = import_webservice.get(import_url)
2600 >>> representation = response.jsonBody()
2601- >>> print representation['self_link'] == import_url
2602+ >>> print(representation['self_link'] == import_url)
2603 True
2604- >>> print representation['branch_link']
2605+ >>> print(representation['branch_link'])
2606 http://.../~import-owner/scruffbuntu/manic/scruff/import
2607- >>> print representation['review_status']
2608+ >>> print(representation['review_status'])
2609 Reviewed
2610- >>> print representation['rcs_type']
2611+ >>> print(representation['rcs_type'])
2612 Subversion via bzr-svn
2613- >>> print representation['target_rcs_type']
2614+ >>> print(representation['target_rcs_type'])
2615 Bazaar
2616- >>> print representation['url']
2617+ >>> print(representation['url'])
2618 http://svn.domain.com/package_source
2619- >>> print representation['cvs_root']
2620- None
2621- >>> print representation['cvs_module']
2622- None
2623- >>> print representation['date_last_successful']
2624+ >>> print(representation['cvs_root'])
2625+ None
2626+ >>> print(representation['cvs_module'])
2627+ None
2628+ >>> print(representation['date_last_successful'])
2629 None
2630
2631
2632@@ -134,28 +134,28 @@
2633 >>> response = import_webservice.named_post(product_url, 'newCodeImport',
2634 ... branch_name='new-import', rcs_type='Git',
2635 ... url=new_remote_url)
2636- >>> print response.status
2637+ >>> print(response.status)
2638 201
2639 >>> location = response.getHeader('Location')
2640 >>> response = import_webservice.get(location)
2641 >>> representation = response.jsonBody()
2642- >>> print representation['self_link']
2643+ >>> print(representation['self_link'])
2644 http://.../~import-owner/scruff/new-import/+code-import
2645- >>> print representation['branch_link']
2646+ >>> print(representation['branch_link'])
2647 http://.../~import-owner/scruff/new-import
2648- >>> print representation['git_repository_link']
2649+ >>> print(representation['git_repository_link'])
2650 None
2651- >>> print representation['rcs_type']
2652+ >>> print(representation['rcs_type'])
2653 Git
2654- >>> print representation['target_rcs_type']
2655+ >>> print(representation['target_rcs_type'])
2656 Bazaar
2657- >>> print representation['url'] == new_remote_url
2658+ >>> print(representation['url'] == new_remote_url)
2659 True
2660- >>> print representation['cvs_root']
2661- None
2662- >>> print representation['cvs_module']
2663- None
2664- >>> print representation['date_last_successful']
2665+ >>> print(representation['cvs_root'])
2666+ None
2667+ >>> print(representation['cvs_module'])
2668+ None
2669+ >>> print(representation['date_last_successful'])
2670 None
2671
2672 If we must we can create a CVS import.
2673@@ -165,28 +165,28 @@
2674 >>> response = import_webservice.named_post(product_url, 'newCodeImport',
2675 ... branch_name='cvs-import', rcs_type='Concurrent Versions System',
2676 ... cvs_root=new_remote_url, cvs_module="foo")
2677- >>> print response.status
2678+ >>> print(response.status)
2679 201
2680 >>> location = response.getHeader('Location')
2681 >>> response = import_webservice.get(location)
2682 >>> representation = response.jsonBody()
2683- >>> print representation['self_link']
2684+ >>> print(representation['self_link'])
2685 http://.../~import-owner/scruff/cvs-import/+code-import
2686- >>> print representation['branch_link']
2687+ >>> print(representation['branch_link'])
2688 http://.../~import-owner/scruff/cvs-import
2689- >>> print representation['git_repository_link']
2690+ >>> print(representation['git_repository_link'])
2691 None
2692- >>> print representation['rcs_type']
2693+ >>> print(representation['rcs_type'])
2694 Concurrent Versions System
2695- >>> print representation['target_rcs_type']
2696+ >>> print(representation['target_rcs_type'])
2697 Bazaar
2698- >>> print representation['url']
2699+ >>> print(representation['url'])
2700 None
2701- >>> print representation['cvs_root'] == new_remote_url
2702- True
2703- >>> print representation['cvs_module'] == "foo"
2704- True
2705- >>> print representation['date_last_successful']
2706+ >>> print(representation['cvs_root'] == new_remote_url)
2707+ True
2708+ >>> print(representation['cvs_module'] == "foo")
2709+ True
2710+ >>> print(representation['date_last_successful'])
2711 None
2712
2713 We can create a Git-to-Git import, provided that we have the feature flag.
2714@@ -201,37 +201,37 @@
2715 >>> response = import_webservice.named_post(
2716 ... product_url, 'newCodeImport', branch_name='new-import',
2717 ... rcs_type='Git', target_rcs_type='Git', url=new_remote_url)
2718- >>> print response.status
2719+ >>> print(response.status)
2720 401
2721- >>> print response.body
2722+ >>> print(response.body)
2723 You do not have permission to create Git-targeted code imports.
2724 >>> with FeatureFixture({CODE_IMPORT_GIT_TARGET_FEATURE_FLAG: u'on'}):
2725 ... with GitHostingFixture():
2726 ... response = import_webservice.named_post(
2727 ... product_url, 'newCodeImport', branch_name='new-import',
2728 ... rcs_type='Git', target_rcs_type='Git', url=new_remote_url)
2729- >>> print response.status
2730+ >>> print(response.status)
2731 201
2732 >>> location = response.getHeader('Location')
2733 >>> response = import_webservice.get(location)
2734 >>> representation = response.jsonBody()
2735- >>> print representation['self_link']
2736+ >>> print(representation['self_link'])
2737 http://.../~import-owner/scruff/+git/new-import/+code-import
2738- >>> print representation['branch_link']
2739+ >>> print(representation['branch_link'])
2740 None
2741- >>> print representation['git_repository_link']
2742+ >>> print(representation['git_repository_link'])
2743 http://.../~import-owner/scruff/+git/new-import
2744- >>> print representation['rcs_type']
2745- Git
2746- >>> print representation['target_rcs_type']
2747- Git
2748- >>> print representation['url'] == new_remote_url
2749+ >>> print(representation['rcs_type'])
2750+ Git
2751+ >>> print(representation['target_rcs_type'])
2752+ Git
2753+ >>> print(representation['url'] == new_remote_url)
2754 True
2755- >>> print representation['cvs_root']
2756- None
2757- >>> print representation['cvs_module']
2758- None
2759- >>> print representation['date_last_successful']
2760+ >>> print(representation['cvs_root'])
2761+ None
2762+ >>> print(representation['cvs_module'])
2763+ None
2764+ >>> print(representation['date_last_successful'])
2765 None
2766
2767 We can also create an import targetting a source package.
2768@@ -243,28 +243,28 @@
2769 >>> response = import_webservice.named_post(source_package_url,
2770 ... 'newCodeImport', branch_name='new-import', rcs_type='Git',
2771 ... url=new_remote_url)
2772- >>> print response.status
2773+ >>> print(response.status)
2774 201
2775 >>> location = response.getHeader('Location')
2776 >>> response = import_webservice.get(location)
2777 >>> representation = response.jsonBody()
2778- >>> print representation['self_link']
2779+ >>> print(representation['self_link'])
2780 http://.../~import-owner/scruffbuntu/manic/scruff/new-import/+code-import
2781- >>> print representation['branch_link']
2782+ >>> print(representation['branch_link'])
2783 http://.../~import-owner/scruffbuntu/manic/scruff/new-import
2784- >>> print representation['git_repository_link']
2785+ >>> print(representation['git_repository_link'])
2786 None
2787- >>> print representation['rcs_type']
2788+ >>> print(representation['rcs_type'])
2789 Git
2790- >>> print representation['target_rcs_type']
2791+ >>> print(representation['target_rcs_type'])
2792 Bazaar
2793- >>> print representation['url'] == new_remote_url
2794+ >>> print(representation['url'] == new_remote_url)
2795 True
2796- >>> print representation['cvs_root']
2797- None
2798- >>> print representation['cvs_module']
2799- None
2800- >>> print representation['date_last_successful']
2801+ >>> print(representation['cvs_root'])
2802+ None
2803+ >>> print(representation['cvs_module'])
2804+ None
2805+ >>> print(representation['date_last_successful'])
2806 None
2807
2808 We can create a Git-to-Git import targetting a distribution source package.
2809@@ -278,28 +278,28 @@
2810 ... distro_source_package_url, 'newCodeImport',
2811 ... branch_name='new-import', rcs_type='Git',
2812 ... target_rcs_type='Git', url=new_remote_url)
2813- >>> print response.status
2814+ >>> print(response.status)
2815 201
2816 >>> location = response.getHeader('Location')
2817 >>> response = import_webservice.get(location)
2818 >>> representation = response.jsonBody()
2819- >>> print representation['self_link']
2820+ >>> print(representation['self_link'])
2821 http://.../~import-owner/scruffbuntu/+source/scruff/+git/new-import/+code-import
2822- >>> print representation['branch_link']
2823+ >>> print(representation['branch_link'])
2824 None
2825- >>> print representation['git_repository_link']
2826+ >>> print(representation['git_repository_link'])
2827 http://.../~import-owner/scruffbuntu/+source/scruff/+git/new-import
2828- >>> print representation['rcs_type']
2829- Git
2830- >>> print representation['target_rcs_type']
2831- Git
2832- >>> print representation['url'] == new_remote_url
2833+ >>> print(representation['rcs_type'])
2834+ Git
2835+ >>> print(representation['target_rcs_type'])
2836+ Git
2837+ >>> print(representation['url'] == new_remote_url)
2838 True
2839- >>> print representation['cvs_root']
2840- None
2841- >>> print representation['cvs_module']
2842- None
2843- >>> print representation['date_last_successful']
2844+ >>> print(representation['cvs_root'])
2845+ None
2846+ >>> print(representation['cvs_module'])
2847+ None
2848+ >>> print(representation['date_last_successful'])
2849 None
2850
2851 If we wish to create a branch owned by a team we are part of then we can.
2852@@ -309,28 +309,28 @@
2853 >>> response = import_webservice.named_post(product_url, 'newCodeImport',
2854 ... branch_name='team-import', rcs_type='Git',
2855 ... url=new_remote_url, owner=team_url)
2856- >>> print response.status
2857+ >>> print(response.status)
2858 201
2859 >>> location = response.getHeader('Location')
2860 >>> response = import_webservice.get(location)
2861 >>> representation = response.jsonBody()
2862- >>> print representation['self_link']
2863+ >>> print(representation['self_link'])
2864 http://.../~import-owner-team/scruff/team-import/+code-import
2865- >>> print representation['branch_link']
2866+ >>> print(representation['branch_link'])
2867 http://.../~import-owner-team/scruff/team-import
2868- >>> print representation['git_repository_link']
2869+ >>> print(representation['git_repository_link'])
2870 None
2871- >>> print representation['rcs_type']
2872+ >>> print(representation['rcs_type'])
2873 Git
2874- >>> print representation['target_rcs_type']
2875+ >>> print(representation['target_rcs_type'])
2876 Bazaar
2877- >>> print representation['url'] == new_remote_url
2878+ >>> print(representation['url'] == new_remote_url)
2879 True
2880- >>> print representation['cvs_root']
2881- None
2882- >>> print representation['cvs_module']
2883- None
2884- >>> print representation['date_last_successful']
2885+ >>> print(representation['cvs_root'])
2886+ None
2887+ >>> print(representation['cvs_module'])
2888+ None
2889+ >>> print(representation['date_last_successful'])
2890 None
2891
2892
2893@@ -351,7 +351,7 @@
2894 ... person, permission=OAuthPermission.WRITE_PUBLIC)
2895 >>> response = import_webservice.named_post(
2896 ... git_import_url, 'requestImport')
2897- >>> print response.status
2898+ >>> print(response.status)
2899 200
2900- >>> print response.jsonBody()
2901+ >>> print(response.jsonBody())
2902 None
2903
2904=== modified file 'lib/lp/code/tests/test_doc.py'
2905--- lib/lp/code/tests/test_doc.py 2018-05-13 10:39:08 +0000
2906+++ lib/lp/code/tests/test_doc.py 2018-05-13 10:39:08 +0000
2907@@ -18,6 +18,7 @@
2908 LaunchpadFunctionalLayer,
2909 LaunchpadZopelessLayer,
2910 )
2911+from lp.testing.pages import setUpGlobs
2912 from lp.testing.systemdocs import (
2913 LayeredDocFileSuite,
2914 setGlobs,
2915@@ -89,4 +90,5 @@
2916
2917 def test_suite():
2918 return build_test_suite(
2919- here, special, setUp=lambda test: setUp(test, future=True))
2920+ here, special, setUp=lambda test: setUp(test, future=True),
2921+ pageTestsSetUp=lambda test: setUpGlobs(test, future=True))
2922
2923=== modified file 'lib/lp/services/testing/__init__.py'
2924--- lib/lp/services/testing/__init__.py 2018-05-06 08:52:34 +0000
2925+++ lib/lp/services/testing/__init__.py 2018-05-13 10:39:08 +0000
2926@@ -64,7 +64,8 @@
2927
2928
2929 def build_test_suite(base_dir, special_tests={},
2930- layer=None, setUp=setUp, tearDown=tearDown):
2931+ layer=None, setUp=setUp, tearDown=tearDown,
2932+ pageTestsSetUp=None):
2933 """Build a test suite from a directory containing test files.
2934
2935 The parent's 'stories' subdirectory will be checked for pagetests and
2936@@ -81,9 +82,14 @@
2937 :param layer: The layer in which to run the tests.
2938 """
2939 from lp.testing.layers import DatabaseFunctionalLayer
2940- from lp.testing.pages import PageTestSuite
2941+ from lp.testing.pages import (
2942+ PageTestSuite,
2943+ setUpGlobs,
2944+ )
2945 if layer is None:
2946 layer = DatabaseFunctionalLayer
2947+ if pageTestsSetUp is None:
2948+ pageTestsSetUp = setUpGlobs
2949
2950 suite = unittest.TestSuite()
2951
2952@@ -94,14 +100,16 @@
2953 stories_dir = os.path.join(os.path.pardir, 'stories')
2954 stories_path = os.path.join(base_dir, stories_dir)
2955 if os.path.exists(stories_path):
2956- suite.addTest(PageTestSuite(stories_dir, package))
2957+ suite.addTest(PageTestSuite(
2958+ stories_dir, package, setUp=pageTestsSetUp))
2959 for story_entry in scandir.scandir(stories_path):
2960 if not story_entry.is_dir():
2961 continue
2962 story_path = os.path.join(stories_dir, story_entry.name)
2963 if story_path in special_tests:
2964 continue
2965- suite.addTest(PageTestSuite(story_path, package))
2966+ suite.addTest(PageTestSuite(
2967+ story_path, package, setUp=pageTestsSetUp))
2968
2969 # Add the special doctests.
2970 for key, special_suite in sorted(special_tests.items()):
2971
2972=== modified file 'lib/lp/testing/pages.py'
2973--- lib/lp/testing/pages.py 2018-04-13 20:47:03 +0000
2974+++ lib/lp/testing/pages.py 2018-05-13 10:39:08 +0000
2975@@ -782,7 +782,10 @@
2976 setSecurityPolicy(old_policy)
2977
2978
2979-def setUpGlobs(test):
2980+# XXX cjwatson 2018-05-13: Once all doctests are made safe for the standard
2981+# __future__ imports, the `future=True` behaviour should become
2982+# unconditional.
2983+def setUpGlobs(test, future=False):
2984 test.globs['transaction'] = transaction
2985 test.globs['http'] = UnstickyCookieHTTPCaller()
2986 test.globs['webservice'] = LaunchpadWebServiceCaller(
2987@@ -840,6 +843,12 @@
2988 test.globs['PageTestLayer'] = PageTestLayer
2989 test.globs['stop'] = stop
2990
2991+ if future:
2992+ import __future__
2993+ for future_item in (
2994+ 'absolute_import', 'print_function', 'unicode_literals'):
2995+ test.globs[future_item] = getattr(__future__, future_item)
2996+
2997
2998 # This function name doesn't follow our standard naming conventions,
2999 # but does follow the convention of the other doctest related *Suite()