Merge ~cjwatson/launchpad:doctest-comments-in-narrative into launchpad:master
- Git
- lp:~cjwatson/launchpad
- doctest-comments-in-narrative
- Merge into master
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 3e6c6ffe18fa18ad1203550e0ed00a39c7fefeaa |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~cjwatson/launchpad:doctest-comments-in-narrative |
Merge into: | launchpad:master |
Diff against target: |
865 lines (+150/-83) 45 files modified
lib/lp/answers/stories/distribution-package-answer-contact.txt (+3/-1) lib/lp/answers/stories/faq-browse-and-search.txt (+2/-1) lib/lp/answers/stories/question-browse-and-search.txt (+4/-2) lib/lp/answers/stories/question-search-multiple-languages.txt (+2/-1) lib/lp/app/doc/menus.txt (+3/-1) lib/lp/app/stories/basics/xx-opstats.txt (+3/-1) lib/lp/blueprints/stories/blueprints/xx-editing.txt (+0/-1) lib/lp/bugs/browser/tests/bugtask-edit-views.txt (+3/-3) lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt (+4/-3) lib/lp/bugs/doc/externalbugtracker-bugzilla.txt (+3/-1) lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt (+3/-2) lib/lp/bugs/stories/bugs/bug-add-subscriber.txt (+2/-1) lib/lp/bugs/stories/bugs/xx-bug-create-question.txt (+2/-1) lib/lp/bugs/stories/bugtask-searches/xx-distribution-statistics-portlet.txt (+3/-2) lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt (+3/-2) lib/lp/bugs/tests/bugs-emailinterface.txt (+1/-1) lib/lp/code/doc/branch-merge-proposal-notifications.txt (+12/-5) lib/lp/code/doc/codeimport-job.txt (+3/-2) lib/lp/code/doc/codereviewcomment.txt (+2/-1) lib/lp/code/stories/branches/package-branch-merges-with-product-branches.txt (+4/-2) lib/lp/code/stories/branches/xx-branch-listings.txt (+3/-1) lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt (+3/-1) lib/lp/code/stories/branches/xx-claiming-team-code-reviews.txt (+2/-1) lib/lp/code/stories/branches/xx-code-review-comments.txt (+2/-2) lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt (+3/-1) lib/lp/code/stories/codeimport/xx-codeimport-results.txt (+3/-2) lib/lp/code/stories/feeds/xx-revision-atom.txt (+4/-2) lib/lp/registry/doc/private-team-roles.txt (+6/-3) lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt (+3/-1) lib/lp/registry/stories/distroseries/xx-distroseries-index.txt (+3/-2) lib/lp/registry/stories/team/xx-team-membership.txt (+4/-2) lib/lp/registry/stories/webservice/xx-private-team.txt (+2/-1) lib/lp/services/database/doc/multitablecopy.txt (+5/-4) lib/lp/services/mail/doc/sending-mail.txt (+3/-1) lib/lp/soyuz/doc/gina.txt (+10/-3) lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt (+2/-1) lib/lp/translations/doc/poexport-request.txt (+2/-1) lib/lp/translations/doc/poimport.txt (+7/-5) lib/lp/translations/stories/standalone/xx-person-editlanguages.txt (+4/-2) lib/lp/translations/stories/standalone/xx-pofile-translate-performance.txt (+2/-1) lib/lp/translations/stories/standalone/xx-product-export.txt (+5/-3) lib/lp/translations/stories/translationgroups/xx-translationgroups.txt (+1/-0) lib/lp/translations/utilities/doc/gettext_po_parser.txt (+5/-5) lib/lp/translations/utilities/doc/gettext_po_parser_context.txt (+2/-2) lib/lp/translations/utilities/doc/kde-po-file-format.txt (+2/-2) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ioana Lasc (community) | Approve | ||
Review via email: mp+407010@code.launchpad.net |
Commit message
Move doctest comments to narrative
Description of the change
Pacifies a number of lp-lint-doctest errors.
To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/lib/lp/answers/stories/distribution-package-answer-contact.txt b/lib/lp/answers/stories/distribution-package-answer-contact.txt |
2 | index 048e495..2aa64a0 100644 |
3 | --- a/lib/lp/answers/stories/distribution-package-answer-contact.txt |
4 | +++ b/lib/lp/answers/stories/distribution-package-answer-contact.txt |
5 | @@ -13,7 +13,9 @@ contacts as well as the distribution answer contacts. |
6 | >>> from lp.services.worlddata.interfaces.language import ILanguageSet |
7 | >>> login('test@canonical.com') |
8 | >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu') |
9 | - >>> # Answer contacts must speak a language |
10 | + |
11 | +Answer contacts must speak a language. |
12 | + |
13 | >>> user = getUtility(ILaunchBag).user |
14 | >>> user.addLanguage(getUtility(ILanguageSet)['en']) |
15 | >>> ubuntu.addAnswerContact(user, user) |
16 | diff --git a/lib/lp/answers/stories/faq-browse-and-search.txt b/lib/lp/answers/stories/faq-browse-and-search.txt |
17 | index 555aa33..fab6403 100644 |
18 | --- a/lib/lp/answers/stories/faq-browse-and-search.txt |
19 | +++ b/lib/lp/answers/stories/faq-browse-and-search.txt |
20 | @@ -12,7 +12,8 @@ page on Launchpad to try to get some help. She clicks the |
21 | find her problem there (surely playing a DVD must be common thing to do |
22 | with a computer these days). |
23 | |
24 | - >>> # Kubuntu must enable answers to access questions. |
25 | +Kubuntu must enable answers to access questions. |
26 | + |
27 | >>> from zope.component import getUtility |
28 | >>> from lp.app.enums import ServiceUsage |
29 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
30 | diff --git a/lib/lp/answers/stories/question-browse-and-search.txt b/lib/lp/answers/stories/question-browse-and-search.txt |
31 | index ba3b8f9..cbbfaec 100644 |
32 | --- a/lib/lp/answers/stories/question-browse-and-search.txt |
33 | +++ b/lib/lp/answers/stories/question-browse-and-search.txt |
34 | @@ -17,7 +17,8 @@ Average Joe has recently installed Kubuntu. He has a problem with his |
35 | system and goes to the Kubuntu's support page in Launchpad to see if |
36 | somebody had a similar problem. |
37 | |
38 | - >>> # Kubuntu must enable answers to access questions. |
39 | +Kubuntu must enable answers to access questions. |
40 | + |
41 | >>> from zope.component import getUtility |
42 | >>> from lp.app.enums import ServiceUsage |
43 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
44 | @@ -429,7 +430,8 @@ The exact question they were searching for is displayed! |
45 | If the user didn't make any questions on the product, a message |
46 | informing them of this fact is displayed. |
47 | |
48 | - >>> # gnmomebaker must enable answers to access questions. |
49 | +gnomebaker must enable answers to access questions. |
50 | + |
51 | >>> from lp.registry.interfaces.product import IProductSet |
52 | >>> login('admin@canonical.com') |
53 | >>> getUtility(IProductSet)['gnomebaker'].answers_usage = ( |
54 | diff --git a/lib/lp/answers/stories/question-search-multiple-languages.txt b/lib/lp/answers/stories/question-search-multiple-languages.txt |
55 | index 5188300..4d13a57 100644 |
56 | --- a/lib/lp/answers/stories/question-search-multiple-languages.txt |
57 | +++ b/lib/lp/answers/stories/question-search-multiple-languages.txt |
58 | @@ -93,7 +93,8 @@ Arabic and is written from right-to-left. |
59 | When the project has no questions to search, we do not show the |
60 | language controls. |
61 | |
62 | - >>> # Kubuntu must enable answers to access questions. |
63 | +Kubuntu must enable answers to access questions. |
64 | + |
65 | >>> from zope.component import getUtility |
66 | >>> from lp.app.enums import ServiceUsage |
67 | >>> from lp.registry.interfaces.distribution import IDistributionSet |
68 | diff --git a/lib/lp/app/doc/menus.txt b/lib/lp/app/doc/menus.txt |
69 | index 69f1036..8cf0d3a 100644 |
70 | --- a/lib/lp/app/doc/menus.txt |
71 | +++ b/lib/lp/app/doc/menus.txt |
72 | @@ -1064,7 +1064,9 @@ If we try a navigation menu lookup on an object without a canonical url |
73 | or a navigation menu adapter, then no menu will be returned, and no |
74 | error will be raised by the template. |
75 | |
76 | - >>> # Needed so the IPathAdapter can be applied to this view. |
77 | +``@implementer(Interface)`` is needed so the ``IPathAdapter`` can be applied |
78 | +to this view. |
79 | + |
80 | >>> @implementer(Interface) |
81 | ... class MenulessView(LaunchpadView): |
82 | ... __launchpad_facetname__ = 'cookery' |
83 | diff --git a/lib/lp/app/stories/basics/xx-opstats.txt b/lib/lp/app/stories/basics/xx-opstats.txt |
84 | index 558131b..8a991db 100644 |
85 | --- a/lib/lp/app/stories/basics/xx-opstats.txt |
86 | +++ b/lib/lp/app/stories/basics/xx-opstats.txt |
87 | @@ -248,7 +248,9 @@ also return a timeout Fault: |
88 | ... """)) |
89 | >>> output.getStatus() |
90 | 503 |
91 | - >>> # Reset the timeouts so +opstat doesn't die. |
92 | + |
93 | +Reset the timeouts so +opstats doesn't die. |
94 | + |
95 | >>> base_test_data = config.pop('base_test_data') |
96 | >>> report() |
97 | 503s: 1 |
98 | diff --git a/lib/lp/blueprints/stories/blueprints/xx-editing.txt b/lib/lp/blueprints/stories/blueprints/xx-editing.txt |
99 | index dda782d..cf0a920 100644 |
100 | --- a/lib/lp/blueprints/stories/blueprints/xx-editing.txt |
101 | +++ b/lib/lp/blueprints/stories/blueprints/xx-editing.txt |
102 | @@ -89,7 +89,6 @@ implementation status, estimated man days etc) of the specification. |
103 | >>> back_link.url |
104 | 'http://blueprints.launchpad.test/firefox/+spec/extension-manager-upgrades' |
105 | >>> browser.getControl('Definition Status').value = ['DRAFT'] |
106 | - >>> # browser.getControl('Estimated Developer Days').value = '5' |
107 | >>> browser.getControl('Implementation Status').value = ['SLOW'] |
108 | >>> browser.getControl('Status Whiteboard').value = 'XXX' |
109 | >>> browser.getControl('Change').click() |
110 | diff --git a/lib/lp/bugs/browser/tests/bugtask-edit-views.txt b/lib/lp/bugs/browser/tests/bugtask-edit-views.txt |
111 | index 6dfeb04..bc38836 100644 |
112 | --- a/lib/lp/bugs/browser/tests/bugtask-edit-views.txt |
113 | +++ b/lib/lp/bugs/browser/tests/bugtask-edit-views.txt |
114 | @@ -67,9 +67,9 @@ changed to the corresponding source package. |
115 | assigned to its source package 'linux-source-2.6.15' |
116 | instead. |
117 | |
118 | - >>> # The sampledata is bad -- the original thunderbird task should |
119 | - >>> # not exist, as there is no publication. Create one so we can |
120 | - >>> # set it back. |
121 | +The sampledata is bad -- the original thunderbird task should not exist, as |
122 | +there is no publication. Create one so we can set it back. |
123 | + |
124 | >>> ignored = factory.makeSourcePackagePublishingHistory( |
125 | ... distroseries= |
126 | ... ubuntu_thunderbird_task.target.distribution.currentseries, |
127 | diff --git a/lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt b/lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt |
128 | index ff7f280..b13e159 100644 |
129 | --- a/lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt |
130 | +++ b/lib/lp/bugs/doc/externalbugtracker-bugzilla-lp-plugin.txt |
131 | @@ -171,10 +171,11 @@ The BugzillaLPPlugin ExternalBugTracker, like all other |
132 | ExternalBugTrackers, has a getCurrentDBTime() method, which returns the |
133 | current time on the remote server. |
134 | |
135 | +It seems there's no way to create a UTC timestamp without monkey-patching |
136 | +the TZ environment variable. Rather than do that, we create our own datetime |
137 | +and work with that. |
138 | + |
139 | >>> from datetime import datetime |
140 | - >>> # It seems there's no way to create a UTC timestamp without |
141 | - >>> # monkey-patching the TZ environment variable. Rather than do |
142 | - >>> # that, we create our own datetime and work with that. |
143 | >>> remote_time = datetime(2008, 5, 16, 16, 53, 20) |
144 | |
145 | >>> test_transport.utc_offset = 60**2 |
146 | diff --git a/lib/lp/bugs/doc/externalbugtracker-bugzilla.txt b/lib/lp/bugs/doc/externalbugtracker-bugzilla.txt |
147 | index 7975431..b8a9226 100644 |
148 | --- a/lib/lp/bugs/doc/externalbugtracker-bugzilla.txt |
149 | +++ b/lib/lp/bugs/doc/externalbugtracker-bugzilla.txt |
150 | @@ -784,7 +784,9 @@ cases getRemoteProduct() returns None. |
151 | >>> external_bugzilla = TestBugzilla() |
152 | >>> external_bugzilla.bugzilla_bugs = {84: ( |
153 | ... 'RESOLVED', 'FIXED', 'MEDIUM', 'NORMAL')} |
154 | - >>> # Make the buglist XML not include the product tag. |
155 | + |
156 | +Make the buglist XML not include the product tag. |
157 | + |
158 | >>> external_bugzilla.bug_item_file = 'gnome_bug_li_item_noproduct.xml' |
159 | >>> with external_bugzilla.responses(): |
160 | ... external_bugzilla.initializeRemoteBugDB(['84']) |
161 | diff --git a/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt b/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt |
162 | index 4103661..4fdb9f7 100644 |
163 | --- a/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt |
164 | +++ b/lib/lp/bugs/doc/externalbugtracker-trac-lp-plugin.txt |
165 | @@ -149,9 +149,10 @@ instance returns another time zone. |
166 | ... 'http://example.com/', xmlrpc_transport=test_transport, |
167 | ... internal_xmlrpc_transport=TestInternalXMLRPCTransport()) |
168 | |
169 | +There doesn't seem to be a way to generate a UTC time stamp, without mocking |
170 | +around with the TZ environment variable. |
171 | + |
172 | >>> from datetime import datetime |
173 | - >>> # There doesn't seem to be a way to generate a UTC time stamp, |
174 | - >>> # without mocking around with the TZ environment variable. |
175 | >>> datetime.utcfromtimestamp(1207706521) |
176 | datetime.datetime(2008, 4, 9, 2, 2, 1) |
177 | |
178 | diff --git a/lib/lp/bugs/stories/bugs/bug-add-subscriber.txt b/lib/lp/bugs/stories/bugs/bug-add-subscriber.txt |
179 | index 752ccb9..bb5e0cf 100644 |
180 | --- a/lib/lp/bugs/stories/bugs/bug-add-subscriber.txt |
181 | +++ b/lib/lp/bugs/stories/bugs/bug-add-subscriber.txt |
182 | @@ -124,7 +124,8 @@ Private teams can be subscribed to bugs. Any logged in user can see |
183 | the private team in the subscribers list. Additionally if they are a member |
184 | of the private team they can unsubscribe the team. |
185 | |
186 | - >>> # Create a private team with Foo Bar as the owner. |
187 | +Create a private team with Foo Bar as the owner. |
188 | + |
189 | >>> from zope.component import getUtility |
190 | >>> from lp.registry.interfaces.person import IPersonSet, PersonVisibility |
191 | >>> login('foo.bar@canonical.com') |
192 | diff --git a/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt b/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt |
193 | index b094569..f9ebcda 100644 |
194 | --- a/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt |
195 | +++ b/lib/lp/bugs/stories/bugs/xx-bug-create-question.txt |
196 | @@ -177,7 +177,8 @@ browser's back button, after creating a question, they are re-shown the |
197 | form as it was. They resubmit the form, and are notified that a question |
198 | could not be created. |
199 | |
200 | - >>> # Jokosher must enable answers to access questions. |
201 | +Jokosher must enable answers to access questions. |
202 | + |
203 | >>> from zope.component import getUtility |
204 | >>> from lp.app.enums import ServiceUsage |
205 | >>> from lp.registry.interfaces.product import IProductSet |
206 | diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-distribution-statistics-portlet.txt b/lib/lp/bugs/stories/bugtask-searches/xx-distribution-statistics-portlet.txt |
207 | index 628d87d..4d20e84 100644 |
208 | --- a/lib/lp/bugs/stories/bugtask-searches/xx-distribution-statistics-portlet.txt |
209 | +++ b/lib/lp/bugs/stories/bugtask-searches/xx-distribution-statistics-portlet.txt |
210 | @@ -5,12 +5,13 @@ will be filtered to show just the bugs counted by that statistic. |
211 | This document demonstrates the correct functioning of the various |
212 | statistics links. |
213 | |
214 | -Viewing critical bugs as Sample Person: |
215 | +Debian must enable the Launchpad bug tracker to access bugs. |
216 | |
217 | - >>> # Debian must enable the Launchpad bug tracker to access bugs. |
218 | >>> from lp.testing.service_usage_helpers import set_service_usage |
219 | >>> set_service_usage('debian', bug_tracking_usage='LAUNCHPAD') |
220 | |
221 | +Viewing critical bugs as Sample Person: |
222 | + |
223 | >>> print(http(br""" |
224 | ... GET /debian/+bugs?field.status%3Alist=New&field.status%3Alist=Confirmed&field.importance%3Alist=Critical&search=Search HTTP/1.1 |
225 | ... Authorization: Basic dGVzdEBjYW5vbmljYWwuY29tOnRlc3Q= |
226 | diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt b/lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt |
227 | index 07c5522..0e4e7af 100644 |
228 | --- a/lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt |
229 | +++ b/lib/lp/bugs/stories/bugtask-searches/xx-listing-basics.txt |
230 | @@ -17,12 +17,13 @@ project. Bugs in the Firefox product are displayed. |
231 | 1 Firefox does not support SVG |
232 | Mozilla Firefox Low New |
233 | |
234 | -Bug listings default to open bugtasks: |
235 | +Debian must enable the Launchpad bug tracker to access bugs. |
236 | |
237 | - >>> # Debian must enable the Launchpad bug tracker to access bugs. |
238 | >>> from lp.testing.service_usage_helpers import set_service_usage |
239 | >>> set_service_usage('debian', bug_tracking_usage='LAUNCHPAD') |
240 | |
241 | +Bug listings default to open bugtasks: |
242 | + |
243 | >>> user_browser.open('http://launchpad.test/debian/+bugs') |
244 | >>> print_bugtasks(user_browser.contents) |
245 | 3 Bug Title Test mozilla-firefox (Debian) Unknown New |
246 | diff --git a/lib/lp/bugs/tests/bugs-emailinterface.txt b/lib/lp/bugs/tests/bugs-emailinterface.txt |
247 | index 9927229..b3e2402 100644 |
248 | --- a/lib/lp/bugs/tests/bugs-emailinterface.txt |
249 | +++ b/lib/lp/bugs/tests/bugs-emailinterface.txt |
250 | @@ -2379,7 +2379,7 @@ transformed to be a bit more readable as a plain text document. |
251 | ... Some Text. [[Macro()]] |
252 | ... Don't push the [#boom red button]! |
253 | ... See you in {{{#launchpad}}}. |
254 | - ... """ |
255 | + ... """ # noqa |
256 | >>> print(reformat_wiki_text(wiki_text)) |
257 | = Sample Wiki Text = |
258 | Some Text. |
259 | diff --git a/lib/lp/code/doc/branch-merge-proposal-notifications.txt b/lib/lp/code/doc/branch-merge-proposal-notifications.txt |
260 | index e7134c2..8ee0a56 100644 |
261 | --- a/lib/lp/code/doc/branch-merge-proposal-notifications.txt |
262 | +++ b/lib/lp/code/doc/branch-merge-proposal-notifications.txt |
263 | @@ -95,22 +95,27 @@ Email |
264 | Jobs for notifications are automagically generated when the merge proposal |
265 | is created. When those jobs are run, the email is sent from the registrant. |
266 | |
267 | - >>> #clear any existing notifications |
268 | >>> source_branch = bmp.source_branch |
269 | >>> factory.makeRevisionsForBranch(source_branch, count=1) |
270 | >>> target_branch = bmp.target_branch |
271 | - >>> # Login to delete the proposal. |
272 | + |
273 | +Login to delete the proposal. |
274 | + |
275 | >>> login('admin@canonical.com') |
276 | >>> bmp.deleteProposal() |
277 | >>> notifications = pop_notifications() |
278 | >>> registrant = factory.makePerson( |
279 | ... displayname="Eric", email="eric@example.com") |
280 | - >>> # To avoid needing to access branches, pre-populate diffs. |
281 | + |
282 | +To avoid needing to access branches, pre-populate diffs. |
283 | + |
284 | >>> bmp = source_branch.addLandingTarget( |
285 | ... registrant, target_branch, needs_review=True) |
286 | >>> previewdiff = factory.makePreviewDiff(merge_proposal=bmp) |
287 | >>> transaction.commit() |
288 | - >>> # Fake the update preview diff as done. |
289 | + |
290 | +Fake the update preview diff as done. |
291 | + |
292 | >>> bmp.next_preview_diff_job.start() |
293 | >>> bmp.next_preview_diff_job.complete() |
294 | >>> [job] = list(getUtility(IBranchMergeProposalJobSource).iterReady()) |
295 | @@ -169,7 +174,9 @@ in the email. |
296 | ... review_requests=reviewers, needs_review=True) |
297 | >>> previewdiff = factory.makePreviewDiff(merge_proposal=bmp) |
298 | >>> transaction.commit() |
299 | - >>> # Fake the update preview diff as done. |
300 | + |
301 | +Fake the update preview diff as done. |
302 | + |
303 | >>> bmp.next_preview_diff_job.start() |
304 | >>> bmp.next_preview_diff_job.complete() |
305 | >>> [job] = list(getUtility(IBranchMergeProposalJobSource).iterReady()) |
306 | diff --git a/lib/lp/code/doc/codeimport-job.txt b/lib/lp/code/doc/codeimport-job.txt |
307 | index e28e6d8..1ce112d 100644 |
308 | --- a/lib/lp/code/doc/codeimport-job.txt |
309 | +++ b/lib/lp/code/doc/codeimport-job.txt |
310 | @@ -189,8 +189,9 @@ possible. |
311 | >>> from pytz import UTC |
312 | >>> pending_job = reviewed_import.import_job |
313 | >>> future_date = datetime(2100, 1, 1, tzinfo=UTC) |
314 | - >>> # ICodeImportJob does not expose date_due, |
315 | - >>> # so we must use removeSecurityProxy. |
316 | + |
317 | +ICodeImportJob does not expose date_due, so we must use removeSecurityProxy. |
318 | + |
319 | >>> removeSecurityProxy(pending_job).date_due = future_date |
320 | >>> new_events = NewEvents() |
321 | |
322 | diff --git a/lib/lp/code/doc/codereviewcomment.txt b/lib/lp/code/doc/codereviewcomment.txt |
323 | index 263f73e..f12bcdf 100644 |
324 | --- a/lib/lp/code/doc/codereviewcomment.txt |
325 | +++ b/lib/lp/code/doc/codereviewcomment.txt |
326 | @@ -49,7 +49,8 @@ Comments can be marked as replies to particular comments. |
327 | When comments are added, a job is created to send the emails to the |
328 | subscribers of the merge proposal. |
329 | |
330 | - >>> # Needed for now to make the iterReady show the jobs. |
331 | +Needed for now to make the iterReady show the jobs. |
332 | + |
333 | >>> factory.makeRevisionsForBranch(merge_proposal.source_branch) |
334 | >>> factory.makeRevisionsForBranch(merge_proposal.target_branch) |
335 | >>> from lp.code.tests.helpers import mark_all_merge_proposal_jobs_done |
336 | diff --git a/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.txt b/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.txt |
337 | index 9dfe4e0..f676238 100644 |
338 | --- a/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.txt |
339 | +++ b/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.txt |
340 | @@ -13,8 +13,10 @@ and vice versa. |
341 | >>> b1_name = b1.unique_name |
342 | >>> b2_url = canonical_url(b2) |
343 | >>> b2_name = b2.unique_name |
344 | - >>> # XXX TimPenhey 2009-05-15 bug=376851 |
345 | - >>> # Need more than one package and product branch to show links. |
346 | + |
347 | +XXX TimPenhey 2009-05-15 bug=376851 |
348 | +Need more than one package and product branch to show links. |
349 | + |
350 | >>> ignored = factory.makePackageBranch(sourcepackage=b1.sourcepackage) |
351 | >>> ignored = factory.makeProductBranch(product=b1.product) |
352 | >>> logout() |
353 | diff --git a/lib/lp/code/stories/branches/xx-branch-listings.txt b/lib/lp/code/stories/branches/xx-branch-listings.txt |
354 | index 1df95ae..7c49fba 100644 |
355 | --- a/lib/lp/code/stories/branches/xx-branch-listings.txt |
356 | +++ b/lib/lp/code/stories/branches/xx-branch-listings.txt |
357 | @@ -388,7 +388,9 @@ both the series link in the first column with the branch unique name. |
358 | |
359 | >>> browser.open('http://code.launchpad.test/gnome-terminal') |
360 | >>> table = find_tag_by_id(browser.contents, 'branchtable') |
361 | - >>> # The development focus is always first. |
362 | + |
363 | +The development focus is always first. |
364 | + |
365 | >>> row = table.tbody.find_all('tr')[0] |
366 | >>> cols = row.find_all('td') |
367 | >>> print(extract_text(cols[0])) |
368 | diff --git a/lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt b/lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt |
369 | index 6182e73..65172c7 100644 |
370 | --- a/lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt |
371 | +++ b/lib/lp/code/stories/branches/xx-branchmergeproposal-listings.txt |
372 | @@ -39,7 +39,9 @@ Make two proposals for bob, one needing review, and one approved. |
373 | ... owner=bob, product=fooix, name='review') |
374 | >>> proposal = branch.addLandingTarget(bob, trunk) |
375 | >>> proposal.requestReview() |
376 | - >>> # Ensure the date_created is later to ensure stable ordering. |
377 | + |
378 | +Ensure the date_created is later to ensure stable ordering. |
379 | + |
380 | >>> from zope.security.proxy import removeSecurityProxy |
381 | >>> from datetime import timedelta |
382 | >>> removeSecurityProxy(proposal).date_created += timedelta(1) |
383 | diff --git a/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.txt b/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.txt |
384 | index 41f91b3..3e63b18 100644 |
385 | --- a/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.txt |
386 | +++ b/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.txt |
387 | @@ -5,7 +5,8 @@ When a team has been requested to review a merge proposal, any member of that |
388 | team can claim that review. This can be done by clicking on the "[Review]" |
389 | link shown in the reviewer table for the team. |
390 | |
391 | - >>> # Logging in as an admin helps with setting things up. |
392 | +Logging in as an admin helps with setting things up. |
393 | + |
394 | >>> login('admin@canonical.com') |
395 | >>> eric = factory.makePerson( |
396 | ... name="eric", email="eric@example.com", |
397 | diff --git a/lib/lp/code/stories/branches/xx-code-review-comments.txt b/lib/lp/code/stories/branches/xx-code-review-comments.txt |
398 | index d0575b0..9cc4178 100644 |
399 | --- a/lib/lp/code/stories/branches/xx-code-review-comments.txt |
400 | +++ b/lib/lp/code/stories/branches/xx-code-review-comments.txt |
401 | @@ -1,9 +1,9 @@ |
402 | Code Review Comments |
403 | ==================== |
404 | |
405 | -Set up required objects |
406 | +Set up required objects. We need to be admin to add a landing target to a |
407 | +random branch. |
408 | |
409 | - >>> # We need to be admin to add a landing target to a random branch |
410 | >>> login('foo.bar@canonical.com') |
411 | >>> eric = factory.makePerson( |
412 | ... name="eric", email="eric@example.com", |
413 | diff --git a/lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt b/lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt |
414 | index c071545..1b8a2bc 100644 |
415 | --- a/lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt |
416 | +++ b/lib/lp/code/stories/branches/xx-person-portlet-teambranches.txt |
417 | @@ -12,7 +12,9 @@ and only teams that have branches are shown. |
418 | ... name="eric", email="eric@example.com", |
419 | ... displayname="Eric the Viking") |
420 | >>> vikings = factory.makeTeam(name="vikings", owner=eric) |
421 | - >>> # Also give vikings a cool icon. |
422 | + |
423 | +Also give vikings a cool icon. |
424 | + |
425 | >>> icon = factory.makeLibraryFileAlias( |
426 | ... filename='vikings.png', content_type='image/png') |
427 | >>> from lp.testing import run_with_login |
428 | diff --git a/lib/lp/code/stories/codeimport/xx-codeimport-results.txt b/lib/lp/code/stories/codeimport/xx-codeimport-results.txt |
429 | index e78f26c..0324baf 100644 |
430 | --- a/lib/lp/code/stories/codeimport/xx-codeimport-results.txt |
431 | +++ b/lib/lp/code/stories/codeimport/xx-codeimport-results.txt |
432 | @@ -51,8 +51,9 @@ Each of the lines is prefixed with a tick if the result status was |
433 | success, or a cross if the status was a failure. The title of the image |
434 | is the text of the failure or success type. |
435 | |
436 | - >>> # The ordering here is dependant on the order the status values |
437 | - >>> # are declared in the enumeration. |
438 | +The ordering here is dependent on the order the status values are declared |
439 | +in the enumeration. |
440 | + |
441 | >>> for img in import_results.find_all('img'): |
442 | ... print(img) |
443 | <img src="/@@/no" title="Unsupported feature"/> |
444 | diff --git a/lib/lp/code/stories/feeds/xx-revision-atom.txt b/lib/lp/code/stories/feeds/xx-revision-atom.txt |
445 | index 52b29f2..179a8eb 100644 |
446 | --- a/lib/lp/code/stories/feeds/xx-revision-atom.txt |
447 | +++ b/lib/lp/code/stories/feeds/xx-revision-atom.txt |
448 | @@ -16,8 +16,10 @@ Create some specific branches to use for this test |
449 | >>> from lp.testing import time_counter |
450 | >>> from datetime import datetime, timedelta |
451 | >>> import pytz |
452 | - >>> # Since the feed only shows revisions from the last 30 days, we |
453 | - >>> # need recent revisions. |
454 | + |
455 | +Since the feed only shows revisions from the last 30 days, we need recent |
456 | +revisions. |
457 | + |
458 | >>> initial_revision_date = datetime.now(pytz.UTC) - timedelta(days=10) |
459 | >>> date_generator = time_counter( |
460 | ... initial_revision_date, timedelta(days=1)) |
461 | diff --git a/lib/lp/registry/doc/private-team-roles.txt b/lib/lp/registry/doc/private-team-roles.txt |
462 | index 6919c9d..0595e4c 100644 |
463 | --- a/lib/lp/registry/doc/private-team-roles.txt |
464 | +++ b/lib/lp/registry/doc/private-team-roles.txt |
465 | @@ -10,7 +10,8 @@ Bugs |
466 | Bug subscriptions |
467 | ----------------- |
468 | |
469 | - >>> # Create the necessary teams. |
470 | +Create the necessary teams. |
471 | + |
472 | >>> team_owner = factory.makePerson(name='team-owner') |
473 | >>> from lp.registry.interfaces.person import ( |
474 | ... IPersonSet, |
475 | @@ -141,7 +142,8 @@ Private teams can be subscribed to private PPAs. |
476 | ... owner=team_owner, |
477 | ... visibility=PersonVisibility.PRIVATE) |
478 | |
479 | - >>> # We must login as the archive owner to add the subscription. |
480 | +We must login as the archive owner to add the subscription. |
481 | + |
482 | >>> ignored = login_person(team_owner) |
483 | >>> subscription = private_archive.newSubscription( |
484 | ... subscriber=another_priv_team, |
485 | @@ -206,7 +208,8 @@ Maintainer/Owner |
486 | |
487 | A public team and a private team can be a project owner. |
488 | |
489 | - >>> # The registrant must be specified or it will default to the owner. |
490 | +The registrant must be specified or it will default to the owner. |
491 | + |
492 | >>> product = factory.makeProduct(registrant=admin_user) |
493 | >>> product.owner = public_team |
494 | >>> product.owner = priv_team |
495 | diff --git a/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt b/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt |
496 | index f288178..bdeeb63 100644 |
497 | --- a/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt |
498 | +++ b/lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.txt |
499 | @@ -132,7 +132,9 @@ pending mirrors have never been probed. |
500 | zope.security.interfaces.Unauthorized: ... |
501 | |
502 | >>> browser = setupBrowser(auth='Basic karl@canonical.com:test') |
503 | - >>> # Register an unreviewed archive mirror. |
504 | + |
505 | +Register an unreviewed archive mirror. |
506 | + |
507 | >>> browser.open('http://launchpad.test/ubuntu/+newmirror') |
508 | >>> browser.getControl( |
509 | ... name='field.display_name').value = 'Kabul LUG mirror' |
510 | diff --git a/lib/lp/registry/stories/distroseries/xx-distroseries-index.txt b/lib/lp/registry/stories/distroseries/xx-distroseries-index.txt |
511 | index f5eaa6f..5a3af54 100644 |
512 | --- a/lib/lp/registry/stories/distroseries/xx-distroseries-index.txt |
513 | +++ b/lib/lp/registry/stories/distroseries/xx-distroseries-index.txt |
514 | @@ -129,8 +129,9 @@ Upstream packaging portlet |
515 | The distroseries page contains a portlet with information on the |
516 | upstream packaging. |
517 | |
518 | - >>> # Note that warty's sourcecount is stale in sample data |
519 | - >>> # which causes -2 need linking. |
520 | +Note that warty's sourcecount is stale in sample data which causes -2 need |
521 | +linking. |
522 | + |
523 | >>> anon_browser.open('http://launchpad.test/ubuntu/warty') |
524 | >>> print(extract_text( |
525 | ... find_tag_by_id(anon_browser.contents, 'series-packaging'))) |
526 | diff --git a/lib/lp/registry/stories/team/xx-team-membership.txt b/lib/lp/registry/stories/team/xx-team-membership.txt |
527 | index a2d7fb3..ccab69b 100644 |
528 | --- a/lib/lp/registry/stories/team/xx-team-membership.txt |
529 | +++ b/lib/lp/registry/stories/team/xx-team-membership.txt |
530 | @@ -106,8 +106,10 @@ pre-populated with the last comment. |
531 | |
532 | >>> url = '/~ubuntu-team/+member/kamion' |
533 | >>> browser.getLink(url=url).click() |
534 | - >>> # Do not use 'print' for the following test as it will eliminate potential |
535 | - >>> # leading and trailing whitespace, which we don't want. |
536 | + |
537 | +Do not use 'print' for the following test as it will eliminate potential |
538 | +leading and trailing whitespace, which we don't want. |
539 | + |
540 | >>> browser.getControl(name='comment').value |
541 | 'Arfie' |
542 | |
543 | diff --git a/lib/lp/registry/stories/webservice/xx-private-team.txt b/lib/lp/registry/stories/webservice/xx-private-team.txt |
544 | index 05b9a89..1dbc817 100644 |
545 | --- a/lib/lp/registry/stories/webservice/xx-private-team.txt |
546 | +++ b/lib/lp/registry/stories/webservice/xx-private-team.txt |
547 | @@ -84,7 +84,8 @@ Changing team visibility |
548 | New teams when created have public visibility. That attribute can be |
549 | changed by admins and commercial admins but not by regular users. |
550 | |
551 | - >>> # Create a webservice object for commercial-admins. |
552 | +Create a webservice object for commercial-admins. |
553 | + |
554 | >>> from zope.component import getUtility |
555 | >>> from lp.testing import ANONYMOUS, login, logout |
556 | >>> from lp.testing.pages import webservice_for_person |
557 | diff --git a/lib/lp/services/database/doc/multitablecopy.txt b/lib/lp/services/database/doc/multitablecopy.txt |
558 | index 074c942..618ebd7 100644 |
559 | --- a/lib/lp/services/database/doc/multitablecopy.txt |
560 | +++ b/lib/lp/services/database/doc/multitablecopy.txt |
561 | @@ -9,7 +9,8 @@ may be interlinked through foreign keys. |
562 | >>> from lp.services.database.multitablecopy import MultiTableCopy |
563 | >>> from lp.services.database.sqlbase import cursor |
564 | |
565 | - >>> # Keep track of tables we'll want to clean up later |
566 | +Keep track of tables we'll want to clean up later. |
567 | + |
568 | >>> tables_to_clean_up = [] |
569 | |
570 | |
571 | @@ -409,7 +410,8 @@ This time we run to completion without problems. |
572 | 112 lots |
573 | 114 lots |
574 | |
575 | - >>> # To keep things simple, we erase the high values again: |
576 | +To keep things simple, we erase the high values again: |
577 | + |
578 | >>> cur.execute("DELETE FROM numeric WHERE n > 100") |
579 | >>> cur.execute(""" |
580 | ... DELETE FROM textual WHERE NOT EXISTS ( |
581 | @@ -659,5 +661,4 @@ The callbacks are called only while pouring, once per batch. |
582 | Cleanup |
583 | ------- |
584 | |
585 | - >>> #postgresql.drop_tables(cursor(), tables_to_clean_up) |
586 | - |
587 | + >>> postgresql.drop_tables(cursor(), tables_to_clean_up) |
588 | diff --git a/lib/lp/services/mail/doc/sending-mail.txt b/lib/lp/services/mail/doc/sending-mail.txt |
589 | index ad7e235..de0483f 100644 |
590 | --- a/lib/lp/services/mail/doc/sending-mail.txt |
591 | +++ b/lib/lp/services/mail/doc/sending-mail.txt |
592 | @@ -29,7 +29,9 @@ Now let's look at the sent email: |
593 | 'Subject' |
594 | >>> print(six.ensure_text(msg.get_payload(decode=True))) |
595 | Content |
596 | - >>> # Make sure bulk headers are set for vacation programs |
597 | + |
598 | +Make sure bulk headers are set for vacation programs. |
599 | + |
600 | >>> msg['Precedence'] |
601 | 'bulk' |
602 | |
603 | diff --git a/lib/lp/soyuz/doc/gina.txt b/lib/lp/soyuz/doc/gina.txt |
604 | index f342cf3..ad2b8fa 100644 |
605 | --- a/lib/lp/soyuz/doc/gina.txt |
606 | +++ b/lib/lp/soyuz/doc/gina.txt |
607 | @@ -196,9 +196,16 @@ Testing Source Package Results |
608 | We should have more source packages in the database: |
609 | |
610 | >>> existing = 9 |
611 | - >>> hc = 13 - 2 # 2 packages fail |
612 | - >>> bc = 9 - 3 - 2 + 1 # 3 packages are the same as in hoary, 2 fail, |
613 | - ... #one that is imported forcefully (ubuntu-meta) |
614 | + |
615 | +Two packages fail. |
616 | + |
617 | + >>> hc = 13 - 2 |
618 | + |
619 | +Three packages are the same as in hoary; two fail; one is imported |
620 | +forcefully (ubuntu-meta). |
621 | + |
622 | + >>> bc = 9 - 3 - 2 + 1 |
623 | + |
624 | >>> hc + bc |
625 | 16 |
626 | >>> count = SourcePackageRelease.select().count() |
627 | diff --git a/lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt b/lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt |
628 | index 47b7b2c..6989647 100644 |
629 | --- a/lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt |
630 | +++ b/lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.txt |
631 | @@ -8,7 +8,8 @@ Activating Personal Package Archives for Private Teams |
632 | Private teams can have PPAs and the process of activation is the same |
633 | as for individuals and public teams. |
634 | |
635 | - >>> # Create a private team. |
636 | +Create a private team. |
637 | + |
638 | >>> from zope.component import getUtility |
639 | >>> from lp.registry.interfaces.person import ( |
640 | ... IPersonSet, PersonVisibility, TeamMembershipPolicy) |
641 | diff --git a/lib/lp/translations/doc/poexport-request.txt b/lib/lp/translations/doc/poexport-request.txt |
642 | index 4841cb9..ac5ed50 100644 |
643 | --- a/lib/lp/translations/doc/poexport-request.txt |
644 | +++ b/lib/lp/translations/doc/poexport-request.txt |
645 | @@ -164,7 +164,8 @@ Only the Spanish request is new, and that goes into the queue. |
646 | pmount:cs |
647 | pmount:es |
648 | |
649 | - >>> # Clean up the queue again. |
650 | +Clean up the queue again. |
651 | + |
652 | >>> for request in IStore(POExportRequest).find(POExportRequest): |
653 | ... request.destroySelf() |
654 | |
655 | diff --git a/lib/lp/translations/doc/poimport.txt b/lib/lp/translations/doc/poimport.txt |
656 | index 5b07995..8a0a109 100644 |
657 | --- a/lib/lp/translations/doc/poimport.txt |
658 | +++ b/lib/lp/translations/doc/poimport.txt |
659 | @@ -86,7 +86,7 @@ This is the file that'll get imported. |
660 | ... |
661 | ... msgid "translator-credits" |
662 | ... msgstr "" |
663 | - ... ''' % datetime.datetime.now(UTC).isoformat()) |
664 | + ... ''' % datetime.datetime.now(UTC).isoformat()) # noqa |
665 | |
666 | We sometimes saw deadlocks as POFile statistics were updated after |
667 | importing a template. The operation would read all translation messages |
668 | @@ -257,7 +257,7 @@ validation errors. |
669 | ... msgstr[1] "Bars %%d" |
670 | ... msgstr[2] "Welsh power! %%d" |
671 | ... msgstr[3] "We have four! %%d" |
672 | - ... ''' % datetime.datetime.now(UTC).isoformat()) |
673 | + ... ''' % datetime.datetime.now(UTC).isoformat()) # noqa |
674 | |
675 | This is the dbschema that controls the validation of a translation. |
676 | |
677 | @@ -439,7 +439,7 @@ For example, here's a gettext PO file with two headers. |
678 | ... |
679 | ... msgid "a" |
680 | ... msgstr "b" |
681 | - ... ''' % datetime.datetime.now(UTC).isoformat()) |
682 | + ... ''' % datetime.datetime.now(UTC).isoformat()) # noqa |
683 | >>> eo_pofile = potemplate.newPOFile('eo') |
684 | >>> warning_entry = translation_import_queue.addOrUpdateEntry( |
685 | ... 'eo.po', pofile_with_warning, False, potemplate.owner, |
686 | @@ -660,7 +660,7 @@ We'll import a POFile with 3 plural forms into this POFile: |
687 | ... msgstr[0] "First form %%d" |
688 | ... msgstr[1] "Second form %%d" |
689 | ... msgstr[2] "Third form %%d" |
690 | - ... ''' % datetime.datetime.now(UTC).isoformat()) |
691 | + ... ''' % datetime.datetime.now(UTC).isoformat()) # noqa |
692 | |
693 | We now import this POFile as this language's translation for the soure |
694 | package: |
695 | @@ -669,7 +669,9 @@ package: |
696 | ... pofile.path, pofile_with_plurals, True, person, |
697 | ... distroseries=distroseries, sourcepackagename=sourcepackagename, |
698 | ... potemplate=potemplate) |
699 | - >>> # Allow Librarian to see the change. |
700 | + |
701 | +Allow the Librarian to see the change. |
702 | + |
703 | >>> transaction.commit() |
704 | >>> entry.pofile = pofile |
705 | >>> entry.setStatus(RosettaImportStatus.APPROVED, rosetta_experts) |
706 | diff --git a/lib/lp/translations/stories/standalone/xx-person-editlanguages.txt b/lib/lp/translations/stories/standalone/xx-person-editlanguages.txt |
707 | index 6b674a7..e0e4fa8 100644 |
708 | --- a/lib/lp/translations/stories/standalone/xx-person-editlanguages.txt |
709 | +++ b/lib/lp/translations/stories/standalone/xx-person-editlanguages.txt |
710 | @@ -70,8 +70,10 @@ Joao, a Brazilian, travels to Liechtenstein for business and views the |
711 | languages page from there. |
712 | |
713 | >>> browser = setupBrowser('Basic test@canonical.com:test') |
714 | - >>> # Fake request from a Liechtenstein IP address by setting |
715 | - >>> # X-Forwarded-For in the http header, like a proxy would. |
716 | + |
717 | +Fake request from a Liechtenstein IP address by setting X-Forwarded-For in |
718 | +the http header, like a proxy would. |
719 | + |
720 | >>> browser.addHeader('X-Forwarded-For', '80.66.224.0') |
721 | >>> browser.addHeader('Accept-Language', b'pt_br, Espa\xf1ol') |
722 | >>> browser.open( |
723 | diff --git a/lib/lp/translations/stories/standalone/xx-pofile-translate-performance.txt b/lib/lp/translations/stories/standalone/xx-pofile-translate-performance.txt |
724 | index 5262d99..35a5fdc 100644 |
725 | --- a/lib/lp/translations/stories/standalone/xx-pofile-translate-performance.txt |
726 | +++ b/lib/lp/translations/stories/standalone/xx-pofile-translate-performance.txt |
727 | @@ -48,5 +48,6 @@ Disable it for now. |
728 | #>>> statement_count < query_counter.count < 150 |
729 | #True |
730 | |
731 | - >>> # Cleanup. |
732 | +Cleanup. |
733 | + |
734 | >>> query_counter.unregister() |
735 | diff --git a/lib/lp/translations/stories/standalone/xx-product-export.txt b/lib/lp/translations/stories/standalone/xx-product-export.txt |
736 | index 60d4412..75eb760 100644 |
737 | --- a/lib/lp/translations/stories/standalone/xx-product-export.txt |
738 | +++ b/lib/lp/translations/stories/standalone/xx-product-export.txt |
739 | @@ -39,8 +39,9 @@ Use of Launchpad Translations |
740 | The Download link is not shown if the product does not use Launchpad |
741 | Translations. |
742 | |
743 | - # Use the DB classes directly to avoid having to setup a zope interaction |
744 | - # (i.e. login()) and bypass the security proxy. |
745 | +Use the DB classes directly to avoid having to setup a zope interaction |
746 | +(i.e. login()) and bypass the security proxy. |
747 | + |
748 | >>> from lp.app.enums import ServiceUsage |
749 | >>> from lp.registry.model.product import Product |
750 | >>> product = Product.byName('evolution') |
751 | @@ -53,7 +54,8 @@ Translations. |
752 | ... |
753 | zope.testbrowser.browser.LinkNotFoundError |
754 | |
755 | - >>> # Restore previous state for subsequent tests, and verify |
756 | +Restore previous state for subsequent tests, and verify. |
757 | + |
758 | >>> product.translations_usage = ServiceUsage.LAUNCHPAD |
759 | >>> product.sync() |
760 | >>> user_browser.open('http://translations.launchpad.test/evolution') |
761 | diff --git a/lib/lp/translations/stories/translationgroups/xx-translationgroups.txt b/lib/lp/translations/stories/translationgroups/xx-translationgroups.txt |
762 | index 96ebe8f..75d8725 100644 |
763 | --- a/lib/lp/translations/stories/translationgroups/xx-translationgroups.txt |
764 | +++ b/lib/lp/translations/stories/translationgroups/xx-translationgroups.txt |
765 | @@ -1145,6 +1145,7 @@ cannot be handled. |
766 | ... #, ycp-format |
767 | ... msgid "This program is running as process number %1." |
768 | ... msgstr "Hierdie program loop as prosesnommer %1."'''.encode('UTF-8') |
769 | + ... # noqa |
770 | |
771 | >>> upload = admin_browser.getControl(name='file') |
772 | >>> upload.add_file(BytesIO(af_file), 'application/msword', 'af.doc') |
773 | diff --git a/lib/lp/translations/utilities/doc/gettext_po_parser.txt b/lib/lp/translations/utilities/doc/gettext_po_parser.txt |
774 | index 7321806..835b05a 100644 |
775 | --- a/lib/lp/translations/utilities/doc/gettext_po_parser.txt |
776 | +++ b/lib/lp/translations/utilities/doc/gettext_po_parser.txt |
777 | @@ -305,7 +305,7 @@ Parsing a PO template: |
778 | ... #: foo/bar.c:42 |
779 | ... msgid "Foo" |
780 | ... msgstr "" |
781 | - ... """ |
782 | + ... """ # noqa |
783 | |
784 | >>> parser = POParser() |
785 | >>> translation_file = parser.parse(content) |
786 | @@ -326,7 +326,7 @@ errors occur: |
787 | ... #:foo/baz.c:42 |
788 | ... msgid "Baz" |
789 | ... msgstr "abcdef" |
790 | - ... """ |
791 | + ... """ # noqa |
792 | |
793 | >>> parser.parse(content + chunk2) |
794 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 |
795 | @@ -355,7 +355,7 @@ character. |
796 | ... #: lib/regex.c:1367 |
797 | ... msgid "Success" |
798 | ... msgstr "\xa6\xa8\xa5\\" |
799 | - ... """ |
800 | + ... """ # noqa |
801 | |
802 | >>> translation_file = parser.parse(content) |
803 | |
804 | @@ -427,7 +427,7 @@ the Content-Type field of the header. |
805 | ... #: foo/bar.c: 50 |
806 | ... msgid "view \\302\\253${version_title}\\302\\273" |
807 | ... msgstr "" |
808 | - ... """ |
809 | + ... """ # noqa |
810 | |
811 | >>> translation_file = parser.parse(content) |
812 | |
813 | @@ -545,7 +545,7 @@ Let's parse a Spanish PO file with an inverted plural formula. |
814 | ... msgid_plural "files" |
815 | ... msgstr[0] "plural translation" |
816 | ... msgstr[1] "singular translation" |
817 | - ... """ |
818 | + ... """ # noqa |
819 | |
820 | >>> parser = POParser(spanish_pluralformula) |
821 | >>> translation_file = parser.parse(content) |
822 | diff --git a/lib/lp/translations/utilities/doc/gettext_po_parser_context.txt b/lib/lp/translations/utilities/doc/gettext_po_parser_context.txt |
823 | index 5ef1c80..23929ec 100644 |
824 | --- a/lib/lp/translations/utilities/doc/gettext_po_parser_context.txt |
825 | +++ b/lib/lp/translations/utilities/doc/gettext_po_parser_context.txt |
826 | @@ -83,7 +83,7 @@ the same message in gettext, and we have to use msgctxt on one of them). |
827 | ... msgid_plural "%%d files" |
828 | ... msgstr[0] "" |
829 | ... msgstr[1] "" |
830 | - ... ''' % datetime.datetime.now(UTC).isoformat()).encode('UTF-8') |
831 | + ... ''' % datetime.datetime.now(UTC).isoformat()).encode('UTF-8') # noqa |
832 | |
833 | This file can now be correctly imported: |
834 | |
835 | @@ -197,7 +197,7 @@ We can also import POFile with context messages. |
836 | ... msgstr[0] "%%d translation" |
837 | ... msgstr[1] "%%d translationes" |
838 | ... msgstr[2] "%%d translations" |
839 | - ... ''' % datetime.datetime.now(UTC).isoformat()).encode('UTF-8') |
840 | + ... ''' % datetime.datetime.now(UTC).isoformat()).encode('UTF-8') # noqa |
841 | |
842 | Importing this file succeeds. |
843 | |
844 | diff --git a/lib/lp/translations/utilities/doc/kde-po-file-format.txt b/lib/lp/translations/utilities/doc/kde-po-file-format.txt |
845 | index 0e7a193..0f71e2b 100644 |
846 | --- a/lib/lp/translations/utilities/doc/kde-po-file-format.txt |
847 | +++ b/lib/lp/translations/utilities/doc/kde-po-file-format.txt |
848 | @@ -116,7 +116,7 @@ message is preceded with '_n: ' (space at the end of the string is important). |
849 | ... |
850 | ... msgid "_n: entry\nentries" |
851 | ... msgstr "" |
852 | - ... ''' % ISO_FORMATTED_DATE).encode('UTF-8') |
853 | + ... ''' % ISO_FORMATTED_DATE).encode('UTF-8') # noqa |
854 | |
855 | And strangely, importing this file actually works, and format is changed |
856 | to KDE PO format. |
857 | @@ -197,7 +197,7 @@ forms. They are simply newline-separated strings. |
858 | ... msgid "_n: entry\nentries" |
859 | ... msgstr "singular entry\n\nplural entries" |
860 | ... |
861 | - ... ''' % ISO_FORMATTED_DATE).encode('UTF-8') |
862 | + ... ''' % ISO_FORMATTED_DATE).encode('UTF-8') # noqa |
863 | |
864 | Importing this file succeeds, even if the number of %d printf specifications |
865 | doesn't match: this is because this is now specially handled with KDE PO |