Merge ~lgp171188/launchpad:upgrade-black-24.1.1-2024-style into launchpad:master
- Git
- lp:~lgp171188/launchpad
- upgrade-black-24.1.1-2024-style
- Merge into master
Proposed by
Guruprasad
Status: | Merged |
---|---|
Approved by: | Guruprasad |
Approved revision: | ec2bc202da54ea243fecf079f4ceae735c51ad22 |
Merge reported by: | Otto Co-Pilot |
Merged at revision: | not available |
Proposed branch: | ~lgp171188/launchpad:upgrade-black-24.1.1-2024-style |
Merge into: | launchpad:master |
Diff against target: |
8546 lines (+1884/-1889) 250 files modified
.git-blame-ignore-revs (+2/-0) .pre-commit-config.yaml (+1/-7) lib/lp/answers/browser/questiontarget.py (+3/-3) lib/lp/answers/notification.py (+9/-8) lib/lp/answers/stories/faq-edit.rst (+3/-3) lib/lp/answers/stories/project-add-question.rst (+15/-15) lib/lp/answers/stories/question-add-in-other-languages.rst (+9/-9) lib/lp/answers/stories/question-add.rst (+9/-9) lib/lp/answers/stories/question-browse-and-search.rst (+6/-6) lib/lp/answers/stories/question-edit.rst (+6/-6) lib/lp/answers/stories/question-obfuscation.rst (+3/-3) lib/lp/answers/stories/question-reject-and-change-status.rst (+3/-3) lib/lp/answers/stories/question-workflow.rst (+6/-12) lib/lp/answers/stories/this-is-a-faq.rst (+6/-6) lib/lp/app/browser/tales.py (+0/-1) lib/lp/app/widgets/project.py (+3/-3) lib/lp/archivepublisher/domination.py (+8/-6) lib/lp/archivepublisher/model/ftparchive.py (+3/-3) lib/lp/archivepublisher/tests/test_publisher.py (+9/-9) lib/lp/archiveuploader/tests/upload-karma.rst (+3/-3) lib/lp/archiveuploader/uploadprocessor.py (+0/-1) lib/lp/blueprints/stories/blueprints/xx-creation.rst (+6/-6) lib/lp/blueprints/stories/blueprints/xx-dependencies.rst (+15/-15) lib/lp/blueprints/stories/blueprints/xx-distrorelease.rst (+3/-3) lib/lp/blueprints/stories/blueprints/xx-editing.rst (+3/-3) lib/lp/blueprints/stories/blueprints/xx-non-ascii-imagemap.rst (+3/-3) lib/lp/blueprints/stories/sprints/xx-sprints.rst (+33/-33) lib/lp/blueprints/stories/standalone/xx-informational-blueprints.rst (+3/-3) lib/lp/blueprints/tests/test_specification.py (+3/-3) lib/lp/bugs/browser/bug.py (+6/-6) lib/lp/bugs/browser/buglisting.py (+15/-15) lib/lp/bugs/browser/bugsubscription.py (+6/-6) lib/lp/bugs/browser/bugtarget.py (+6/-6) lib/lp/bugs/browser/bugtracker.py (+5/-3) lib/lp/bugs/browser/structuralsubscription.py (+0/-1) lib/lp/bugs/browser/tests/bugtask-adding-views.rst (+9/-9) lib/lp/bugs/browser/tests/test_bugtask.py (+18/-18) lib/lp/bugs/doc/externalbugtracker-comment-imports.rst (+12/-12) lib/lp/bugs/doc/externalbugtracker-debbugs.rst (+6/-6) lib/lp/bugs/doc/externalbugtracker.rst (+3/-3) lib/lp/bugs/mail/newbug.py (+12/-12) lib/lp/bugs/model/tests/test_bug.py (+3/-3) lib/lp/bugs/model/tests/test_bugsummary.py (+3/-3) lib/lp/bugs/model/tests/test_bugtask.py (+0/-1) lib/lp/bugs/stories/bug-also-affects/xx-also-affects-new-upstream.rst (+12/-12) lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.rst (+33/-33) lib/lp/bugs/stories/bug-also-affects/xx-duplicate-bugwatches.rst (+3/-3) lib/lp/bugs/stories/bug-also-affects/xx-request-distribution-no-release-fix.rst (+3/-3) lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.rst (+12/-12) lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.rst (+3/-3) lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.rst (+3/-3) lib/lp/bugs/stories/bug-tags/xx-searching-for-tags.rst (+3/-3) lib/lp/bugs/stories/bugattachments/xx-bugattachments.rst (+30/-30) lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.rst (+6/-6) lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.rst (+3/-3) lib/lp/bugs/stories/bugs/xx-bug-activity.rst (+6/-6) lib/lp/bugs/stories/bugs/xx-bug-comment-attach-file.rst (+3/-3) lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.rst (+3/-3) lib/lp/bugs/stories/bugs/xx-bugs.rst (+3/-3) lib/lp/bugs/stories/bugs/xx-incomplete-bugs.rst (+3/-3) lib/lp/bugs/stories/bugs/xx-remote-bug-comments.rst (+6/-6) lib/lp/bugs/stories/bugtask-management/xx-bug-privileged-statuses.rst (+3/-3) lib/lp/bugs/stories/bugtask-management/xx-edit-email-address-bugtask.rst (+3/-3) lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.rst (+15/-15) lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.rst (+15/-15) lib/lp/bugs/stories/bugtracker/bugtrackers-index.rst (+3/-3) lib/lp/bugs/stories/bugtracker/xx-bugtracker.rst (+42/-42) lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.rst (+6/-6) lib/lp/bugs/stories/cve/xx-cve-link-xss.rst (+3/-3) lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.rst (+6/-6) lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.rst (+9/-9) lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.rst (+3/-3) lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.rst (+12/-12) lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.rst (+3/-3) lib/lp/bugs/stories/guided-filebug/xx-filebug-attachments.rst (+3/-3) lib/lp/bugs/stories/guided-filebug/xx-filebug-tags.rst (+3/-3) lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.rst (+15/-15) lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.rst (+3/-3) lib/lp/bugs/stories/guided-filebug/xx-sorting-by-relevance.rst (+6/-6) lib/lp/bugs/stories/standalone/xx-filebug-package-chooser-radio-buttons.rst (+3/-3) lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.rst (+9/-9) lib/lp/bugs/tests/test_bug.py (+6/-6) lib/lp/bugs/tests/test_bug_messages.py (+0/-2) lib/lp/bugs/tests/test_bugtaskflat_triggers.py (+6/-6) lib/lp/buildmaster/builderproxy.py (+7/-7) lib/lp/buildmaster/model/buildfarmjob.py (+3/-3) lib/lp/charms/browser/tests/test_charmrecipe.py (+60/-60) lib/lp/charms/browser/tests/test_charmrecipelisting.py (+3/-3) lib/lp/charms/tests/test_charmrecipe.py (+2/-4) lib/lp/charms/tests/test_charmrecipejob.py (+3/-3) lib/lp/code/browser/branchmergeproposal.py (+6/-5) lib/lp/code/browser/branchsubscription.py (+0/-1) lib/lp/code/browser/tests/test_branch.py (+9/-9) lib/lp/code/browser/tests/test_branchmergeproposal.py (+3/-3) lib/lp/code/browser/tests/test_branchmergeproposallisting.py (+6/-6) lib/lp/code/browser/tests/test_sourcepackagerecipe.py (+5/-5) lib/lp/code/doc/codeimport-event.rst (+3/-3) lib/lp/code/errors.py (+0/-2) lib/lp/code/mail/branch.py (+7/-7) lib/lp/code/mail/branchmergeproposal.py (+3/-3) lib/lp/code/mail/tests/test_branch.py (+9/-9) lib/lp/code/model/branchmergeproposal.py (+3/-3) lib/lp/code/model/githosting.py (+5/-3) lib/lp/code/model/gitref.py (+20/-14) lib/lp/code/model/tests/test_branchmergeproposaljobs.py (+3/-3) lib/lp/code/model/tests/test_cibuild.py (+9/-9) lib/lp/code/model/tests/test_gitrepository.py (+3/-3) lib/lp/code/model/tests/test_sourcepackagerecipe.py (+3/-3) lib/lp/code/model/tests/test_sourcepackagerecipebuild.py (+3/-3) lib/lp/code/stories/branches/package-branch-merge-proposals.rst (+3/-3) lib/lp/code/stories/branches/package-branch-merges-with-product-branches.rst (+6/-6) lib/lp/code/stories/branches/xx-branch-edit.rst (+9/-9) lib/lp/code/stories/branches/xx-branch-listings.rst (+9/-9) lib/lp/code/stories/branches/xx-branchmergeproposals.rst (+12/-12) lib/lp/code/stories/branches/xx-claiming-team-code-reviews.rst (+3/-3) lib/lp/code/stories/branches/xx-private-branch-listings.rst (+6/-6) lib/lp/code/stories/branches/xx-product-branches.rst (+3/-3) lib/lp/code/stories/codeimport/xx-admin-codeimport.rst (+18/-18) lib/lp/code/stories/codeimport/xx-create-codeimport.rst (+54/-54) lib/lp/code/vocabularies/tests/test_gitref_vocabularies.py (+12/-12) lib/lp/codehosting/bzrutils.py (+6/-6) lib/lp/codehosting/vfs/tests/test_branchfs.py (+7/-7) lib/lp/coop/answersbugs/stories/question-makebug.rst (+9/-9) lib/lp/coop/answersbugs/tests/test_doc.py (+3/-3) lib/lp/oci/browser/tests/test_ocirecipe.py (+60/-59) lib/lp/oci/model/ocirecipebuildbehaviour.py (+6/-6) lib/lp/registry/browser/person.py (+3/-3) lib/lp/registry/browser/pillar.py (+9/-9) lib/lp/registry/browser/product.py (+6/-6) lib/lp/registry/browser/tests/test_distribution_views.py (+3/-3) lib/lp/registry/browser/tests/test_distroseries.py (+6/-6) lib/lp/registry/browser/tests/test_distroseriesdifference_views.py (+3/-3) lib/lp/registry/browser/tests/test_person.py (+3/-3) lib/lp/registry/browser/tests/test_poll.py (+12/-12) lib/lp/registry/browser/tests/test_product.py (+6/-6) lib/lp/registry/browser/tests/test_productseries_views.py (+3/-3) lib/lp/registry/browser/tests/test_sourcepackage_views.py (+3/-3) lib/lp/registry/doc/productseries.rst (+3/-3) lib/lp/registry/doc/teammembership.rst (+3/-3) lib/lp/registry/mail/teammembership.py (+19/-16) lib/lp/registry/model/distribution.py (+3/-3) lib/lp/registry/model/distroseries.py (+6/-6) lib/lp/registry/model/mailinglist.py (+3/-3) lib/lp/registry/stories/announcements/xx-announcements.rst (+39/-39) lib/lp/registry/stories/distribution/xx-distribution-launchpad-usage.rst (+15/-15) lib/lp/registry/stories/distributionmirror/xx-distribution-mirrors.rst (+6/-6) lib/lp/registry/stories/gpg-coc/xx-gpg-coc.rst (+3/-3) lib/lp/registry/stories/mailinglists/hosted-email-address.rst (+3/-3) lib/lp/registry/stories/mailinglists/welcome-message.rst (+3/-3) lib/lp/registry/stories/milestone/xx-milestone-description.rst (+12/-12) lib/lp/registry/stories/person/xx-admin-person-review.rst (+6/-6) lib/lp/registry/stories/person/xx-person-edit-jabber-ids.rst (+6/-6) lib/lp/registry/stories/person/xx-person-editgpgkeys-invalid-key.rst (+6/-6) lib/lp/registry/stories/product/xx-product-add.rst (+15/-15) lib/lp/registry/stories/product/xx-product-code-trunk.rst (+3/-3) lib/lp/registry/stories/product/xx-product-edit.rst (+6/-6) lib/lp/registry/stories/productseries/xx-productseries-add-and-edit.rst (+9/-9) lib/lp/registry/stories/productseries/xx-productseries-set-branch.rst (+12/-12) lib/lp/registry/stories/project/xx-project-add-product.rst (+3/-3) lib/lp/registry/stories/project/xx-project-add.rst (+12/-12) lib/lp/registry/stories/team-polls/create-polls.rst (+27/-27) lib/lp/registry/stories/team-polls/edit-poll.rst (+12/-12) lib/lp/registry/stories/team/xx-team-claim.rst (+3/-3) lib/lp/registry/stories/team/xx-team-contactemail-xss.rst (+3/-3) lib/lp/registry/stories/team/xx-team-contactemail.rst (+3/-3) lib/lp/registry/stories/teammembership/xx-add-member.rst (+3/-3) lib/lp/registry/stories/teammembership/xx-teammembership.rst (+9/-9) lib/lp/registry/tests/test_distribution.py (+3/-3) lib/lp/registry/tests/test_distributionsourcepackage.py (+6/-6) lib/lp/registry/tests/test_distroseriesdifference.py (+3/-3) lib/lp/registry/tests/test_person.py (+6/-6) lib/lp/registry/tests/test_personmerge.py (+3/-3) lib/lp/registry/tests/test_product.py (+3/-3) lib/lp/registry/tests/test_productjob.py (+6/-6) lib/lp/registry/tests/test_sharingjob.py (+18/-18) lib/lp/registry/tests/test_ssh.py (+0/-1) lib/lp/registry/tests/test_teammembership.py (+1/-0) lib/lp/scripts/tests/test_garbo.py (+17/-19) lib/lp/services/features/browser/tests/test_feature_editor.py (+9/-9) lib/lp/services/librarianserver/web.py (+5/-3) lib/lp/services/profile/profile.py (+2/-6) lib/lp/services/signing/testing/fixture.py (+4/-6) lib/lp/services/twistedsupport/tests/test_processmonitor.py (+0/-1) lib/lp/services/webapp/tests/test_dbpolicy.py (+3/-3) lib/lp/services/webhooks/tests/test_webservice.py (+3/-3) lib/lp/snappy/browser/snap.py (+3/-3) lib/lp/snappy/browser/tests/test_snap.py (+36/-36) lib/lp/snappy/browser/tests/test_snaplisting.py (+3/-3) lib/lp/snappy/model/snap.py (+4/-4) lib/lp/snappy/model/snapbuildbehaviour.py (+3/-3) lib/lp/snappy/tests/test_snap.py (+15/-15) lib/lp/snappy/tests/test_snapjob.py (+3/-3) lib/lp/soyuz/adapters/tests/test_overrides.py (+7/-7) lib/lp/soyuz/browser/archive.py (+5/-3) lib/lp/soyuz/browser/queue.py (+6/-6) lib/lp/soyuz/browser/tests/archive-views.rst (+3/-3) lib/lp/soyuz/browser/tests/test_archive_webservice.py (+3/-3) lib/lp/soyuz/browser/tests/test_livefs.py (+6/-6) lib/lp/soyuz/doc/archiveauthtoken.rst (+6/-6) lib/lp/soyuz/doc/distroseriesqueue-notify.rst (+3/-3) lib/lp/soyuz/doc/packageupload-lookups.rst (+3/-3) lib/lp/soyuz/doc/publishing.rst (+3/-3) lib/lp/soyuz/mail/packageupload.py (+3/-3) lib/lp/soyuz/mail/tests/test_packageupload.py (+3/-3) lib/lp/soyuz/model/livefs.py (+8/-4) lib/lp/soyuz/model/packagecopyjob.py (+3/-3) lib/lp/soyuz/model/queue.py (+5/-3) lib/lp/soyuz/stories/ppa/xx-copy-packages.rst (+30/-30) lib/lp/soyuz/stories/ppa/xx-delete-packages.rst (+6/-6) lib/lp/soyuz/stories/ppa/xx-edit-dependencies.rst (+24/-24) lib/lp/soyuz/stories/ppa/xx-ppa-navigation.rst (+3/-3) lib/lp/soyuz/stories/ppa/xx-ppa-packages.rst (+3/-3) lib/lp/soyuz/stories/ppa/xx-ppa-private-teams.rst (+3/-3) lib/lp/soyuz/stories/ppa/xx-ppa-workflow.rst (+42/-42) lib/lp/soyuz/stories/ppa/xx-private-ppa-subscription-stories.rst (+12/-12) lib/lp/soyuz/stories/ppa/xx-private-ppa-subscriptions.rst (+18/-18) lib/lp/soyuz/stories/ppa/xx-private-ppas.rst (+3/-3) lib/lp/soyuz/stories/ppa/xx-ubuntu-ppas.rst (+6/-6) lib/lp/soyuz/stories/soyuz/xx-build-record.rst (+2/-4) lib/lp/soyuz/stories/soyuz/xx-builds-pages.rst (+3/-3) lib/lp/soyuz/stories/soyuz/xx-distribution-add.rst (+3/-3) lib/lp/soyuz/stories/soyuz/xx-distribution-edit.rst (+3/-3) lib/lp/soyuz/stories/soyuz/xx-distroseries-sources.rst (+3/-3) lib/lp/soyuz/stories/soyuz/xx-queue-pages.rst (+6/-6) lib/lp/soyuz/stories/webservice/xx-archive.rst (+3/-3) lib/lp/soyuz/tests/test_archive.py (+16/-16) lib/lp/soyuz/tests/test_archive_subscriptions.py (+5/-3) lib/lp/soyuz/tests/test_archivefile.py (+15/-15) lib/lp/soyuz/tests/test_build_start_estimation.py (+3/-3) lib/lp/soyuz/tests/test_packagecopyjob.py (+3/-3) lib/lp/testing/factory.py (+9/-9) lib/lp/translations/browser/tests/test_translationmessage_view.py (+3/-3) lib/lp/translations/browser/tests/test_translationtemplatesbuild.py (+1/-3) lib/lp/translations/browser/translationimportqueue.py (+6/-6) lib/lp/translations/model/potmsgset.py (+3/-3) lib/lp/translations/scripts/tests/test_remove_translations.py (+6/-6) lib/lp/translations/scripts/tests/test_reupload_translations.py (+3/-3) lib/lp/translations/stories/distribution/xx-distribution-change-language-pack-admins.rst (+3/-3) lib/lp/translations/stories/standalone/xx-pofile-translate-dismiss-suggestions.rst (+9/-9) lib/lp/translations/stories/standalone/xx-pofile-translate-gettext-error-middle-page.rst (+6/-6) lib/lp/translations/stories/standalone/xx-pofile-translate-newlines-check.rst (+15/-15) lib/lp/translations/stories/standalone/xx-potemplate-admin.rst (+3/-3) lib/lp/translations/stories/standalone/xx-translationmessage-translate.rst (+9/-9) lib/lp/translations/stories/translationgroups/xx-link-to-documentation.rst (+6/-6) lib/lp/translations/stories/translationgroups/xx-translationgroups.rst (+15/-15) lib/lp/translations/tests/test_pofile.py (+9/-9) lib/lp/translations/tests/test_potemplate.py (+3/-3) lib/lp/translations/tests/test_translationsplitter.py (+6/-6) lib/lp/translations/tests/test_translationtemplatesbuild.py (+3/-3) utilities/massage-bug-import-xml (+16/-17) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jürgen Gmach | Approve | ||
Review via email: mp+459596@code.launchpad.net |
Commit message
Upgrade to black 24.1.1
This introduces the 2024 stable style.
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs |
2 | index 9a38809..a59e761 100644 |
3 | --- a/.git-blame-ignore-revs |
4 | +++ b/.git-blame-ignore-revs |
5 | @@ -108,3 +108,5 @@ a0cc45d527f251438cff74b4134e7a66fba42ac7 |
6 | 78a72ed0e3f5be6c727f4981d6a09e978cde4b7e |
7 | # apply black's 2023 stable style |
8 | ee5977f514d584c64afe453ac9d2eaa0fdbc3afd |
9 | +# apply black's 2024 stable style |
10 | +b5b64683e1bb26ffef31550f8405553275690deb |
11 | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml |
12 | index 6a72ffa..05ea550 100644 |
13 | --- a/.pre-commit-config.yaml |
14 | +++ b/.pre-commit-config.yaml |
15 | @@ -36,9 +36,7 @@ repos: |
16 | |utilities/community-contributions\.py |
17 | )$ |
18 | - repo: https://github.com/psf/black-pre-commit-mirror |
19 | - # Update the pinned version of black below used by |
20 | - # blackdoc when updating this version. |
21 | - rev: 23.10.1 |
22 | + rev: 24.1.1 |
23 | hooks: |
24 | - id: black |
25 | exclude: | |
26 | @@ -75,10 +73,6 @@ repos: |
27 | - id: blackdoc |
28 | args: ["-l", "78"] |
29 | exclude: ^doc/.* |
30 | - additional_dependencies: |
31 | - # Update this pinned version too when updating the black pre-commit |
32 | - # hook's version above. |
33 | - - black==23.10.1 |
34 | - repo: https://git.launchpad.net/lp-lint-doctest |
35 | rev: '0.5' |
36 | hooks: |
37 | diff --git a/lib/lp/answers/browser/questiontarget.py b/lib/lp/answers/browser/questiontarget.py |
38 | index e9556fc..c34071a 100644 |
39 | --- a/lib/lp/answers/browser/questiontarget.py |
40 | +++ b/lib/lp/answers/browser/questiontarget.py |
41 | @@ -919,9 +919,9 @@ class QuestionTargetPortletAnswerContacts(LaunchpadView): |
42 | "web_link": canonical_url(self.context, rootsite="mainsite"), |
43 | "self_link": absoluteURL(self.context, self.api_request), |
44 | } |
45 | - cache[ |
46 | - self.context.name + "_answer_portlet_url_data" |
47 | - ] = context_url_data |
48 | + cache[self.context.name + "_answer_portlet_url_data"] = ( |
49 | + context_url_data |
50 | + ) |
51 | |
52 | |
53 | class QuestionTargetPortletAnswerContactsWithDetails(LaunchpadView): |
54 | diff --git a/lib/lp/answers/notification.py b/lib/lp/answers/notification.py |
55 | index 7975fdb..4c8e4ca 100644 |
56 | --- a/lib/lp/answers/notification.py |
57 | +++ b/lib/lp/answers/notification.py |
58 | @@ -85,14 +85,15 @@ class QuestionNotification: |
59 | else: |
60 | assignee = "None" |
61 | |
62 | - headers[ |
63 | - "X-Launchpad-Question" |
64 | - ] = "%s status=%s; assignee=%s; priority=%s; language=%s" % ( |
65 | - target, |
66 | - question.status.title, |
67 | - assignee, |
68 | - question.priority.title, |
69 | - question.language.code, |
70 | + headers["X-Launchpad-Question"] = ( |
71 | + "%s status=%s; assignee=%s; priority=%s; language=%s" |
72 | + % ( |
73 | + target, |
74 | + question.status.title, |
75 | + assignee, |
76 | + question.priority.title, |
77 | + question.language.code, |
78 | + ) |
79 | ) |
80 | headers["Reply-To"] = "question%s@%s" % ( |
81 | self.question.id, |
82 | diff --git a/lib/lp/answers/stories/faq-edit.rst b/lib/lp/answers/stories/faq-edit.rst |
83 | index 3d047f8..6e0794d 100644 |
84 | --- a/lib/lp/answers/stories/faq-edit.rst |
85 | +++ b/lib/lp/answers/stories/faq-edit.rst |
86 | @@ -61,9 +61,9 @@ click 'Save' to save their changes. |
87 | Windows |
88 | On Windows, ... |
89 | |
90 | - >>> browser.getControl( |
91 | - ... "Keywords" |
92 | - ... ).value = "windows ubuntu plugins extensions" |
93 | + >>> browser.getControl("Keywords").value = ( |
94 | + ... "windows ubuntu plugins extensions" |
95 | + ... ) |
96 | >>> browser.getControl( |
97 | ... "Content" |
98 | ... ).value += "\nUbuntu:\nSee https://help.ubuntu.com/community/Java\n" |
99 | diff --git a/lib/lp/answers/stories/project-add-question.rst b/lib/lp/answers/stories/project-add-question.rst |
100 | index 9cc84e6..fd1638d 100644 |
101 | --- a/lib/lp/answers/stories/project-add-question.rst |
102 | +++ b/lib/lp/answers/stories/project-add-question.rst |
103 | @@ -111,9 +111,9 @@ submits the form. |
104 | >>> print(user_browser.getControl("Project").displayValue) |
105 | ['Mozilla Thunderbird'] |
106 | |
107 | - >>> user_browser.getControl( |
108 | - ... "Summary" |
109 | - ... ).value = "Problem displaying complex SVG" |
110 | + >>> user_browser.getControl("Summary").value = ( |
111 | + ... "Problem displaying complex SVG" |
112 | + ... ) |
113 | >>> user_browser.getControl("Continue").click() |
114 | |
115 | The user is again shown similar questions, this time for the product |
116 | @@ -272,9 +272,9 @@ because Japanese is not listed as supported. They submits the form with |
117 | the 'Continue' button without setting the product. In this case, they are |
118 | asking a question for Firefox in English regarding SVG. |
119 | |
120 | - >>> user_browser.getControl( |
121 | - ... "Summary" |
122 | - ... ).value = "Problem displaying complex SVG" |
123 | + >>> user_browser.getControl("Summary").value = ( |
124 | + ... "Problem displaying complex SVG" |
125 | + ... ) |
126 | >>> user_browser.getControl("Continue").click() |
127 | |
128 | They're shown a list of similar questions related to the product Firefox. |
129 | @@ -323,9 +323,9 @@ Language, and 'Continues' to the next page. |
130 | >>> print(user_browser.getControl("Language").displayOptions) |
131 | ['English (en) *', 'Japanese (ja)'] |
132 | |
133 | - >>> user_browser.getControl( |
134 | - ... "Summary" |
135 | - ... ).value = "Problem displaying complex SVG" |
136 | + >>> user_browser.getControl("Summary").value = ( |
137 | + ... "Problem displaying complex SVG" |
138 | + ... ) |
139 | >>> user_browser.getControl("Continue").click() |
140 | |
141 | The product Thunderbird that they selected on the previous screen is still |
142 | @@ -346,12 +346,12 @@ Question' button. |
143 | ['Mozilla Thunderbird'] |
144 | |
145 | >>> user_browser.getControl("Japanese (ja) *").selected = True |
146 | - >>> user_browser.getControl( |
147 | - ... "Summary" |
148 | - ... ).value = "Pretend this is written in Japanese" |
149 | - >>> user_browser.getControl( |
150 | - ... "Description" |
151 | - ... ).value = "Something in kanji and hiragana." |
152 | + >>> user_browser.getControl("Summary").value = ( |
153 | + ... "Pretend this is written in Japanese" |
154 | + ... ) |
155 | + >>> user_browser.getControl("Description").value = ( |
156 | + ... "Something in kanji and hiragana." |
157 | + ... ) |
158 | >>> user_browser.getControl("Post Question").click() |
159 | |
160 | The user is taken to page displaying their question. Changing the language |
161 | diff --git a/lib/lp/answers/stories/question-add-in-other-languages.rst b/lib/lp/answers/stories/question-add-in-other-languages.rst |
162 | index f80fb81..990be5e 100644 |
163 | --- a/lib/lp/answers/stories/question-add-in-other-languages.rst |
164 | +++ b/lib/lp/answers/stories/question-add-in-other-languages.rst |
165 | @@ -33,9 +33,9 @@ a language that is not spoken/understood by any of the context's answer |
166 | contacts. |
167 | |
168 | >>> browser.getControl("Language").value = ["pt_BR"] |
169 | - >>> browser.getControl( |
170 | - ... "Summary" |
171 | - ... ).value = "Abrir uma pagina que requer java quebra o firefox" |
172 | + >>> browser.getControl("Summary").value = ( |
173 | + ... "Abrir uma pagina que requer java quebra o firefox" |
174 | + ... ) |
175 | >>> browser.getControl("Continue").click() |
176 | |
177 | At this point we'll present any similar questions (in any language) |
178 | @@ -145,12 +145,12 @@ If they change the language to another unsupported language, we will |
179 | display the warning again. |
180 | |
181 | >>> browser.getControl("Language").value = ["ja"] |
182 | - >>> browser.getControl( |
183 | - ... "Summary" |
184 | - ... ).value = "\u52a9\u3051\u306e\u8981\u6c42".encode("utf-8") |
185 | - >>> browser.getControl( |
186 | - ... "Description" |
187 | - ... ).value = "\u3042\u308b\u4efb\u610f\u5358\u8a9e\u3002".encode("utf-8") |
188 | + >>> browser.getControl("Summary").value = ( |
189 | + ... "\u52a9\u3051\u306e\u8981\u6c42".encode("utf-8") |
190 | + ... ) |
191 | + >>> browser.getControl("Description").value = ( |
192 | + ... "\u3042\u308b\u4efb\u610f\u5358\u8a9e\u3002".encode("utf-8") |
193 | + ... ) |
194 | >>> browser.getControl("Post Question").click() |
195 | |
196 | >>> for tag in find_tags_by_class(browser.contents, "warning message"): |
197 | diff --git a/lib/lp/answers/stories/question-add.rst b/lib/lp/answers/stories/question-add.rst |
198 | index 3723f10..82784c8 100644 |
199 | --- a/lib/lp/answers/stories/question-add.rst |
200 | +++ b/lib/lp/answers/stories/question-add.rst |
201 | @@ -73,9 +73,9 @@ XXX: Original search, disabled due to performance issues RBC 20100725. This |
202 | will be reinstated when cheap relevance filtering is available / when search |
203 | is overhauled. |
204 | |
205 | - >>> user_browser.getControl( |
206 | - ... "Summary" |
207 | - ... ).value = "Visiting a web page requiring java crashes firefox" |
208 | + >>> user_browser.getControl("Summary").value = ( |
209 | + ... "Visiting a web page requiring java crashes firefox" |
210 | + ... ) |
211 | |
212 | For now, use a closer search: |
213 | |
214 | @@ -156,13 +156,13 @@ first step: |
215 | Entering a valid title and description will create the new question and |
216 | redirect the user to the question page. |
217 | |
218 | - >>> user_browser.getControl( |
219 | - ... "Summary" |
220 | - ... ).value = "Visiting a web page requiring java crashes firefox" |
221 | + >>> user_browser.getControl("Summary").value = ( |
222 | + ... "Visiting a web page requiring java crashes firefox" |
223 | + ... ) |
224 | >>> user_browser.getControl("Continue").click() |
225 | - >>> user_browser.getControl( |
226 | - ... "Description" |
227 | - ... ).value = "I use Ubuntu on AMD64 and firefox is slow." |
228 | + >>> user_browser.getControl("Description").value = ( |
229 | + ... "I use Ubuntu on AMD64 and firefox is slow." |
230 | + ... ) |
231 | >>> user_browser.getControl("Post Question").click() |
232 | >>> user_browser.url |
233 | '.../ubuntu/+source/mozilla-firefox/+question/...' |
234 | diff --git a/lib/lp/answers/stories/question-browse-and-search.rst b/lib/lp/answers/stories/question-browse-and-search.rst |
235 | index 61cc8cf..92a24fe 100644 |
236 | --- a/lib/lp/answers/stories/question-browse-and-search.rst |
237 | +++ b/lib/lp/answers/stories/question-browse-and-search.rst |
238 | @@ -416,9 +416,9 @@ They need to login to access that page: |
239 | Their problem was about integrating their email client in firefox, so they |
240 | enter 'email client in firefox' |
241 | |
242 | - >>> sample_person_browser.getControl( |
243 | - ... name="field.search_text" |
244 | - ... ).value = "email client in firefox" |
245 | + >>> sample_person_browser.getControl(name="field.search_text").value = ( |
246 | + ... "email client in firefox" |
247 | + ... ) |
248 | |
249 | They also remember that their question was answered, so they unselect the |
250 | other statuses and hit the search button. |
251 | @@ -496,9 +496,9 @@ They need to login to access that page: |
252 | |
253 | Like all other report, this one is searchable: |
254 | |
255 | - >>> sample_person_browser.getControl( |
256 | - ... name="field.search_text" |
257 | - ... ).value = "evolution" |
258 | + >>> sample_person_browser.getControl(name="field.search_text").value = ( |
259 | + ... "evolution" |
260 | + ... ) |
261 | >>> sample_person_browser.getControl("Search", index=0).click() |
262 | >>> print(sample_person_browser.title) |
263 | Questions matching "evolution" needing your attention for Ubuntu : |
264 | diff --git a/lib/lp/answers/stories/question-edit.rst b/lib/lp/answers/stories/question-edit.rst |
265 | index d1db512..bd0f8d5 100644 |
266 | --- a/lib/lp/answers/stories/question-edit.rst |
267 | +++ b/lib/lp/answers/stories/question-edit.rst |
268 | @@ -75,18 +75,18 @@ Any logged in user can change the question source package on the |
269 | |
270 | >>> user_browser.open("http://launchpad.test/ubuntu/+question/5") |
271 | >>> user_browser.getLink("Edit question").click() |
272 | - >>> user_browser.getControl( |
273 | - ... name="field.target.package" |
274 | - ... ).value = "linux-source-2.6.15" |
275 | + >>> user_browser.getControl(name="field.target.package").value = ( |
276 | + ... "linux-source-2.6.15" |
277 | + ... ) |
278 | >>> user_browser.getControl("Save Changes").click() |
279 | |
280 | Product questions ignore sourcepackage information if it is submitted: |
281 | |
282 | >>> user_browser.open("http://launchpad.test/firefox/+question/2") |
283 | >>> user_browser.getLink("Edit question").click() |
284 | - >>> user_browser.getControl( |
285 | - ... name="field.target.package" |
286 | - ... ).value = "linux-source-2.6.15" |
287 | + >>> user_browser.getControl(name="field.target.package").value = ( |
288 | + ... "linux-source-2.6.15" |
289 | + ... ) |
290 | >>> user_browser.getControl("Save Changes").click() |
291 | |
292 | |
293 | diff --git a/lib/lp/answers/stories/question-obfuscation.rst b/lib/lp/answers/stories/question-obfuscation.rst |
294 | index 791728c..66af75c 100644 |
295 | --- a/lib/lp/answers/stories/question-obfuscation.rst |
296 | +++ b/lib/lp/answers/stories/question-obfuscation.rst |
297 | @@ -78,9 +78,9 @@ description. They can then see the email address in the tooltip in the |
298 | |
299 | >>> user_browser.getControl("Summary").value = "email address test" |
300 | >>> user_browser.getControl("Continue").click() |
301 | - >>> user_browser.getControl( |
302 | - ... "Description" |
303 | - ... ).value = "The clicking mailto:user@domain.com crashes the browser." |
304 | + >>> user_browser.getControl("Description").value = ( |
305 | + ... "The clicking mailto:user@domain.com crashes the browser." |
306 | + ... ) |
307 | >>> user_browser.getControl("Post Question").click() |
308 | >>> print(user_browser.title) |
309 | Question #... : ... |
310 | diff --git a/lib/lp/answers/stories/question-reject-and-change-status.rst b/lib/lp/answers/stories/question-reject-and-change-status.rst |
311 | index 7cc0805..bcb1f63 100644 |
312 | --- a/lib/lp/answers/stories/question-reject-and-change-status.rst |
313 | +++ b/lib/lp/answers/stories/question-reject-and-change-status.rst |
314 | @@ -47,9 +47,9 @@ cancel link to take them back to the question: |
315 | Entering an explanation message and clicking the 'Reject' button, |
316 | will reject the question. |
317 | |
318 | - >>> admin_browser.getControl( |
319 | - ... "Message" |
320 | - ... ).value = """Rejecting because it's a duplicate of bug #1.""" |
321 | + >>> admin_browser.getControl("Message").value = ( |
322 | + ... """Rejecting because it's a duplicate of bug #1.""" |
323 | + ... ) |
324 | >>> admin_browser.getControl("Reject").click() |
325 | |
326 | Once the question is rejected, a confirmation message is shown; |
327 | diff --git a/lib/lp/answers/stories/question-workflow.rst b/lib/lp/answers/stories/question-workflow.rst |
328 | index 73f604f..0befd76 100755 |
329 | --- a/lib/lp/answers/stories/question-workflow.rst |
330 | +++ b/lib/lp/answers/stories/question-workflow.rst |
331 | @@ -74,9 +74,7 @@ on the 'Add Information Request' button. |
332 | Link to a FAQ |
333 | Create a new FAQ |
334 | |
335 | - >>> support_browser.getControl( |
336 | - ... "Message" |
337 | - ... ).value = ( |
338 | + >>> support_browser.getControl("Message").value = ( |
339 | ... "Can you provide an example of an URL displaying the problem?" |
340 | ... ) |
341 | >>> support_browser.getControl("Add Information Request").click() |
342 | @@ -106,9 +104,7 @@ A comment can be added at any point without altering the status. The |
343 | user simply enters the comment in the 'Message' box and clicks the 'Just |
344 | Add a Comment' button. |
345 | |
346 | - >>> support_browser.getControl( |
347 | - ... "Message" |
348 | - ... ).value = ( |
349 | + >>> support_browser.getControl("Message").value = ( |
350 | ... "I forgot to mention, in the meantime here is a workaround..." |
351 | ... ) |
352 | >>> support_browser.getControl("Just Add a Comment").click() |
353 | @@ -260,9 +256,9 @@ When the question is Solved, it is still possible to add comments to it. |
354 | The user simply enters the comment in the 'Message' box and clicks the |
355 | 'Just Add a Comment' button. |
356 | |
357 | - >>> owner_browser.getControl( |
358 | - ... "Message" |
359 | - ... ).value = "The example now displays correctly. Thanks." |
360 | + >>> owner_browser.getControl("Message").value = ( |
361 | + ... "The example now displays correctly. Thanks." |
362 | + ... ) |
363 | >>> owner_browser.getControl("Just Add a Comment").click() |
364 | |
365 | This appends the comment to the question and it doesn't change its |
366 | @@ -457,9 +453,7 @@ choosing an answer that helped him solve his problem. |
367 | >>> answer_button_paragraph is None |
368 | True |
369 | |
370 | - >>> carlos_browser.getControl( |
371 | - ... "Message" |
372 | - ... ).value = ( |
373 | + >>> carlos_browser.getControl("Message").value = ( |
374 | ... "There is a bug in that version. SMP is fine after upgrading." |
375 | ... ) |
376 | >>> carlos_browser.getControl("Problem Solved").click() |
377 | diff --git a/lib/lp/answers/stories/this-is-a-faq.rst b/lib/lp/answers/stories/this-is-a-faq.rst |
378 | index 1ccb2ba..d2b2f09 100644 |
379 | --- a/lib/lp/answers/stories/this-is-a-faq.rst |
380 | +++ b/lib/lp/answers/stories/this-is-a-faq.rst |
381 | @@ -177,9 +177,9 @@ question's title are displayed: |
382 | |
383 | They change the message and click 'Link to FAQ'. |
384 | |
385 | - >>> user_browser.getControl( |
386 | - ... "Message" |
387 | - ... ).value = "Sorry, this document doesn't really answer your question." |
388 | + >>> user_browser.getControl("Message").value = ( |
389 | + ... "Sorry, this document doesn't really answer your question." |
390 | + ... ) |
391 | >>> user_browser.getControl("Link to FAQ").click() |
392 | |
393 | But since they forgot to change the link, the form is displayed again |
394 | @@ -274,9 +274,9 @@ edit them to be more appropriate: |
395 | Hi! I'm trying to learn about SVG but I can't get it to work at all in |
396 | firefox. Maybe there is a plugin? Help! Thanks. |
397 | |
398 | - >>> owner_browser.getControl( |
399 | - ... "Content" |
400 | - ... ).value = "Upgrade your browser to Firefox 2.0." |
401 | + >>> owner_browser.getControl("Content").value = ( |
402 | + ... "Upgrade your browser to Firefox 2.0." |
403 | + ... ) |
404 | |
405 | They can also enter keywords describing the FAQ: |
406 | |
407 | diff --git a/lib/lp/app/browser/tales.py b/lib/lp/app/browser/tales.py |
408 | index 99e0e5d..c91b890 100644 |
409 | --- a/lib/lp/app/browser/tales.py |
410 | +++ b/lib/lp/app/browser/tales.py |
411 | @@ -1649,7 +1649,6 @@ class DistroSeriesFormatterAPI(CustomizableFormatter): |
412 | |
413 | |
414 | class SourcePackageReleaseFormatterAPI(CustomizableFormatter): |
415 | - |
416 | """Adapter for ISourcePackageRelease objects to a formatted string.""" |
417 | |
418 | _link_summary_template = "%(sourcepackage)s %(version)s" |
419 | diff --git a/lib/lp/app/widgets/project.py b/lib/lp/app/widgets/project.py |
420 | index 2547094..6723b5b 100644 |
421 | --- a/lib/lp/app/widgets/project.py |
422 | +++ b/lib/lp/app/widgets/project.py |
423 | @@ -68,9 +68,9 @@ class ProjectScopeWidget(BrowserWidget, InputWidget): |
424 | ): |
425 | attributes["checked"] = "checked" |
426 | if option == "project": |
427 | - attributes[ |
428 | - "onclick" |
429 | - ] = "document.getElementById('field.scope.target').focus();" |
430 | + attributes["onclick"] = ( |
431 | + "document.getElementById('field.scope.target').focus();" |
432 | + ) |
433 | self.options[option] = renderElement("input", **attributes) |
434 | self.target_widget.onKeyPress = ( |
435 | "selectWidget('%s.option.project', event)" % self.name |
436 | diff --git a/lib/lp/archivepublisher/domination.py b/lib/lp/archivepublisher/domination.py |
437 | index b8a8eeb..e824f4d 100644 |
438 | --- a/lib/lp/archivepublisher/domination.py |
439 | +++ b/lib/lp/archivepublisher/domination.py |
440 | @@ -518,9 +518,9 @@ class Dominator: |
441 | # the items so that we can be sure that we're not altering the |
442 | # iteration order while iteration is underway. |
443 | for (name, location), pubs in list(pubs_by_name_and_location.items()): |
444 | - pubs_by_name_and_location[ |
445 | - (name, location) |
446 | - ] = generalization.sortPublications(pubs) |
447 | + pubs_by_name_and_location[(name, location)] = ( |
448 | + generalization.sortPublications(pubs) |
449 | + ) |
450 | |
451 | return pubs_by_name_and_location |
452 | |
453 | @@ -589,9 +589,11 @@ class Dominator: |
454 | Not( |
455 | IsDistinctFrom( |
456 | BinaryPackagePublishingHistory._channel, |
457 | - Cast(json.dumps(pub_record._channel), "jsonb") |
458 | - if pub_record._channel is not None |
459 | - else None, |
460 | + ( |
461 | + Cast(json.dumps(pub_record._channel), "jsonb") |
462 | + if pub_record._channel is not None |
463 | + else None |
464 | + ), |
465 | ) |
466 | ), |
467 | ) |
468 | diff --git a/lib/lp/archivepublisher/model/ftparchive.py b/lib/lp/archivepublisher/model/ftparchive.py |
469 | index 94885ea..26eb048 100644 |
470 | --- a/lib/lp/archivepublisher/model/ftparchive.py |
471 | +++ b/lib/lp/archivepublisher/model/ftparchive.py |
472 | @@ -982,9 +982,9 @@ class FTPArchiveHandler: |
473 | "DISTS": os.path.basename(self._config.distsroot), |
474 | "HIDEEXTRA": "", |
475 | # Must match DdtpTarballUpload.shouldInstall. |
476 | - "LONGDESCRIPTION": "true" |
477 | - if include_long_descriptions |
478 | - else "false", |
479 | + "LONGDESCRIPTION": ( |
480 | + "true" if include_long_descriptions else "false" |
481 | + ), |
482 | } |
483 | ) |
484 | |
485 | diff --git a/lib/lp/archivepublisher/tests/test_publisher.py b/lib/lp/archivepublisher/tests/test_publisher.py |
486 | index 70c9c70..e72b7c9 100644 |
487 | --- a/lib/lp/archivepublisher/tests/test_publisher.py |
488 | +++ b/lib/lp/archivepublisher/tests/test_publisher.py |
489 | @@ -1492,13 +1492,13 @@ class TestPublisher(TestPublisherBase): |
490 | archive_file = self.factory.makeArchiveFile(archive=archive) |
491 | self.assertNotIn(archive, ubuntu.getPendingPublicationPPAs()) |
492 | now = datetime.now(timezone.utc) |
493 | - removeSecurityProxy( |
494 | - archive_file |
495 | - ).scheduled_deletion_date = now + timedelta(hours=12) |
496 | + removeSecurityProxy(archive_file).scheduled_deletion_date = ( |
497 | + now + timedelta(hours=12) |
498 | + ) |
499 | self.assertNotIn(archive, ubuntu.getPendingPublicationPPAs()) |
500 | - removeSecurityProxy( |
501 | - archive_file |
502 | - ).scheduled_deletion_date = now - timedelta(hours=12) |
503 | + removeSecurityProxy(archive_file).scheduled_deletion_date = ( |
504 | + now - timedelta(hours=12) |
505 | + ) |
506 | self.assertIn(archive, ubuntu.getPendingPublicationPPAs()) |
507 | getUtility(IArchiveFileSet).markDeleted([archive_file]) |
508 | self.assertNotIn(archive, ubuntu.getPendingPublicationPPAs()) |
509 | @@ -3003,9 +3003,9 @@ class TestArchiveIndices(TestPublisherBase): |
510 | |
511 | # Override the series status to FROZEN, which allows publication |
512 | # of all pockets. |
513 | - self.ubuntutest.getSeries( |
514 | - "breezy-autotest" |
515 | - ).status = SeriesStatus.FROZEN |
516 | + self.ubuntutest.getSeries("breezy-autotest").status = ( |
517 | + SeriesStatus.FROZEN |
518 | + ) |
519 | |
520 | self.config = getPubConfig(self.ubuntutest.main_archive) |
521 | publisher = Publisher( |
522 | diff --git a/lib/lp/archiveuploader/tests/upload-karma.rst b/lib/lp/archiveuploader/tests/upload-karma.rst |
523 | index d31108c..0ad5210 100644 |
524 | --- a/lib/lp/archiveuploader/tests/upload-karma.rst |
525 | +++ b/lib/lp/archiveuploader/tests/upload-karma.rst |
526 | @@ -55,9 +55,9 @@ Poke the queue entry so it looks like Foo Bar (name16) uploaded it: |
527 | >>> name16 = getUtility(IPersonSet).getByName("name16") |
528 | >>> key = getUtility(IGPGKeySet).getGPGKeysForPerson(name16)[0] |
529 | >>> removeSecurityProxy(foo_src.queue_root).signing_key_owner = key.owner |
530 | - >>> removeSecurityProxy( |
531 | - ... foo_src.queue_root |
532 | - ... ).signing_key_fingerprint = key.fingerprint |
533 | + >>> removeSecurityProxy(foo_src.queue_root).signing_key_fingerprint = ( |
534 | + ... key.fingerprint |
535 | + ... ) |
536 | >>> transaction.commit() |
537 | >>> foo_src.queue_root.acceptFromQueue() |
538 | Karma added: action=distributionuploadaccepted, distribution=ubuntu |
539 | diff --git a/lib/lp/archiveuploader/uploadprocessor.py b/lib/lp/archiveuploader/uploadprocessor.py |
540 | index 562f7a4..baa903b 100644 |
541 | --- a/lib/lp/archiveuploader/uploadprocessor.py |
542 | +++ b/lib/lp/archiveuploader/uploadprocessor.py |
543 | @@ -605,7 +605,6 @@ class UserUploadHandler(UploadHandler): |
544 | |
545 | |
546 | class CannotGetBuild(Exception): |
547 | - |
548 | """Attempting to retrieve the build for this upload failed.""" |
549 | |
550 | |
551 | diff --git a/lib/lp/blueprints/stories/blueprints/xx-creation.rst b/lib/lp/blueprints/stories/blueprints/xx-creation.rst |
552 | index e5e1e91..0225661 100644 |
553 | --- a/lib/lp/blueprints/stories/blueprints/xx-creation.rst |
554 | +++ b/lib/lp/blueprints/stories/blueprints/xx-creation.rst |
555 | @@ -676,12 +676,12 @@ produces the same error: |
556 | >>> user_browser.open(url) |
557 | >>> user_browser.getControl("For").value = "ubuntu" |
558 | >>> user_browser.getControl("Name").value = "media-integrity-check" |
559 | - >>> user_browser.getControl( |
560 | - ... "Title" |
561 | - ... ).value = "A blueprint with a name that already exists" |
562 | - >>> user_browser.getControl( |
563 | - ... "Summary" |
564 | - ... ).value = "There is already a blueprint with this name" |
565 | + >>> user_browser.getControl("Title").value = ( |
566 | + ... "A blueprint with a name that already exists" |
567 | + ... ) |
568 | + >>> user_browser.getControl("Summary").value = ( |
569 | + ... "There is already a blueprint with this name" |
570 | + ... ) |
571 | >>> user_browser.getControl("Register Blueprint").click() |
572 | >>> print(user_browser.url) |
573 | http://blueprints.launchpad.test/sprints/rome/+addspec |
574 | diff --git a/lib/lp/blueprints/stories/blueprints/xx-dependencies.rst b/lib/lp/blueprints/stories/blueprints/xx-dependencies.rst |
575 | index 8a6ee9b..14837d5 100644 |
576 | --- a/lib/lp/blueprints/stories/blueprints/xx-dependencies.rst |
577 | +++ b/lib/lp/blueprints/stories/blueprints/xx-dependencies.rst |
578 | @@ -64,9 +64,9 @@ minds. |
579 | Now, lets POST the form, saying we want extension-manager-upgrades as the |
580 | dependency. |
581 | |
582 | - >>> owner_browser.getControl( |
583 | - ... "Depends On" |
584 | - ... ).value = "extension-manager-upgrades" |
585 | + >>> owner_browser.getControl("Depends On").value = ( |
586 | + ... "extension-manager-upgrades" |
587 | + ... ) |
588 | >>> owner_browser.getControl("Continue").click() |
589 | >>> owner_browser.url |
590 | 'http://blueprints.launchpad.test/firefox/+spec/canvas' |
591 | @@ -142,9 +142,9 @@ show this, we register a blueprint for a different project. |
592 | ... ) |
593 | >>> owner_browser.getControl("Name").value = "test-blueprint" |
594 | >>> owner_browser.getControl("Title").value = "Test Blueprint" |
595 | - >>> owner_browser.getControl( |
596 | - ... "Summary" |
597 | - ... ).value = "Another blueprint in a different project" |
598 | + >>> owner_browser.getControl("Summary").value = ( |
599 | + ... "Another blueprint in a different project" |
600 | + ... ) |
601 | >>> owner_browser.getControl("Register Blueprint").click() |
602 | >>> owner_browser.url |
603 | 'http://blueprints.launchpad.test/jokosher/+spec/test-blueprint' |
604 | @@ -289,21 +289,21 @@ We create two blueprints in `ubuntu`. |
605 | >>> owner_browser.open("http://blueprints.launchpad.test/ubuntu/+addspec") |
606 | >>> owner_browser.getControl("Name").value = "distro-blueprint-a" |
607 | >>> owner_browser.getControl("Title").value = "A blueprint for a distro" |
608 | - >>> owner_browser.getControl( |
609 | - ... "Summary" |
610 | - ... ).value = "This is a blueprint for the Ubuntu distribution" |
611 | + >>> owner_browser.getControl("Summary").value = ( |
612 | + ... "This is a blueprint for the Ubuntu distribution" |
613 | + ... ) |
614 | >>> owner_browser.getControl("Register Blueprint").click() |
615 | >>> print(owner_browser.url) |
616 | http://blueprints.launchpad.test/ubuntu/+spec/distro-blueprint-a |
617 | |
618 | >>> owner_browser.open("http://blueprints.launchpad.test/ubuntu/+addspec") |
619 | >>> owner_browser.getControl("Name").value = "distro-blueprint-b" |
620 | - >>> owner_browser.getControl( |
621 | - ... "Title" |
622 | - ... ).value = "Another blueprint for a distro" |
623 | - >>> owner_browser.getControl( |
624 | - ... "Summary" |
625 | - ... ).value = "This is a blueprint for the Ubuntu distribution" |
626 | + >>> owner_browser.getControl("Title").value = ( |
627 | + ... "Another blueprint for a distro" |
628 | + ... ) |
629 | + >>> owner_browser.getControl("Summary").value = ( |
630 | + ... "This is a blueprint for the Ubuntu distribution" |
631 | + ... ) |
632 | >>> owner_browser.getControl("Register Blueprint").click() |
633 | >>> print(owner_browser.url) |
634 | http://blueprints.launchpad.test/ubuntu/+spec/distro-blueprint-b |
635 | diff --git a/lib/lp/blueprints/stories/blueprints/xx-distrorelease.rst b/lib/lp/blueprints/stories/blueprints/xx-distrorelease.rst |
636 | index 4ac3734..0b36cd4 100644 |
637 | --- a/lib/lp/blueprints/stories/blueprints/xx-distrorelease.rst |
638 | +++ b/lib/lp/blueprints/stories/blueprints/xx-distrorelease.rst |
639 | @@ -19,9 +19,9 @@ Then we try to add a specification to that distro |
640 | |
641 | >>> user_browser.getControl("Name").value = "testspec" |
642 | >>> user_browser.getControl("Title").value = "Test Specification" |
643 | - >>> user_browser.getControl( |
644 | - ... "Specification URL" |
645 | - ... ).value = "http://wiki.test.com" |
646 | + >>> user_browser.getControl("Specification URL").value = ( |
647 | + ... "http://wiki.test.com" |
648 | + ... ) |
649 | >>> user_browser.getControl("Summary").value = "TEst spec add" |
650 | >>> user_browser.getControl("Definition Status").value = ["NEW"] |
651 | >>> user_browser.getControl("Assignee").value = "test@canonical.com" |
652 | diff --git a/lib/lp/blueprints/stories/blueprints/xx-editing.rst b/lib/lp/blueprints/stories/blueprints/xx-editing.rst |
653 | index 79b0d3e..89c8197 100644 |
654 | --- a/lib/lp/blueprints/stories/blueprints/xx-editing.rst |
655 | +++ b/lib/lp/blueprints/stories/blueprints/xx-editing.rst |
656 | @@ -49,9 +49,9 @@ Now, let's POST the resulting changes. We should be redirected to the |
657 | specification home page. |
658 | |
659 | >>> browser.getControl("Name").value = "extension-manager-upgrades" |
660 | - >>> browser.getControl( |
661 | - ... "Title" |
662 | - ... ).value = "Extension Manager System Upgrades" |
663 | + >>> browser.getControl("Title").value = ( |
664 | + ... "Extension Manager System Upgrades" |
665 | + ... ) |
666 | >>> browser.getControl("Specification URL").value = url |
667 | >>> summary = ( |
668 | ... "Simplify the way extensions are installed and registered " |
669 | diff --git a/lib/lp/blueprints/stories/blueprints/xx-non-ascii-imagemap.rst b/lib/lp/blueprints/stories/blueprints/xx-non-ascii-imagemap.rst |
670 | index fcee09c..ea07b5b 100644 |
671 | --- a/lib/lp/blueprints/stories/blueprints/xx-non-ascii-imagemap.rst |
672 | +++ b/lib/lp/blueprints/stories/blueprints/xx-non-ascii-imagemap.rst |
673 | @@ -4,9 +4,9 @@ Non-ascii characters in specification titles are allowed. |
674 | ... "http://blueprints.launchpad.test/firefox/+spec/e4x/+edit" |
675 | ... ) |
676 | |
677 | - >>> admin_browser.getControl( |
678 | - ... "Title" |
679 | - ... ).value = "A title with non-ascii characters \xe1\xe3" |
680 | + >>> admin_browser.getControl("Title").value = ( |
681 | + ... "A title with non-ascii characters \xe1\xe3" |
682 | + ... ) |
683 | >>> admin_browser.getControl("Change").click() |
684 | >>> admin_browser.url |
685 | 'http://blueprints.launchpad.test/firefox/+spec/e4x' |
686 | diff --git a/lib/lp/blueprints/stories/sprints/xx-sprints.rst b/lib/lp/blueprints/stories/sprints/xx-sprints.rst |
687 | index 66f9ce6..8c74ef4 100644 |
688 | --- a/lib/lp/blueprints/stories/sprints/xx-sprints.rst |
689 | +++ b/lib/lp/blueprints/stories/sprints/xx-sprints.rst |
690 | @@ -63,12 +63,12 @@ First we'll test the name field validator. |
691 | >>> user_browser.getControl("Driver").value = "kamion" |
692 | >>> user_browser.getControl("Home Page").value = "http://www.willy.net" |
693 | >>> user_browser.getControl("Timezone").value = ["UTC"] |
694 | - >>> user_browser.getControl( |
695 | - ... "Starting Date and Time" |
696 | - ... ).value = "10 Oct 2006 09:15" |
697 | - >>> user_browser.getControl( |
698 | - ... "Finishing Date and Time" |
699 | - ... ).value = "13 Oct 2006 16:00" |
700 | + >>> user_browser.getControl("Starting Date and Time").value = ( |
701 | + ... "10 Oct 2006 09:15" |
702 | + ... ) |
703 | + >>> user_browser.getControl("Finishing Date and Time").value = ( |
704 | + ... "13 Oct 2006 16:00" |
705 | + ... ) |
706 | >>> user_browser.getControl("Add Sprint").click() |
707 | |
708 | >>> for tag in find_tags_by_class(user_browser.contents, "message"): |
709 | @@ -95,12 +95,12 @@ Create a new sprint with a finish date before the starting date returns |
710 | a error message. |
711 | |
712 | >>> user_browser.getControl("Name").value = "ltsponsteroids" |
713 | - >>> user_browser.getControl( |
714 | - ... "Starting Date and Time" |
715 | - ... ).value = "13 Oct 2006 09:15 " |
716 | - >>> user_browser.getControl( |
717 | - ... "Finishing Date and Time" |
718 | - ... ).value = "10 Oct 2006 16:00" |
719 | + >>> user_browser.getControl("Starting Date and Time").value = ( |
720 | + ... "13 Oct 2006 09:15 " |
721 | + ... ) |
722 | + >>> user_browser.getControl("Finishing Date and Time").value = ( |
723 | + ... "10 Oct 2006 16:00" |
724 | + ... ) |
725 | >>> user_browser.getControl("Add Sprint").click() |
726 | |
727 | >>> for tag in find_tags_by_class(user_browser.contents, "message"): |
728 | @@ -122,12 +122,12 @@ minutes rather than second-level accuracy: |
729 | Fix the date and try again. We're redirected to the sprint home page for |
730 | the new sprint. |
731 | |
732 | - >>> user_browser.getControl( |
733 | - ... "Starting Date and Time" |
734 | - ... ).value = "10 Oct 2006 09:15 " |
735 | - >>> user_browser.getControl( |
736 | - ... "Finishing Date and Time" |
737 | - ... ).value = "13 Oct 2006 16:00" |
738 | + >>> user_browser.getControl("Starting Date and Time").value = ( |
739 | + ... "10 Oct 2006 09:15 " |
740 | + ... ) |
741 | + >>> user_browser.getControl("Finishing Date and Time").value = ( |
742 | + ... "13 Oct 2006 16:00" |
743 | + ... ) |
744 | >>> user_browser.getControl( |
745 | ... "Is the sprint being held in a physical " "location?" |
746 | ... ).selected = False |
747 | @@ -161,12 +161,12 @@ Add a new sprint with a different time zone is also handled correctly. |
748 | >>> user_browser.getControl("Summary").value = summary |
749 | >>> user_browser.getControl("Home Page").value = "http://www.ubuntu.com" |
750 | >>> user_browser.getControl("Timezone").value = ["Africa/Johannesburg"] |
751 | - >>> user_browser.getControl( |
752 | - ... "Starting Date and Time" |
753 | - ... ).value = "10 Jul 2006 09:15" |
754 | - >>> user_browser.getControl( |
755 | - ... "Finishing Date and Time" |
756 | - ... ).value = "13 Jul 2006 16:00" |
757 | + >>> user_browser.getControl("Starting Date and Time").value = ( |
758 | + ... "10 Jul 2006 09:15" |
759 | + ... ) |
760 | + >>> user_browser.getControl("Finishing Date and Time").value = ( |
761 | + ... "13 Jul 2006 16:00" |
762 | + ... ) |
763 | >>> user_browser.getControl("Add Sprint").click() |
764 | |
765 | >>> user_browser.url |
766 | @@ -236,12 +236,12 @@ We fix the dates and change the address, we expect to be redirected to the |
767 | sprint home page. |
768 | |
769 | >>> browser.getControl("Timezone").value = ["America/Toronto"] |
770 | - >>> browser.getControl( |
771 | - ... "Starting Date and Time" |
772 | - ... ).value = "2006-01-10 08:30" |
773 | - >>> browser.getControl( |
774 | - ... "Finishing Date and Time" |
775 | - ... ).value = "2006-02-12 17:00" |
776 | + >>> browser.getControl("Starting Date and Time").value = ( |
777 | + ... "2006-01-10 08:30" |
778 | + ... ) |
779 | + >>> browser.getControl("Finishing Date and Time").value = ( |
780 | + ... "2006-02-12 17:00" |
781 | + ... ) |
782 | >>> browser.getControl("Meeting Address").value = address |
783 | >>> browser.getControl("Change").click() |
784 | |
785 | @@ -457,9 +457,9 @@ Sample Person registers Salgado as well. |
786 | >>> browser.url |
787 | 'http://launchpad.test/sprints/ubz/+register' |
788 | |
789 | - >>> browser.getControl( |
790 | - ... "Attendee" |
791 | - ... ).value = "guilherme.salgado@canonical.com" |
792 | + >>> browser.getControl("Attendee").value = ( |
793 | + ... "guilherme.salgado@canonical.com" |
794 | + ... ) |
795 | >>> browser.getControl(name="field.is_physical").value = ["no"] |
796 | >>> browser.getControl("Register").click() |
797 | |
798 | diff --git a/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.rst b/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.rst |
799 | index d1790b5..9148ba5 100644 |
800 | --- a/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.rst |
801 | +++ b/lib/lp/blueprints/stories/standalone/xx-informational-blueprints.rst |
802 | @@ -21,9 +21,9 @@ We register a new blueprint. |
803 | ... ) |
804 | >>> user_browser.getControl("Name").value = "informational-blueprint" |
805 | >>> user_browser.getControl("Title").value = "Informational blueprint" |
806 | - >>> user_browser.getControl( |
807 | - ... "Summary" |
808 | - ... ).value = "A blueprint requiring no implementation." |
809 | + >>> user_browser.getControl("Summary").value = ( |
810 | + ... "A blueprint requiring no implementation." |
811 | + ... ) |
812 | >>> user_browser.getControl("Register Blueprint").click() |
813 | >>> user_browser.url |
814 | 'http://blueprints.launchpad.test/jokosher/+spec/informational-blueprint' |
815 | diff --git a/lib/lp/blueprints/tests/test_specification.py b/lib/lp/blueprints/tests/test_specification.py |
816 | index c0ff34a..4e40eac 100644 |
817 | --- a/lib/lp/blueprints/tests/test_specification.py |
818 | +++ b/lib/lp/blueprints/tests/test_specification.py |
819 | @@ -799,9 +799,9 @@ class TestSpecifications(TestCaseWithFactory): |
820 | ) |
821 | if priority is not None: |
822 | removeSecurityProxy(blueprint).priority = priority |
823 | - removeSecurityProxy( |
824 | - blueprint |
825 | - ).datecreated = self.date_created + timedelta(date_created) |
826 | + removeSecurityProxy(blueprint).datecreated = ( |
827 | + self.date_created + timedelta(date_created) |
828 | + ) |
829 | return blueprint |
830 | |
831 | def test_specifications_quantity(self): |
832 | diff --git a/lib/lp/bugs/browser/bug.py b/lib/lp/bugs/browser/bug.py |
833 | index 9cbd9a4..39341c5 100644 |
834 | --- a/lib/lp/bugs/browser/bug.py |
835 | +++ b/lib/lp/bugs/browser/bug.py |
836 | @@ -1050,12 +1050,12 @@ class BugSecrecyEditView(LaunchpadFormView, BugSubscriptionPortletDetails): |
837 | |
838 | if changed: |
839 | result_data = self._getSubscriptionDetails() |
840 | - result_data[ |
841 | - "can_add_project_task" |
842 | - ] = can_add_project_task_to_bug(bug) |
843 | - result_data[ |
844 | - "can_add_package_task" |
845 | - ] = can_add_package_task_to_bug(bug) |
846 | + result_data["can_add_project_task"] = ( |
847 | + can_add_project_task_to_bug(bug) |
848 | + ) |
849 | + result_data["can_add_package_task"] = ( |
850 | + can_add_package_task_to_bug(bug) |
851 | + ) |
852 | self.request.response.setHeader( |
853 | "content-type", "application/json" |
854 | ) |
855 | diff --git a/lib/lp/bugs/browser/buglisting.py b/lib/lp/bugs/browser/buglisting.py |
856 | index 3b579c7..f6aebfd 100644 |
857 | --- a/lib/lp/bugs/browser/buglisting.py |
858 | +++ b/lib/lp/bugs/browser/buglisting.py |
859 | @@ -1116,12 +1116,12 @@ class BugTaskSearchListingView(LaunchpadFormView, FeedsMixin, BugsInfoMixin): |
860 | cache.objects.update( |
861 | get_batch_properties_for_json_cache(self, batch_navigator) |
862 | ) |
863 | - cache.objects[ |
864 | - "field_visibility" |
865 | - ] = batch_navigator.field_visibility |
866 | - cache.objects[ |
867 | - "field_visibility_defaults" |
868 | - ] = batch_navigator.field_visibility_defaults |
869 | + cache.objects["field_visibility"] = ( |
870 | + batch_navigator.field_visibility |
871 | + ) |
872 | + cache.objects["field_visibility_defaults"] = ( |
873 | + batch_navigator.field_visibility_defaults |
874 | + ) |
875 | cache.objects["cbl_cookie_name"] = batch_navigator.getCookieName() |
876 | |
877 | cache.objects["order_by"] = ",".join( |
878 | @@ -1240,9 +1240,9 @@ class BugTaskSearchListingView(LaunchpadFormView, FeedsMixin, BugsInfoMixin): |
879 | """Customize the onKeyPress event of the assignee chooser.""" |
880 | LaunchpadFormView.setUpWidgets(self) |
881 | |
882 | - self.widgets[ |
883 | - "assignee" |
884 | - ].onKeyPress = "selectWidget('assignee_option', event)" |
885 | + self.widgets["assignee"].onKeyPress = ( |
886 | + "selectWidget('assignee_option', event)" |
887 | + ) |
888 | |
889 | def validate(self, data): |
890 | """Validates the form.""" |
891 | @@ -1323,13 +1323,13 @@ class BugTaskSearchListingView(LaunchpadFormView, FeedsMixin, BugsInfoMixin): |
892 | has_blueprints = data.get("has_blueprints", True) |
893 | has_no_blueprints = data.get("has_no_blueprints", True) |
894 | if has_blueprints and not has_no_blueprints: |
895 | - data[ |
896 | - "linked_blueprints" |
897 | - ] = BugBlueprintSearch.BUGS_WITH_BLUEPRINTS |
898 | + data["linked_blueprints"] = ( |
899 | + BugBlueprintSearch.BUGS_WITH_BLUEPRINTS |
900 | + ) |
901 | elif not has_blueprints and has_no_blueprints: |
902 | - data[ |
903 | - "linked_blueprints" |
904 | - ] = BugBlueprintSearch.BUGS_WITHOUT_BLUEPRINTS |
905 | + data["linked_blueprints"] = ( |
906 | + BugBlueprintSearch.BUGS_WITHOUT_BLUEPRINTS |
907 | + ) |
908 | else: |
909 | data["linked_blueprints"] = BugBlueprintSearch.ALL |
910 | |
911 | diff --git a/lib/lp/bugs/browser/bugsubscription.py b/lib/lp/bugs/browser/bugsubscription.py |
912 | index 7d8a776..c722a4a 100644 |
913 | --- a/lib/lp/bugs/browser/bugsubscription.py |
914 | +++ b/lib/lp/bugs/browser/bugsubscription.py |
915 | @@ -152,9 +152,9 @@ class AdvancedSubscriptionMixin: |
916 | self.form_fields += formlib.form.Fields( |
917 | self._bug_notification_level_field |
918 | ) |
919 | - self.form_fields[ |
920 | - "bug_notification_level" |
921 | - ].custom_widget = CustomWidgetFactory(RadioWidget) |
922 | + self.form_fields["bug_notification_level"].custom_widget = ( |
923 | + CustomWidgetFactory(RadioWidget) |
924 | + ) |
925 | |
926 | |
927 | class BugSubscriptionSubscribeSelfView( |
928 | @@ -341,9 +341,9 @@ class BugSubscriptionSubscribeSelfView( |
929 | """See `LaunchpadFormView`.""" |
930 | super().setUpWidgets() |
931 | self.widgets["subscription"].widget_class = "bug-subscription-basic" |
932 | - self.widgets[ |
933 | - "bug_notification_level" |
934 | - ].widget_class = "bug-notification-level-field" |
935 | + self.widgets["bug_notification_level"].widget_class = ( |
936 | + "bug-notification-level-field" |
937 | + ) |
938 | if len(self.form_fields["subscription"].field.vocabulary) == 1: |
939 | # We hide the subscription widget if the user isn't |
940 | # subscribed, since we know who the subscriber is and we |
941 | diff --git a/lib/lp/bugs/browser/bugtarget.py b/lib/lp/bugs/browser/bugtarget.py |
942 | index 6e4b6f8..cd5b919 100644 |
943 | --- a/lib/lp/bugs/browser/bugtarget.py |
944 | +++ b/lib/lp/bugs/browser/bugtarget.py |
945 | @@ -266,9 +266,9 @@ class FileBugViewBase(LaunchpadFormView): |
946 | excluded_items=[BugTaskImportance.UNKNOWN], |
947 | ) |
948 | cache.objects["bugtask_importance_data"] = bugtask_importance_data |
949 | - cache.objects[ |
950 | - "enable_bugfiling_duplicate_search" |
951 | - ] = self.context.enable_bugfiling_duplicate_search |
952 | + cache.objects["enable_bugfiling_duplicate_search"] = ( |
953 | + self.context.enable_bugfiling_duplicate_search |
954 | + ) |
955 | |
956 | super().initialize() |
957 | |
958 | @@ -483,9 +483,9 @@ class FileBugViewBase(LaunchpadFormView): |
959 | super().setUpWidgets() |
960 | |
961 | if "packagename" in self.field_names: |
962 | - self.widgets[ |
963 | - "packagename" |
964 | - ].onKeyPress = "selectWidget('choose', event)" |
965 | + self.widgets["packagename"].onKeyPress = ( |
966 | + "selectWidget('choose', event)" |
967 | + ) |
968 | |
969 | def setUpFields(self): |
970 | """Set up the form fields. See `LaunchpadFormView`.""" |
971 | diff --git a/lib/lp/bugs/browser/bugtracker.py b/lib/lp/bugs/browser/bugtracker.py |
972 | index 07389e1..ee92930 100644 |
973 | --- a/lib/lp/bugs/browser/bugtracker.py |
974 | +++ b/lib/lp/bugs/browser/bugtracker.py |
975 | @@ -320,9 +320,11 @@ class BugTrackerEditView(LaunchpadEditFormView): |
976 | # let's just escape them anyway. |
977 | aliases_errors = self.widgets["aliases"]._error.errors.args[0] |
978 | maybe_structured_errors = [ |
979 | - structured(error) |
980 | - if isinstance(error, LaunchpadValidationError) |
981 | - else error |
982 | + ( |
983 | + structured(error) |
984 | + if isinstance(error, LaunchpadValidationError) |
985 | + else error |
986 | + ) |
987 | for error in aliases_errors |
988 | ] |
989 | self.setFieldError( |
990 | diff --git a/lib/lp/bugs/browser/structuralsubscription.py b/lib/lp/bugs/browser/structuralsubscription.py |
991 | index 95e5145..ec278f7 100644 |
992 | --- a/lib/lp/bugs/browser/structuralsubscription.py |
993 | +++ b/lib/lp/bugs/browser/structuralsubscription.py |
994 | @@ -66,7 +66,6 @@ class StructuralSubscriptionNavigation(Navigation): |
995 | |
996 | |
997 | class StructuralSubscriptionView(LaunchpadFormView): |
998 | - |
999 | """View class for structural subscriptions.""" |
1000 | |
1001 | schema = IStructuralSubscriptionForm |
1002 | diff --git a/lib/lp/bugs/browser/tests/bugtask-adding-views.rst b/lib/lp/bugs/browser/tests/bugtask-adding-views.rst |
1003 | index 6830c37..642e9ce 100644 |
1004 | --- a/lib/lp/bugs/browser/tests/bugtask-adding-views.rst |
1005 | +++ b/lib/lp/bugs/browser/tests/bugtask-adding-views.rst |
1006 | @@ -345,9 +345,9 @@ If the URL is valid but there's no bugtracker registered with that URL, |
1007 | we ask the user if they want to register the bugtracker as well. |
1008 | |
1009 | >>> form["field.product"] = "aptoncd" |
1010 | - >>> form[ |
1011 | - ... "field.bug_url" |
1012 | - ... ] = "http://bugzilla.somewhere.org/bugs/show_bug.cgi?id=84" |
1013 | + >>> form["field.bug_url"] = ( |
1014 | + ... "http://bugzilla.somewhere.org/bugs/show_bug.cgi?id=84" |
1015 | + ... ) |
1016 | >>> add_task_view = get_and_setup_view( |
1017 | ... firefox_task, "+choose-affected-product", form |
1018 | ... ) |
1019 | @@ -380,12 +380,12 @@ If we specify a URL of an already registered bug tracker, both the task |
1020 | and the bug watch will be added without any confirmation needed: |
1021 | |
1022 | >>> form["field.product"] = "alsa-utils" |
1023 | - >>> form[ |
1024 | - ... "field.bug_url" |
1025 | - ... ] = "http://bugzilla.gnome.org/bugs/show_bug.cgi?id=84" |
1026 | - >>> form[ |
1027 | - ... "field.__visited_steps__" |
1028 | - ... ] = "choose_product|specify_remote_bug_url" |
1029 | + >>> form["field.bug_url"] = ( |
1030 | + ... "http://bugzilla.gnome.org/bugs/show_bug.cgi?id=84" |
1031 | + ... ) |
1032 | + >>> form["field.__visited_steps__"] = ( |
1033 | + ... "choose_product|specify_remote_bug_url" |
1034 | + ... ) |
1035 | >>> add_task_view = get_and_setup_view( |
1036 | ... firefox_task, "+choose-affected-product", form |
1037 | ... ) |
1038 | diff --git a/lib/lp/bugs/browser/tests/test_bugtask.py b/lib/lp/bugs/browser/tests/test_bugtask.py |
1039 | index cfa6b9b..2a1eb92 100644 |
1040 | --- a/lib/lp/bugs/browser/tests/test_bugtask.py |
1041 | +++ b/lib/lp/bugs/browser/tests/test_bugtask.py |
1042 | @@ -280,9 +280,9 @@ class TestBugTaskView(TestCaseWithFactory): |
1043 | milestone = self.factory.makeMilestone(product=product) |
1044 | with person_logged_in(subscriber): |
1045 | structsub = milestone.addBugSubscription(subscriber, subscriber) |
1046 | - structsub.bug_filters[ |
1047 | - 0 |
1048 | - ].bug_notification_level = BugNotificationLevel.LIFECYCLE |
1049 | + structsub.bug_filters[0].bug_notification_level = ( |
1050 | + BugNotificationLevel.LIFECYCLE |
1051 | + ) |
1052 | bug = self.factory.makeBug(target=product) |
1053 | with person_logged_in(product.owner): |
1054 | form_data = { |
1055 | @@ -1449,9 +1449,9 @@ class TestBugTaskEditViewStatusField(TestCaseWithFactory): |
1056 | def test_status_field_bug_task_in_status_expired(self): |
1057 | # If a bugtask has the status Expired, this status is included |
1058 | # in the options. |
1059 | - removeSecurityProxy( |
1060 | - self.bug.default_bugtask |
1061 | - )._status = BugTaskStatus.EXPIRED |
1062 | + removeSecurityProxy(self.bug.default_bugtask)._status = ( |
1063 | + BugTaskStatus.EXPIRED |
1064 | + ) |
1065 | no_priv = getUtility(IPersonSet).getByName("no-priv") |
1066 | self.assertStatuses( |
1067 | [ |
1068 | @@ -1742,12 +1742,12 @@ class TestBugTaskEditView(WithScenarios, TestCaseWithFactory): |
1069 | url = canonical_url(bug_task, view_name="+editstatus") |
1070 | browser = self.getUserBrowser(url, user=bug_task.owner) |
1071 | browser.getControl(name="ubuntu.target").value = "package" |
1072 | - browser.getControl( |
1073 | - name="ubuntu.target.distribution" |
1074 | - ).value = oci_distro_name |
1075 | - browser.getControl( |
1076 | - name="ubuntu.target.package" |
1077 | - ).value = oci_project_name |
1078 | + browser.getControl(name="ubuntu.target.distribution").value = ( |
1079 | + oci_distro_name |
1080 | + ) |
1081 | + browser.getControl(name="ubuntu.target.package").value = ( |
1082 | + oci_project_name |
1083 | + ) |
1084 | browser.getControl("Save Changes").click() |
1085 | |
1086 | with admin_logged_in(): |
1087 | @@ -1771,9 +1771,9 @@ class TestBugTaskEditView(WithScenarios, TestCaseWithFactory): |
1088 | url = canonical_url(bug_task, view_name="+editstatus") |
1089 | browser = self.getUserBrowser(url, user=bug_task.owner) |
1090 | browser.getControl(name="oci-distro.target").value = "package" |
1091 | - browser.getControl( |
1092 | - name="oci-distro.target.distribution" |
1093 | - ).value = "ubuntu" |
1094 | + browser.getControl(name="oci-distro.target.distribution").value = ( |
1095 | + "ubuntu" |
1096 | + ) |
1097 | browser.getControl(name="oci-distro.target.package").value = "" |
1098 | browser.getControl("Save Changes").click() |
1099 | |
1100 | @@ -1800,9 +1800,9 @@ class TestBugTaskEditView(WithScenarios, TestCaseWithFactory): |
1101 | url = canonical_url(bug_task, view_name="+editstatus") |
1102 | browser = self.getUserBrowser(url, user=bug_task.owner) |
1103 | browser.getControl(name="oci-distro.target").value = "package" |
1104 | - browser.getControl( |
1105 | - name="oci-distro.target.distribution" |
1106 | - ).value = "ubuntu" |
1107 | + browser.getControl(name="oci-distro.target.distribution").value = ( |
1108 | + "ubuntu" |
1109 | + ) |
1110 | browser.getControl(name="oci-distro.target.package").value = sp.name |
1111 | browser.getControl("Save Changes").click() |
1112 | |
1113 | diff --git a/lib/lp/bugs/doc/externalbugtracker-comment-imports.rst b/lib/lp/bugs/doc/externalbugtracker-comment-imports.rst |
1114 | index a861c4c..a0a67b0 100644 |
1115 | --- a/lib/lp/bugs/doc/externalbugtracker-comment-imports.rst |
1116 | +++ b/lib/lp/bugs/doc/externalbugtracker-comment-imports.rst |
1117 | @@ -192,9 +192,9 @@ is associated with the existing person. |
1118 | ... "No Priv", |
1119 | ... "no-priv@canonical.com", |
1120 | ... ) |
1121 | - >>> external_bugtracker.remote_comments[ |
1122 | - ... "no-priv-comment" |
1123 | - ... ] = "The fifth comment." |
1124 | + >>> external_bugtracker.remote_comments["no-priv-comment"] = ( |
1125 | + ... "The fifth comment." |
1126 | + ... ) |
1127 | |
1128 | >>> transaction.commit() |
1129 | |
1130 | @@ -211,9 +211,9 @@ method will return a tuple of (displayname, None), which can then be |
1131 | used to create a Person based on the displayname alone. |
1132 | |
1133 | >>> external_bugtracker.poster_tuple = ("noemail", None) |
1134 | - >>> external_bugtracker.remote_comments[ |
1135 | - ... "no-email-comment" |
1136 | - ... ] = "Yet another comment." |
1137 | + >>> external_bugtracker.remote_comments["no-email-comment"] = ( |
1138 | + ... "Yet another comment." |
1139 | + ... ) |
1140 | |
1141 | >>> transaction.commit() |
1142 | |
1143 | @@ -237,9 +237,9 @@ created for them) an error will be logged and the comment will not be |
1144 | imported. |
1145 | |
1146 | >>> external_bugtracker.poster_tuple = (None, None) |
1147 | - >>> external_bugtracker.remote_comments[ |
1148 | - ... "invalid-person-comment" |
1149 | - ... ] = "This will not be imported." |
1150 | + >>> external_bugtracker.remote_comments["invalid-person-comment"] = ( |
1151 | + ... "This will not be imported." |
1152 | + ... ) |
1153 | |
1154 | >>> transaction.commit() |
1155 | |
1156 | @@ -464,9 +464,9 @@ includes a CVE reference appear to come from a valid Launchpad user. |
1157 | ... foo_bar.displayname, |
1158 | ... foo_bar.preferredemail.email, |
1159 | ... ) |
1160 | - >>> external_bugtracker.remote_comments[ |
1161 | - ... "6" |
1162 | - ... ] = "Another comment, another CVE: CVE-1999-0593." |
1163 | + >>> external_bugtracker.remote_comments["6"] = ( |
1164 | + ... "Another comment, another CVE: CVE-1999-0593." |
1165 | + ... ) |
1166 | |
1167 | Once again, CVE links are created but no karma is assigned. |
1168 | |
1169 | diff --git a/lib/lp/bugs/doc/externalbugtracker-debbugs.rst b/lib/lp/bugs/doc/externalbugtracker-debbugs.rst |
1170 | index 34861ea..8201177 100644 |
1171 | --- a/lib/lp/bugs/doc/externalbugtracker-debbugs.rst |
1172 | +++ b/lib/lp/bugs/doc/externalbugtracker-debbugs.rst |
1173 | @@ -599,18 +599,18 @@ correct date. |
1174 | If we add a Received header that isn't related to the domain of the |
1175 | current instance, the Date header will still have precedence. |
1176 | |
1177 | - >>> test_message[ |
1178 | - ... "received" |
1179 | - ... ] = "by thiswontwork.com; Tue, 15 Jul 2008 09:12:11 +0100" |
1180 | + >>> test_message["received"] = ( |
1181 | + ... "by thiswontwork.com; Tue, 15 Jul 2008 09:12:11 +0100" |
1182 | + ... ) |
1183 | >>> external_debbugs._getDateForComment(test_message) |
1184 | datetime.datetime(2008, 7, 14, 20, 10, 10, tzinfo=datetime.timezone.utc) |
1185 | |
1186 | If there's a Received header that references the correct domain, the |
1187 | date in that header will take precedence. |
1188 | |
1189 | - >>> test_message[ |
1190 | - ... "received" |
1191 | - ... ] = "by example.com; Tue, 15 Jul 2008 10:20:11 +0100" |
1192 | + >>> test_message["received"] = ( |
1193 | + ... "by example.com; Tue, 15 Jul 2008 10:20:11 +0100" |
1194 | + ... ) |
1195 | >>> external_debbugs._getDateForComment(test_message) |
1196 | datetime.datetime(2008, 7, 15, 9, 20, 11, tzinfo=datetime.timezone.utc) |
1197 | |
1198 | diff --git a/lib/lp/bugs/doc/externalbugtracker.rst b/lib/lp/bugs/doc/externalbugtracker.rst |
1199 | index b2288ef..8b380b9 100644 |
1200 | --- a/lib/lp/bugs/doc/externalbugtracker.rst |
1201 | +++ b/lib/lp/bugs/doc/externalbugtracker.rst |
1202 | @@ -90,9 +90,9 @@ remote server. |
1203 | >>> def get_trackers_and_watches(bugtracker, watches): |
1204 | ... transaction.commit() |
1205 | ... try: |
1206 | - ... BUG_TRACKER_CLASSES[ |
1207 | - ... BugTrackerType.BUGZILLA |
1208 | - ... ] = NonConnectingBugzilla |
1209 | + ... BUG_TRACKER_CLASSES[BugTrackerType.BUGZILLA] = ( |
1210 | + ... NonConnectingBugzilla |
1211 | + ... ) |
1212 | ... trackers_and_watches = ( |
1213 | ... bug_watch_updater._getExternalBugTrackersAndWatches( |
1214 | ... bugtracker, watches |
1215 | diff --git a/lib/lp/bugs/mail/newbug.py b/lib/lp/bugs/mail/newbug.py |
1216 | index aa44bd2..ca6cff8 100644 |
1217 | --- a/lib/lp/bugs/mail/newbug.py |
1218 | +++ b/lib/lp/bugs/mail/newbug.py |
1219 | @@ -81,26 +81,26 @@ def generate_bug_add_email( |
1220 | |
1221 | if modified_bugtask.assignee.is_team: |
1222 | contents += 'your team "%(team_name)s" ' |
1223 | - content_substitutions[ |
1224 | - "team_name" |
1225 | - ] = modified_bugtask.assignee.display_name |
1226 | + content_substitutions["team_name"] = ( |
1227 | + modified_bugtask.assignee.display_name |
1228 | + ) |
1229 | else: |
1230 | contents += "you " |
1231 | |
1232 | contents += "for %(target)s" |
1233 | - content_substitutions[ |
1234 | - "assigner" |
1235 | - ] = event_creator.unique_displayname |
1236 | - content_substitutions[ |
1237 | - "target" |
1238 | - ] = modified_bugtask.target.displayname |
1239 | + content_substitutions["assigner"] = ( |
1240 | + event_creator.unique_displayname |
1241 | + ) |
1242 | + content_substitutions["target"] = ( |
1243 | + modified_bugtask.target.displayname |
1244 | + ) |
1245 | else: |
1246 | contents += "You have been subscribed to a %(visibility)s bug" |
1247 | if subscribed_by is not None: |
1248 | contents += " by %(subscribed_by)s" |
1249 | - content_substitutions[ |
1250 | - "subscribed_by" |
1251 | - ] = subscribed_by.unique_displayname |
1252 | + content_substitutions["subscribed_by"] = ( |
1253 | + subscribed_by.unique_displayname |
1254 | + ) |
1255 | contents += ":\n\n" "%(description)s\n\n%(bug_info)s" |
1256 | # The visibility appears mid-phrase so.. hack hack. |
1257 | content_substitutions["visibility"] = visibility.lower() |
1258 | diff --git a/lib/lp/bugs/model/tests/test_bug.py b/lib/lp/bugs/model/tests/test_bug.py |
1259 | index 103cf98..1697658 100644 |
1260 | --- a/lib/lp/bugs/model/tests/test_bug.py |
1261 | +++ b/lib/lp/bugs/model/tests/test_bug.py |
1262 | @@ -1019,9 +1019,9 @@ class TestBugPrivacy(TestCaseWithFactory): |
1263 | bug = self.factory.makeBug( |
1264 | target=product, information_type=InformationType.PUBLICSECURITY |
1265 | ) |
1266 | - removeSecurityProxy( |
1267 | - product |
1268 | - ).bug_sharing_policy = BugSharingPolicy.FORBIDDEN |
1269 | + removeSecurityProxy(product).bug_sharing_policy = ( |
1270 | + BugSharingPolicy.FORBIDDEN |
1271 | + ) |
1272 | self.assertContentEqual( |
1273 | [InformationType.PUBLICSECURITY], |
1274 | bug.getAllowedInformationTypes(None), |
1275 | diff --git a/lib/lp/bugs/model/tests/test_bugsummary.py b/lib/lp/bugs/model/tests/test_bugsummary.py |
1276 | index de50b73..b7801bf 100644 |
1277 | --- a/lib/lp/bugs/model/tests/test_bugsummary.py |
1278 | +++ b/lib/lp/bugs/model/tests/test_bugsummary.py |
1279 | @@ -481,9 +481,9 @@ class TestBugSummary(TestCaseWithFactory): |
1280 | sourcepackagename=sourcepackage_b.sourcepackagename, |
1281 | ) |
1282 | |
1283 | - removeSecurityProxy( |
1284 | - bug_task |
1285 | - ).sourcepackagename = sourcepackage_b.sourcepackagename |
1286 | + removeSecurityProxy(bug_task).sourcepackagename = ( |
1287 | + sourcepackage_b.sourcepackagename |
1288 | + ) |
1289 | |
1290 | self.assertCount(1, distribution=distribution, sourcepackagename=None) |
1291 | self.assertCount( |
1292 | diff --git a/lib/lp/bugs/model/tests/test_bugtask.py b/lib/lp/bugs/model/tests/test_bugtask.py |
1293 | index 81e242c..f607999 100644 |
1294 | --- a/lib/lp/bugs/model/tests/test_bugtask.py |
1295 | +++ b/lib/lp/bugs/model/tests/test_bugtask.py |
1296 | @@ -708,7 +708,6 @@ class TestBugTaskTags(TestCase): |
1297 | |
1298 | |
1299 | class TestBugTaskBadges(TestCaseWithFactory): |
1300 | - |
1301 | """Verify getBugTaskBadgeProperties""" |
1302 | |
1303 | layer = DatabaseFunctionalLayer |
1304 | diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-also-affects-new-upstream.rst b/lib/lp/bugs/stories/bug-also-affects/xx-also-affects-new-upstream.rst |
1305 | index bfe9b75..b67bcd2 100644 |
1306 | --- a/lib/lp/bugs/stories/bug-also-affects/xx-also-affects-new-upstream.rst |
1307 | +++ b/lib/lp/bugs/stories/bug-also-affects/xx-also-affects-new-upstream.rst |
1308 | @@ -12,9 +12,9 @@ The test browser does not support javascript |
1309 | >>> user_browser.open( |
1310 | ... "http://bugs.launchpad.test/firefox/+bug/1/+affects-new-product" |
1311 | ... ) |
1312 | - >>> user_browser.getControl( |
1313 | - ... "Bug URL" |
1314 | - ... ).value = "http://bugs.foo.org/bugs/show_bug.cgi?id=42" |
1315 | + >>> user_browser.getControl("Bug URL").value = ( |
1316 | + ... "http://bugs.foo.org/bugs/show_bug.cgi?id=42" |
1317 | + ... ) |
1318 | >>> user_browser.getControl("Project name").value = "The Foo Project" |
1319 | >>> user_browser.getControl("Project ID").value = "foo" |
1320 | >>> user_browser.getControl("Project summary").value = "The Foo Project" |
1321 | @@ -37,9 +37,9 @@ for the user to use as the affected upstream. |
1322 | ... ) |
1323 | >>> print(user_browser.title) |
1324 | Register project affected by... |
1325 | - >>> user_browser.getControl( |
1326 | - ... "Bug URL" |
1327 | - ... ).value = "http://bugs.foo.org/bugs/show_bug.cgi?id=421" |
1328 | + >>> user_browser.getControl("Bug URL").value = ( |
1329 | + ... "http://bugs.foo.org/bugs/show_bug.cgi?id=421" |
1330 | + ... ) |
1331 | >>> user_browser.getControl("Project name").value = "The Bar Project" |
1332 | >>> user_browser.getControl("Project ID").value = "bar" |
1333 | >>> user_browser.getControl("Project summary").value = "The Bar Project" |
1334 | @@ -90,9 +90,9 @@ Now we'll tell Launchpad to not use the existing upstream as we want to report |
1335 | the bug as affecting another (unregistered) upstream. |
1336 | |
1337 | >>> user_browser.goBack() |
1338 | - >>> user_browser.getControl( |
1339 | - ... "Bug URL" |
1340 | - ... ).value = "http://bugs.foo.org/bugs/show_bug.cgi?id=123" |
1341 | + >>> user_browser.getControl("Bug URL").value = ( |
1342 | + ... "http://bugs.foo.org/bugs/show_bug.cgi?id=123" |
1343 | + ... ) |
1344 | >>> user_browser.getControl("Continue").click() |
1345 | >>> user_browser.title |
1346 | 'Bug #2 (blackhole) ... : Bugs : The Bar Project' |
1347 | @@ -109,9 +109,9 @@ user and ask them to check if it's correct. |
1348 | >>> user_browser.open( |
1349 | ... "http://bugs.launchpad.test/firefox/+bug/1/+affects-new-product" |
1350 | ... ) |
1351 | - >>> user_browser.getControl( |
1352 | - ... "Bug URL" |
1353 | - ... ).value = "http://foo.org/notabug.cgi?id=42" |
1354 | + >>> user_browser.getControl("Bug URL").value = ( |
1355 | + ... "http://foo.org/notabug.cgi?id=42" |
1356 | + ... ) |
1357 | >>> user_browser.getControl("Project name").value = "Foo Project" |
1358 | >>> user_browser.getControl("Project ID").value = "bazfoo" |
1359 | >>> user_browser.getControl("Project summary").value = "The Foo Project" |
1360 | diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.rst b/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.rst |
1361 | index c9b9188..606b8a1 100644 |
1362 | --- a/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.rst |
1363 | +++ b/lib/lp/bugs/stories/bug-also-affects/xx-bug-also-affects.rst |
1364 | @@ -56,9 +56,9 @@ Let's assign the existing Ubuntu task to mozilla-firefox, then add |
1365 | another task on Ubuntu evolution. |
1366 | |
1367 | >>> browser.open("http://localhost/ubuntu/+bug/6/+editstatus") |
1368 | - >>> browser.getControl( |
1369 | - ... name="ubuntu.target.package" |
1370 | - ... ).value = "mozilla-firefox" |
1371 | + >>> browser.getControl(name="ubuntu.target.package").value = ( |
1372 | + ... "mozilla-firefox" |
1373 | + ... ) |
1374 | >>> browser.getControl("Save Changes").click() |
1375 | |
1376 | >>> browser.open( |
1377 | @@ -94,9 +94,9 @@ Launchpad, we add a bug watch as well. |
1378 | |
1379 | >>> browser.getControl(name="field.distribution").value = ["debian"] |
1380 | >>> browser.getControl("Source Package Name").value = "alsa-utils" |
1381 | - >>> browser.getControl( |
1382 | - ... "URL" |
1383 | - ... ).value = "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=123" |
1384 | + >>> browser.getControl("URL").value = ( |
1385 | + ... "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=123" |
1386 | + ... ) |
1387 | >>> browser.getControl("Continue").click() |
1388 | >>> print(browser.url) |
1389 | http://bugs.launchpad.test/debian/+source/alsa-utils/+bug/1 |
1390 | @@ -107,9 +107,9 @@ error, because Ubuntu uses Launchpad as its bug tracker |
1391 | >>> browser.getLink(url="+distrotask").click() |
1392 | >>> browser.getControl("Distribution").value = ["ubuntu"] |
1393 | >>> browser.getControl("Source Package Name").value = "alsa-utils" |
1394 | - >>> browser.getControl( |
1395 | - ... "URL" |
1396 | - ... ).value = "https://bugzilla.mozilla.org/show_bug.cgi?id=84" |
1397 | + >>> browser.getControl("URL").value = ( |
1398 | + ... "https://bugzilla.mozilla.org/show_bug.cgi?id=84" |
1399 | + ... ) |
1400 | >>> browser.getControl("Continue").click() |
1401 | >>> print(browser.url) |
1402 | http://bugs.launchpad.test/debian/+source/alsa-utils/+bug/1/+distrotask |
1403 | @@ -393,9 +393,9 @@ need to make sure that everything is quoted before displaying the input. |
1404 | ... "/+choose-affected-product" |
1405 | ... ) |
1406 | |
1407 | - >>> user_browser.getControl( |
1408 | - ... "Project" |
1409 | - ... ).value = b"N\xc3\xb6 Such Product&<>" |
1410 | + >>> user_browser.getControl("Project").value = ( |
1411 | + ... b"N\xc3\xb6 Such Product&<>" |
1412 | + ... ) |
1413 | >>> user_browser.getControl("Continue").click() |
1414 | >>> print(user_browser.url) |
1415 | http://.../debian/+source/mozilla-firefox/+bug/3/+choose-affected-product |
1416 | @@ -420,9 +420,9 @@ white space in the bug URL it will be stripped. |
1417 | >>> user_browser.getControl("Continue").click() |
1418 | |
1419 | >>> user_browser.getControl("I have the URL").selected = True |
1420 | - >>> user_browser.getControl( |
1421 | - ... name="field.bug_url" |
1422 | - ... ).value = " https://bugzilla.mozilla.org/show_bug.cgi?id=1234 " |
1423 | + >>> user_browser.getControl(name="field.bug_url").value = ( |
1424 | + ... " https://bugzilla.mozilla.org/show_bug.cgi?id=1234 " |
1425 | + ... ) |
1426 | >>> user_browser.getControl("Add to Bug Report").click() |
1427 | |
1428 | Launchpad redirects to the newly created bugtask page, with a row for |
1429 | @@ -479,9 +479,9 @@ bugtask, our validator springs into action. |
1430 | >>> print(user_browser.url) |
1431 | http://bugs.launchpad.test/evolution/+bug/3/+editstatus |
1432 | |
1433 | - >>> user_browser.getControl( |
1434 | - ... name="evolution.target.product" |
1435 | - ... ).value = "alsa-utils" |
1436 | + >>> user_browser.getControl(name="evolution.target.product").value = ( |
1437 | + ... "alsa-utils" |
1438 | + ... ) |
1439 | >>> user_browser.getControl("Save Changes").click() |
1440 | >>> print(user_browser.url) |
1441 | http://bugs.launchpad.test/evolution/+bug/3/+editstatus |
1442 | @@ -511,9 +511,9 @@ the URL of the remote bug. |
1443 | http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product |
1444 | |
1445 | >>> user_browser.getControl("I have the URL").selected = True |
1446 | - >>> user_browser.getControl( |
1447 | - ... name="field.bug_url" |
1448 | - ... ).value = "http://bugzilla.gnome.org/bugs/show_bug.cgi?id=42" |
1449 | + >>> user_browser.getControl(name="field.bug_url").value = ( |
1450 | + ... "http://bugzilla.gnome.org/bugs/show_bug.cgi?id=42" |
1451 | + ... ) |
1452 | |
1453 | At this point, just in case we change our mind, there is a cancel link |
1454 | that points back to the bug page: |
1455 | @@ -549,9 +549,9 @@ URL is HTTP. |
1456 | http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product |
1457 | |
1458 | >>> user_browser.getControl("I have the URL").selected = True |
1459 | - >>> user_browser.getControl( |
1460 | - ... name="field.bug_url" |
1461 | - ... ).value = "https://bugzilla.gnome.org/bugs/show_bug.cgi?id=84" |
1462 | + >>> user_browser.getControl(name="field.bug_url").value = ( |
1463 | + ... "https://bugzilla.gnome.org/bugs/show_bug.cgi?id=84" |
1464 | + ... ) |
1465 | >>> user_browser.getControl("Add to Bug Report").click() |
1466 | >>> print(user_browser.url) |
1467 | http://bugs.launchpad.test/netapplet/+bug/4 |
1468 | @@ -580,9 +580,9 @@ tracker type it is), an error message is displayed. |
1469 | http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product |
1470 | |
1471 | >>> user_browser.getControl("I have the URL").selected = True |
1472 | - >>> user_browser.getControl( |
1473 | - ... name="field.bug_url" |
1474 | - ... ).value = "http://bugs.unknown/42" |
1475 | + >>> user_browser.getControl(name="field.bug_url").value = ( |
1476 | + ... "http://bugs.unknown/42" |
1477 | + ... ) |
1478 | >>> user_browser.getControl("Add to Bug Report").click() |
1479 | >>> print(user_browser.url) |
1480 | http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product |
1481 | @@ -597,9 +597,9 @@ If the URL can be recognised as a valid bug URL, but no such tracker is |
1482 | registered in Launchpad, the user will be prompted to register it first. |
1483 | |
1484 | >>> user_browser.getControl("I have the URL").selected = True |
1485 | - >>> user_browser.getControl( |
1486 | - ... name="field.bug_url" |
1487 | - ... ).value = "http://new.trac/ticket/42" |
1488 | + >>> user_browser.getControl(name="field.bug_url").value = ( |
1489 | + ... "http://new.trac/ticket/42" |
1490 | + ... ) |
1491 | >>> user_browser.getControl("Add to Bug Report").click() |
1492 | >>> print(user_browser.url) |
1493 | http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product |
1494 | @@ -651,9 +651,9 @@ it to HTTP on their behalf: |
1495 | http://bugs.launchpad.test/firefox/+bug/4/+choose-affected-product |
1496 | |
1497 | >>> user_browser.getControl("I have the URL").selected = True |
1498 | - >>> user_browser.getControl( |
1499 | - ... name="field.bug_url" |
1500 | - ... ).value = "bugzilla.gnome.org/bugs/show_bug.cgi?id=168" |
1501 | + >>> user_browser.getControl(name="field.bug_url").value = ( |
1502 | + ... "bugzilla.gnome.org/bugs/show_bug.cgi?id=168" |
1503 | + ... ) |
1504 | >>> user_browser.getControl("Add to Bug Report").click() |
1505 | >>> print(user_browser.url) |
1506 | http://bugs.launchpad.test/thunderbird/+bug/4 |
1507 | diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-duplicate-bugwatches.rst b/lib/lp/bugs/stories/bug-also-affects/xx-duplicate-bugwatches.rst |
1508 | index c391d80..0b36279 100644 |
1509 | --- a/lib/lp/bugs/stories/bug-also-affects/xx-duplicate-bugwatches.rst |
1510 | +++ b/lib/lp/bugs/stories/bug-also-affects/xx-duplicate-bugwatches.rst |
1511 | @@ -82,9 +82,9 @@ duplicates. |
1512 | >>> user_browser.open("http://launchpad.test/bugs/5") |
1513 | >>> user_browser.getLink(url="+distrotask").click() |
1514 | >>> user_browser.getControl("Distribution").value = ["debian"] |
1515 | - >>> user_browser.getControl( |
1516 | - ... "Source Package Name" |
1517 | - ... ).value = "mozilla-firefox" |
1518 | + >>> user_browser.getControl("Source Package Name").value = ( |
1519 | + ... "mozilla-firefox" |
1520 | + ... ) |
1521 | >>> user_browser.getControl("URL").value = debian_bug |
1522 | >>> user_browser.getControl("Continue").click() |
1523 | >>> print_feedback_messages(user_browser.contents) |
1524 | diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-request-distribution-no-release-fix.rst b/lib/lp/bugs/stories/bug-also-affects/xx-request-distribution-no-release-fix.rst |
1525 | index 3a017c1..777ca05 100644 |
1526 | --- a/lib/lp/bugs/stories/bug-also-affects/xx-request-distribution-no-release-fix.rst |
1527 | +++ b/lib/lp/bugs/stories/bug-also-affects/xx-request-distribution-no-release-fix.rst |
1528 | @@ -45,9 +45,9 @@ link to a external bug for it. |
1529 | >>> user_browser.getLink("Also affects distribution/package").click() |
1530 | >>> user_browser.getControl("Distribution").value = ["gentoo"] |
1531 | >>> user_browser.getControl("Source Package").value = "" |
1532 | - >>> user_browser.getControl( |
1533 | - ... "URL" |
1534 | - ... ).value = "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1234" |
1535 | + >>> user_browser.getControl("URL").value = ( |
1536 | + ... "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1234" |
1537 | + ... ) |
1538 | >>> user_browser.getControl("Continue").click() |
1539 | >>> user_browser.url |
1540 | 'http://bugs.launchpad.test/gentoo/+bug/7' |
1541 | diff --git a/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.rst b/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.rst |
1542 | index 18ccad3..1536372 100644 |
1543 | --- a/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.rst |
1544 | +++ b/lib/lp/bugs/stories/bug-also-affects/xx-upstream-bugtracker-links.rst |
1545 | @@ -33,9 +33,9 @@ to reflect this. |
1546 | ... "http://launchpad.test/thunderbird/+configure-bugtracker" |
1547 | ... ) |
1548 | >>> admin_browser.getControl(name="field.bugtracker").value = ["external"] |
1549 | - >>> admin_browser.getControl( |
1550 | - ... name="field.bugtracker.bugtracker" |
1551 | - ... ).value = "mozilla.org" |
1552 | + >>> admin_browser.getControl(name="field.bugtracker.bugtracker").value = ( |
1553 | + ... "mozilla.org" |
1554 | + ... ) |
1555 | >>> admin_browser.getControl("Change").click() |
1556 | |
1557 | >>> user_browser.open("http://launchpad.test/bugs/13/") |
1558 | @@ -97,12 +97,12 @@ filing link, such as Debbugs, only a search link will be displayed. |
1559 | >>> admin_browser.open( |
1560 | ... "http://launchpad.test/gnome-terminal/+configure-bugtracker" |
1561 | ... ) |
1562 | - >>> admin_browser.getControl( |
1563 | - ... "In a registered bug tracker:" |
1564 | - ... ).selected = True |
1565 | - >>> admin_browser.getControl( |
1566 | - ... name="field.bugtracker.bugtracker" |
1567 | - ... ).value = "debbugs" |
1568 | + >>> admin_browser.getControl("In a registered bug tracker:").selected = ( |
1569 | + ... True |
1570 | + ... ) |
1571 | + >>> admin_browser.getControl(name="field.bugtracker.bugtracker").value = ( |
1572 | + ... "debbugs" |
1573 | + ... ) |
1574 | >>> admin_browser.getControl("Change").click() |
1575 | |
1576 | >>> user_browser.open("http://launchpad.test/bugs/13/") |
1577 | @@ -129,9 +129,9 @@ tracker, can be set from the +configure-bugtracker page, too. |
1578 | >>> admin_browser.open( |
1579 | ... "http://launchpad.test/thunderbird/+configure-bugtracker" |
1580 | ... ) |
1581 | - >>> admin_browser.getControl( |
1582 | - ... name="field.remote_product" |
1583 | - ... ).value = "Thunderbird" |
1584 | + >>> admin_browser.getControl(name="field.remote_product").value = ( |
1585 | + ... "Thunderbird" |
1586 | + ... ) |
1587 | >>> admin_browser.getControl("Change").click() |
1588 | |
1589 | >>> admin_browser.open( |
1590 | diff --git a/lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.rst b/lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.rst |
1591 | index 4f3a13c..6dcbd8d 100644 |
1592 | --- a/lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.rst |
1593 | +++ b/lib/lp/bugs/stories/bug-privacy/xx-bug-privacy.rst |
1594 | @@ -31,9 +31,9 @@ bug page. |
1595 | |
1596 | The Ubuntu maintainer, Ubuntu Team, will be subscribed. |
1597 | |
1598 | - >>> browser.getControl( |
1599 | - ... name="field.title", index=0 |
1600 | - ... ).value = "a private bug" |
1601 | + >>> browser.getControl(name="field.title", index=0).value = ( |
1602 | + ... "a private bug" |
1603 | + ... ) |
1604 | >>> browser.getControl("Continue").click() |
1605 | |
1606 | >>> browser.getControl(name="packagename_option").value = ["choose"] |
1607 | diff --git a/lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.rst b/lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.rst |
1608 | index 9efcdce..bc1affa 100644 |
1609 | --- a/lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.rst |
1610 | +++ b/lib/lp/bugs/stories/bug-privacy/xx-presenting-private-bugs.rst |
1611 | @@ -31,9 +31,9 @@ bugs or where the product requests that bugs are private by default) |
1612 | have the full message: |
1613 | |
1614 | >>> browser.open("http://bugs.launchpad.test/firefox/+filebug") |
1615 | - >>> browser.getControl( |
1616 | - ... "Summary", index=0 |
1617 | - ... ).value = "Firefox crashes when I change the default route" |
1618 | + >>> browser.getControl("Summary", index=0).value = ( |
1619 | + ... "Firefox crashes when I change the default route" |
1620 | + ... ) |
1621 | >>> browser.getControl("Continue").click() |
1622 | |
1623 | >>> browser.getControl("Further information").value = "foo" |
1624 | diff --git a/lib/lp/bugs/stories/bug-tags/xx-searching-for-tags.rst b/lib/lp/bugs/stories/bug-tags/xx-searching-for-tags.rst |
1625 | index 6aeefa8..0e4541a 100644 |
1626 | --- a/lib/lp/bugs/stories/bug-tags/xx-searching-for-tags.rst |
1627 | +++ b/lib/lp/bugs/stories/bug-tags/xx-searching-for-tags.rst |
1628 | @@ -44,9 +44,9 @@ The tags field and its related messages are properly escaped in order |
1629 | to prevent XSS. |
1630 | |
1631 | >>> anon_browser.open("http://launchpad.test/ubuntu/+bugs?advanced=1") |
1632 | - >>> anon_browser.getControl( |
1633 | - ... "Tags" |
1634 | - ... ).value = '<script>alert("cheezburger");</script>' |
1635 | + >>> anon_browser.getControl("Tags").value = ( |
1636 | + ... '<script>alert("cheezburger");</script>' |
1637 | + ... ) |
1638 | >>> anon_browser.getControl("Search", index=0).click() |
1639 | |
1640 | The value can be obtained correctly, which indicates that the markup |
1641 | diff --git a/lib/lp/bugs/stories/bugattachments/xx-bugattachments.rst b/lib/lp/bugs/stories/bugattachments/xx-bugattachments.rst |
1642 | index 8816e6a..a6f30ab 100644 |
1643 | --- a/lib/lp/bugs/stories/bugattachments/xx-bugattachments.rst |
1644 | +++ b/lib/lp/bugs/stories/bugattachments/xx-bugattachments.rst |
1645 | @@ -25,12 +25,12 @@ attachment. |
1646 | >>> user_browser.getControl("Attachment").add_file( |
1647 | ... foo_file, "text/plain", "foo.txt" |
1648 | ... ) |
1649 | - >>> user_browser.getControl( |
1650 | - ... "Description" |
1651 | - ... ).value = " Some information " |
1652 | - >>> user_browser.getControl( |
1653 | - ... name="field.comment" |
1654 | - ... ).value = "Added some information" |
1655 | + >>> user_browser.getControl("Description").value = ( |
1656 | + ... " Some information " |
1657 | + ... ) |
1658 | + >>> user_browser.getControl(name="field.comment").value = ( |
1659 | + ... "Added some information" |
1660 | + ... ) |
1661 | >>> user_browser.getControl("Post Comment").click() |
1662 | |
1663 | After we added the attachment, we get redirected to the bug page. |
1664 | @@ -101,9 +101,9 @@ attachment. |
1665 | ... "This attachment contains a solution (patch) for this bug" |
1666 | ... ) |
1667 | >>> patch_control.selected = True |
1668 | - >>> user_browser.getControl( |
1669 | - ... name="field.comment" |
1670 | - ... ).value = "Added some information" |
1671 | + >>> user_browser.getControl(name="field.comment").value = ( |
1672 | + ... "Added some information" |
1673 | + ... ) |
1674 | >>> user_browser.getControl("Post Comment").click() |
1675 | >>> user_browser.url |
1676 | 'http://bugs.launchpad.test/firefox/+bug/1' |
1677 | @@ -123,9 +123,9 @@ the flag "this attachment is a patch"... |
1678 | ... "This attachment contains a solution (patch) for this bug" |
1679 | ... ) |
1680 | >>> patch_control.selected = False |
1681 | - >>> user_browser.getControl( |
1682 | - ... name="field.comment" |
1683 | - ... ).value = "Added even more information" |
1684 | + >>> user_browser.getControl(name="field.comment").value = ( |
1685 | + ... "Added even more information" |
1686 | + ... ) |
1687 | >>> user_browser.getControl("Post Comment").click() |
1688 | |
1689 | ...we are redirected to a page... |
1690 | @@ -256,9 +256,9 @@ when we tell it that plain text files whose names end in ".diff", |
1691 | ... "This attachment contains a solution (patch) for this bug" |
1692 | ... ) |
1693 | >>> patch_control.selected = True |
1694 | - >>> user_browser.getControl( |
1695 | - ... name="field.comment" |
1696 | - ... ).value = "Add foo3.diff as a patch." |
1697 | + >>> user_browser.getControl(name="field.comment").value = ( |
1698 | + ... "Add foo3.diff as a patch." |
1699 | + ... ) |
1700 | >>> user_browser.getControl("Post Comment").click() |
1701 | >>> user_browser.url |
1702 | 'http://bugs.launchpad.test/firefox/+bug/1' |
1703 | @@ -275,9 +275,9 @@ when we tell it that plain text files whose names end in ".diff", |
1704 | ... "This attachment contains a solution (patch) for this bug" |
1705 | ... ) |
1706 | >>> patch_control.selected = True |
1707 | - >>> user_browser.getControl( |
1708 | - ... name="field.comment" |
1709 | - ... ).value = "Add foo4.debdiff as a patch." |
1710 | + >>> user_browser.getControl(name="field.comment").value = ( |
1711 | + ... "Add foo4.debdiff as a patch." |
1712 | + ... ) |
1713 | >>> user_browser.getControl("Post Comment").click() |
1714 | >>> user_browser.url |
1715 | 'http://bugs.launchpad.test/firefox/+bug/1' |
1716 | @@ -294,9 +294,9 @@ when we tell it that plain text files whose names end in ".diff", |
1717 | ... "This attachment contains a solution (patch) for this bug" |
1718 | ... ) |
1719 | >>> patch_control.selected = True |
1720 | - >>> user_browser.getControl( |
1721 | - ... name="field.comment" |
1722 | - ... ).value = "Add foo5.patch as a patch." |
1723 | + >>> user_browser.getControl(name="field.comment").value = ( |
1724 | + ... "Add foo5.patch as a patch." |
1725 | + ... ) |
1726 | >>> user_browser.getControl("Post Comment").click() |
1727 | >>> user_browser.url |
1728 | 'http://bugs.launchpad.test/firefox/+bug/1' |
1729 | @@ -422,9 +422,9 @@ Let's add a normal text file... |
1730 | ... BytesIO(b"Traceback..."), "text/plain", "foo.txt" |
1731 | ... ) |
1732 | >>> user_browser.getControl("Description").value = "Some information." |
1733 | - >>> user_browser.getControl( |
1734 | - ... name="field.comment" |
1735 | - ... ).value = "Added some information." |
1736 | + >>> user_browser.getControl(name="field.comment").value = ( |
1737 | + ... "Added some information." |
1738 | + ... ) |
1739 | >>> user_browser.getControl("Post Comment").click() |
1740 | |
1741 | And a patch... |
1742 | @@ -439,9 +439,9 @@ And a patch... |
1743 | ... ) |
1744 | >>> user_browser.getControl("patch").selected = True |
1745 | >>> user_browser.getControl("Description").value = "A patch." |
1746 | - >>> user_browser.getControl( |
1747 | - ... name="field.comment" |
1748 | - ... ).value = "This patch fixes the bug." |
1749 | + >>> user_browser.getControl(name="field.comment").value = ( |
1750 | + ... "This patch fixes the bug." |
1751 | + ... ) |
1752 | >>> user_browser.getControl("Post Comment").click() |
1753 | |
1754 | And another patch... |
1755 | @@ -455,9 +455,9 @@ And another patch... |
1756 | ... ) |
1757 | >>> user_browser.getControl("patch").selected = True |
1758 | >>> user_browser.getControl("Description").value = "A patch." |
1759 | - >>> user_browser.getControl( |
1760 | - ... name="field.comment" |
1761 | - ... ).value = "This patch fixes the bug." |
1762 | + >>> user_browser.getControl(name="field.comment").value = ( |
1763 | + ... "This patch fixes the bug." |
1764 | + ... ) |
1765 | >>> user_browser.getControl("Post Comment").click() |
1766 | |
1767 | And now we'll search for patches for firefox bugs. |
1768 | diff --git a/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.rst b/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.rst |
1769 | index 9c0118b..a2db4e3 100644 |
1770 | --- a/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.rst |
1771 | +++ b/lib/lp/bugs/stories/bugattachments/xx-display-filesize-attachment.rst |
1772 | @@ -14,9 +14,9 @@ File size and mime type are displayed for each attachment |
1773 | ... foo_file, "text/plain", "foo.txt" |
1774 | ... ) |
1775 | >>> user_browser.getControl("Description").value = "description text" |
1776 | - >>> user_browser.getControl( |
1777 | - ... name="field.comment" |
1778 | - ... ).value = "comment comment" |
1779 | + >>> user_browser.getControl(name="field.comment").value = ( |
1780 | + ... "comment comment" |
1781 | + ... ) |
1782 | >>> user_browser.getControl("Post Comment").click() |
1783 | >>> user_browser.url |
1784 | 'http://bugs.launchpad.test/firefox/+bug/1' |
1785 | @@ -50,9 +50,9 @@ A filesize of 2700 byte is displayed in 'KiB' |
1786 | ... foo_file, "text/plain", "foo.txt" |
1787 | ... ) |
1788 | >>> user_browser.getControl("Description").value = "description text" |
1789 | - >>> user_browser.getControl( |
1790 | - ... name="field.comment" |
1791 | - ... ).value = "comment comment" |
1792 | + >>> user_browser.getControl(name="field.comment").value = ( |
1793 | + ... "comment comment" |
1794 | + ... ) |
1795 | >>> user_browser.getControl("Post Comment").click() |
1796 | >>> user_browser.url |
1797 | 'http://bugs.launchpad.test/firefox/+bug/1' |
1798 | diff --git a/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.rst b/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.rst |
1799 | index b971fa8..70d1976 100644 |
1800 | --- a/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.rst |
1801 | +++ b/lib/lp/bugs/stories/bugs/xx-add-comment-bugtask-edit.rst |
1802 | @@ -11,9 +11,9 @@ the comment to another comment field. |
1803 | >>> user_browser.open( |
1804 | ... "http://bugs.launchpad.test/firefox/+bug/1/+editstatus" |
1805 | ... ) |
1806 | - >>> user_browser.getControl( |
1807 | - ... "Comment" |
1808 | - ... ).value = "A comment with no change to the bug task." |
1809 | + >>> user_browser.getControl("Comment").value = ( |
1810 | + ... "A comment with no change to the bug task." |
1811 | + ... ) |
1812 | >>> user_browser.getControl("Save Changes").click() |
1813 | |
1814 | The user was returned to the bug page, and the comment was added. |
1815 | diff --git a/lib/lp/bugs/stories/bugs/xx-bug-activity.rst b/lib/lp/bugs/stories/bugs/xx-bug-activity.rst |
1816 | index bb385e0..e50de32 100644 |
1817 | --- a/lib/lp/bugs/stories/bugs/xx-bug-activity.rst |
1818 | +++ b/lib/lp/bugs/stories/bugs/xx-bug-activity.rst |
1819 | @@ -67,9 +67,9 @@ page. |
1820 | >>> user_browser.open( |
1821 | ... "http://bugs.launchpad.test/redfish/+bug/15/+addcomment" |
1822 | ... ) |
1823 | - >>> user_browser.getControl( |
1824 | - ... name="field.comment" |
1825 | - ... ).value = "Here's a comment for testing, like." |
1826 | + >>> user_browser.getControl(name="field.comment").value = ( |
1827 | + ... "Here's a comment for testing, like." |
1828 | + ... ) |
1829 | >>> user_browser.getControl("Post Comment").click() |
1830 | >>> print_comments(user_browser.contents, slice(None)) |
1831 | Revision history for this message |
1832 | @@ -112,9 +112,9 @@ Changes to the bug's description will simply be displayed as 'description: |
1833 | updated', since such changes can be quite long. |
1834 | |
1835 | >>> admin_browser.open("http://bugs.launchpad.test/redfish/+bug/15/+edit") |
1836 | - >>> admin_browser.getControl( |
1837 | - ... "Description" |
1838 | - ... ).value = "I've changed the description, isn't that excellent?" |
1839 | + >>> admin_browser.getControl("Description").value = ( |
1840 | + ... "I've changed the description, isn't that excellent?" |
1841 | + ... ) |
1842 | >>> admin_browser.getControl("Change").click() |
1843 | |
1844 | >>> admin_browser.open("http://launchpad.test/bugs/15") |
1845 | diff --git a/lib/lp/bugs/stories/bugs/xx-bug-comment-attach-file.rst b/lib/lp/bugs/stories/bugs/xx-bug-comment-attach-file.rst |
1846 | index 669bc1f..7de405b 100644 |
1847 | --- a/lib/lp/bugs/stories/bugs/xx-bug-comment-attach-file.rst |
1848 | +++ b/lib/lp/bugs/stories/bugs/xx-bug-comment-attach-file.rst |
1849 | @@ -45,9 +45,9 @@ A comment and attachment can be submitted in one request. |
1850 | >>> user_browser.open( |
1851 | ... "http://bugs.launchpad.test/firefox/+bug/1/+addcomment-form" |
1852 | ... ) |
1853 | - >>> user_browser.getControl( |
1854 | - ... name="field.comment" |
1855 | - ... ).value = "this is a comment" |
1856 | + >>> user_browser.getControl(name="field.comment").value = ( |
1857 | + ... "this is a comment" |
1858 | + ... ) |
1859 | >>> user_browser.getControl("Attachment").add_file( |
1860 | ... BytesIO(b"some file"), "text/plain", "bar.txt" |
1861 | ... ) |
1862 | diff --git a/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.rst b/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.rst |
1863 | index 3ccfe3c..952f62b 100644 |
1864 | --- a/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.rst |
1865 | +++ b/lib/lp/bugs/stories/bugs/xx-bug-hidden-comments.rst |
1866 | @@ -6,9 +6,9 @@ will not show up when browsing the comment list for a bug. |
1867 | All comments are set visible by default. |
1868 | |
1869 | >>> user_browser.open("http://bugs.launchpad.test" "/jokosher/+bug/11") |
1870 | - >>> user_browser.getControl( |
1871 | - ... name="field.comment" |
1872 | - ... ).value = "This comment will not be visible when the test completes." |
1873 | + >>> user_browser.getControl(name="field.comment").value = ( |
1874 | + ... "This comment will not be visible when the test completes." |
1875 | + ... ) |
1876 | >>> user_browser.getControl("Post Comment", index=-1).click() |
1877 | >>> main_content = find_main_content(user_browser.contents) |
1878 | >>> new_comment = main_content("div", "boardCommentBody")[-1] |
1879 | diff --git a/lib/lp/bugs/stories/bugs/xx-bugs.rst b/lib/lp/bugs/stories/bugs/xx-bugs.rst |
1880 | index 7cbb23d..c5ae800 100644 |
1881 | --- a/lib/lp/bugs/stories/bugs/xx-bugs.rst |
1882 | +++ b/lib/lp/bugs/stories/bugs/xx-bugs.rst |
1883 | @@ -27,9 +27,9 @@ Bar. First, let's clear out the notification table: |
1884 | >>> user_browser.open( |
1885 | ... "http://localhost/debian/+source/mozilla-firefox/+bug/2" |
1886 | ... ) |
1887 | - >>> user_browser.getControl( |
1888 | - ... name="field.comment" |
1889 | - ... ).value = "This is a test comment." |
1890 | + >>> user_browser.getControl(name="field.comment").value = ( |
1891 | + ... "This is a test comment." |
1892 | + ... ) |
1893 | >>> user_browser.getControl("Post Comment", index=-1).click() |
1894 | |
1895 | >>> user_browser.url |
1896 | diff --git a/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.rst b/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.rst |
1897 | index 700e99e..9382c9b 100644 |
1898 | --- a/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.rst |
1899 | +++ b/lib/lp/bugs/stories/bugs/xx-incomplete-bugs.rst |
1900 | @@ -63,9 +63,9 @@ No Privileges Person can supply new information by posting a new |
1901 | comment for the bug. |
1902 | |
1903 | >>> user_browser.open("http://bugs.launchpad.test/jokosher/+bug/11") |
1904 | - >>> user_browser.getControl( |
1905 | - ... name="field.comment" |
1906 | - ... ).value = "More information here." |
1907 | + >>> user_browser.getControl(name="field.comment").value = ( |
1908 | + ... "More information here." |
1909 | + ... ) |
1910 | >>> user_browser.getControl("Post Comment").click() |
1911 | |
1912 | >>> import transaction |
1913 | diff --git a/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.rst b/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.rst |
1914 | index a1ad3c1..b2b6d91 100644 |
1915 | --- a/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.rst |
1916 | +++ b/lib/lp/bugs/stories/bugs/xx-remote-bug-comments.rst |
1917 | @@ -47,9 +47,9 @@ individual comment page, where the inline form is displayed. |
1918 | |
1919 | We enter a comment, and submit the form. |
1920 | |
1921 | - >>> user_browser.getControl( |
1922 | - ... name="field.comment" |
1923 | - ... ).value = "A reply comment." |
1924 | + >>> user_browser.getControl(name="field.comment").value = ( |
1925 | + ... "A reply comment." |
1926 | + ... ) |
1927 | >>> user_browser.getControl(name="field.actions.save").click() |
1928 | |
1929 | The new comment appears, formatted as a remote bug comment. |
1930 | @@ -92,9 +92,9 @@ the 'awaiting synchronization' mark goes away. |
1931 | >>> bug_message = getUtility(IBugMessageSet).getByBugAndMessage( |
1932 | ... bug_15, message |
1933 | ... ) |
1934 | - >>> removeSecurityProxy( |
1935 | - ... bug_message |
1936 | - ... ).remote_comment_id = "test-remote-comment-id" |
1937 | + >>> removeSecurityProxy(bug_message).remote_comment_id = ( |
1938 | + ... "test-remote-comment-id" |
1939 | + ... ) |
1940 | >>> flush_database_updates() |
1941 | >>> logout() |
1942 | |
1943 | diff --git a/lib/lp/bugs/stories/bugtask-management/xx-bug-privileged-statuses.rst b/lib/lp/bugs/stories/bugtask-management/xx-bug-privileged-statuses.rst |
1944 | index 1610ef0..fa5725c 100644 |
1945 | --- a/lib/lp/bugs/stories/bugtask-management/xx-bug-privileged-statuses.rst |
1946 | +++ b/lib/lp/bugs/stories/bugtask-management/xx-bug-privileged-statuses.rst |
1947 | @@ -64,9 +64,9 @@ Bug Supervisor |
1948 | Ubuntu needs a Bug Supervisor first of all: |
1949 | |
1950 | >>> admin_browser.open("http://bugs.launchpad.test/ubuntu/+bugsupervisor") |
1951 | - >>> admin_browser.getControl( |
1952 | - ... "Bug Supervisor" |
1953 | - ... ).value = "test@canonical.com" |
1954 | + >>> admin_browser.getControl("Bug Supervisor").value = ( |
1955 | + ... "test@canonical.com" |
1956 | + ... ) |
1957 | >>> admin_browser.getControl("Change").click() |
1958 | |
1959 | >>> print( |
1960 | diff --git a/lib/lp/bugs/stories/bugtask-management/xx-edit-email-address-bugtask.rst b/lib/lp/bugs/stories/bugtask-management/xx-edit-email-address-bugtask.rst |
1961 | index 387fcce..88c75da 100644 |
1962 | --- a/lib/lp/bugs/stories/bugtask-management/xx-edit-email-address-bugtask.rst |
1963 | +++ b/lib/lp/bugs/stories/bugtask-management/xx-edit-email-address-bugtask.rst |
1964 | @@ -52,9 +52,9 @@ elsewhere: |
1965 | >>> user_browser.getControl("Project").value = "gnome-terminal" |
1966 | >>> user_browser.getControl("Continue").click() |
1967 | >>> user_browser.getControl("I have the URL").selected = True |
1968 | - >>> user_browser.getControl( |
1969 | - ... name="field.bug_url" |
1970 | - ... ).value = "http://mantis.bugtracker/view.php?id=1234" |
1971 | + >>> user_browser.getControl(name="field.bug_url").value = ( |
1972 | + ... "http://mantis.bugtracker/view.php?id=1234" |
1973 | + ... ) |
1974 | >>> user_browser.getControl("Add to Bug Report").click() |
1975 | >>> user_browser.getControl( |
1976 | ... "Register Bug Tracker and Add to Bug Report" |
1977 | diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.rst b/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.rst |
1978 | index 0185219..2122ce7 100644 |
1979 | --- a/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.rst |
1980 | +++ b/lib/lp/bugs/stories/bugtask-searches/xx-advanced-people-filters.rst |
1981 | @@ -58,9 +58,9 @@ If we enter an invalid assignee, we'll get a nice error message. |
1982 | >>> anon_browser.open( |
1983 | ... "http://bugs.launchpad.test/ubuntu/+bugs?advanced=1" |
1984 | ... ) |
1985 | - >>> anon_browser.getControl( |
1986 | - ... name="field.assignee" |
1987 | - ... ).value = "invalid-assignee" |
1988 | + >>> anon_browser.getControl(name="field.assignee").value = ( |
1989 | + ... "invalid-assignee" |
1990 | + ... ) |
1991 | >>> anon_browser.getControl("Search", index=0).click() |
1992 | >>> print_feedback_messages(anon_browser.contents) |
1993 | There's no person with the name or email address 'invalid-assignee'. |
1994 | @@ -68,9 +68,9 @@ If we enter an invalid assignee, we'll get a nice error message. |
1995 | >>> anon_browser.open( |
1996 | ... "http://bugs.launchpad.test/~name12/+reportedbugs?advanced=1" |
1997 | ... ) |
1998 | - >>> anon_browser.getControl( |
1999 | - ... name="field.assignee" |
2000 | - ... ).value = "invalid-assignee" |
2001 | + >>> anon_browser.getControl(name="field.assignee").value = ( |
2002 | + ... "invalid-assignee" |
2003 | + ... ) |
2004 | >>> anon_browser.getControl("Search", index=0).click() |
2005 | >>> print_feedback_messages(anon_browser.contents) |
2006 | There's no person with the name or email address 'invalid-assignee'. |
2007 | @@ -102,17 +102,17 @@ and invalid searches don't OOPS: |
2008 | >>> anon_browser.open( |
2009 | ... "http://bugs.launchpad.test/debian/+bugs?advanced=1" |
2010 | ... ) |
2011 | - >>> anon_browser.getControl( |
2012 | - ... name="field.bug_reporter" |
2013 | - ... ).value = "invalid-reporter" |
2014 | + >>> anon_browser.getControl(name="field.bug_reporter").value = ( |
2015 | + ... "invalid-reporter" |
2016 | + ... ) |
2017 | >>> anon_browser.getControl("Search", index=0).click() |
2018 | >>> print_feedback_messages(anon_browser.contents) |
2019 | There's no person with the name or email address 'invalid-reporter'. |
2020 | |
2021 | >>> anon_browser.open("http://bugs.launchpad.test/~name12/+assignedbugs") |
2022 | - >>> anon_browser.getControl( |
2023 | - ... name="field.bug_reporter" |
2024 | - ... ).value = "invalid-reporter" |
2025 | + >>> anon_browser.getControl(name="field.bug_reporter").value = ( |
2026 | + ... "invalid-reporter" |
2027 | + ... ) |
2028 | >>> anon_browser.getControl("Search", index=0).click() |
2029 | >>> print_feedback_messages(anon_browser.contents) |
2030 | There's no person with the name or email address 'invalid-reporter'. |
2031 | @@ -173,9 +173,9 @@ context, only bugs for Ubuntu packages will be returned. In Ubuntu, Foo |
2032 | Bar is a package subscriber for mozilla-firefox and pmount, but there |
2033 | aren't any bugs open for pmount. |
2034 | |
2035 | - >>> anon_browser.getControl( |
2036 | - ... "Package or series subscriber" |
2037 | - ... ).value = "foo.bar@canonical.com" |
2038 | + >>> anon_browser.getControl("Package or series subscriber").value = ( |
2039 | + ... "foo.bar@canonical.com" |
2040 | + ... ) |
2041 | >>> anon_browser.getControl("Search", index=0).click() |
2042 | |
2043 | >>> from lp.bugs.tests.bug import print_bugtasks |
2044 | diff --git a/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.rst b/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.rst |
2045 | index 00b0704..3e17ab5 100644 |
2046 | --- a/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.rst |
2047 | +++ b/lib/lp/bugs/stories/bugtask-searches/xx-searching-by-tags.rst |
2048 | @@ -40,9 +40,9 @@ We go to the global bug search page and search for bugs with all the tags. |
2049 | Only 'test bug a' is returned. |
2050 | |
2051 | >>> anon_browser.open("http://bugs.launchpad.test/bugs/+bugs?advanced=1") |
2052 | - >>> anon_browser.getControl( |
2053 | - ... name="field.tag" |
2054 | - ... ).value = "test-tag-1 test-tag-2" |
2055 | + >>> anon_browser.getControl(name="field.tag").value = ( |
2056 | + ... "test-tag-1 test-tag-2" |
2057 | + ... ) |
2058 | >>> anon_browser.getControl(name="field.tags_combinator").value = ["ALL"] |
2059 | >>> anon_browser.getControl("Search", index=1).click() |
2060 | >>> "test bug a" in anon_browser.contents |
2061 | @@ -54,9 +54,9 @@ We go to the bug search page and search for bugs with any of the tags. |
2062 | Both bugs are returned. |
2063 | |
2064 | >>> anon_browser.open("http://launchpad.test/firefox/+bugs?advanced=1") |
2065 | - >>> anon_browser.getControl( |
2066 | - ... name="field.tag" |
2067 | - ... ).value = "test-tag-1 test-tag-2" |
2068 | + >>> anon_browser.getControl(name="field.tag").value = ( |
2069 | + ... "test-tag-1 test-tag-2" |
2070 | + ... ) |
2071 | >>> anon_browser.getControl(name="field.tags_combinator").value = ["ANY"] |
2072 | >>> anon_browser.getControl("Search", index=1).click() |
2073 | >>> "test bug a" in anon_browser.contents |
2074 | @@ -67,9 +67,9 @@ Both bugs are returned. |
2075 | Same works for user related bugs: |
2076 | |
2077 | >>> anon_browser.open("http://launchpad.test/~name16/+bugs?advanced=1") |
2078 | - >>> anon_browser.getControl( |
2079 | - ... name="field.tag" |
2080 | - ... ).value = "test-tag-1 test-tag-2" |
2081 | + >>> anon_browser.getControl(name="field.tag").value = ( |
2082 | + ... "test-tag-1 test-tag-2" |
2083 | + ... ) |
2084 | >>> anon_browser.getControl(name="field.tags_combinator").value = ["ANY"] |
2085 | >>> anon_browser.getControl("Search", index=1).click() |
2086 | >>> "test bug a" in anon_browser.contents |
2087 | @@ -81,9 +81,9 @@ When we search for bugs with all the tags, though, only the first bug is |
2088 | returned, since it's the only bug with both tags. |
2089 | |
2090 | >>> anon_browser.open("http://launchpad.test/firefox/+bugs?advanced=1") |
2091 | - >>> anon_browser.getControl( |
2092 | - ... name="field.tag" |
2093 | - ... ).value = "test-tag-1 test-tag-2" |
2094 | + >>> anon_browser.getControl(name="field.tag").value = ( |
2095 | + ... "test-tag-1 test-tag-2" |
2096 | + ... ) |
2097 | >>> anon_browser.getControl(name="field.tags_combinator").value = ["ALL"] |
2098 | >>> anon_browser.getControl("Search", index=1).click() |
2099 | >>> "test bug a" in anon_browser.contents |
2100 | @@ -94,9 +94,9 @@ returned, since it's the only bug with both tags. |
2101 | And also for user related bugs: |
2102 | |
2103 | >>> anon_browser.open("http://launchpad.test/~name16/+bugs?advanced=1") |
2104 | - >>> anon_browser.getControl( |
2105 | - ... name="field.tag" |
2106 | - ... ).value = "test-tag-1 test-tag-2" |
2107 | + >>> anon_browser.getControl(name="field.tag").value = ( |
2108 | + ... "test-tag-1 test-tag-2" |
2109 | + ... ) |
2110 | >>> anon_browser.getControl(name="field.tags_combinator").value = ["ALL"] |
2111 | >>> anon_browser.getControl("Search", index=1).click() |
2112 | >>> "test bug a" in anon_browser.contents |
2113 | diff --git a/lib/lp/bugs/stories/bugtracker/bugtrackers-index.rst b/lib/lp/bugs/stories/bugtracker/bugtrackers-index.rst |
2114 | index 47d847d..ec483fa 100644 |
2115 | --- a/lib/lp/bugs/stories/bugtracker/bugtrackers-index.rst |
2116 | +++ b/lib/lp/bugs/stories/bugtracker/bugtrackers-index.rst |
2117 | @@ -62,9 +62,9 @@ auto-created ones - so the title is also obfuscated. |
2118 | >>> admin_browser.open( |
2119 | ... "http://launchpad.test/bugs/bugtrackers/email/+edit" |
2120 | ... ) |
2121 | - >>> admin_browser.getControl( |
2122 | - ... "Title" |
2123 | - ... ).value = "an@email.address bug tracker" |
2124 | + >>> admin_browser.getControl("Title").value = ( |
2125 | + ... "an@email.address bug tracker" |
2126 | + ... ) |
2127 | >>> admin_browser.getControl("Change").click() |
2128 | |
2129 | >>> anon_browser.open("http://launchpad.test/bugs/bugtrackers") |
2130 | diff --git a/lib/lp/bugs/stories/bugtracker/xx-bugtracker.rst b/lib/lp/bugs/stories/bugtracker/xx-bugtracker.rst |
2131 | index 0beb941..4018672 100644 |
2132 | --- a/lib/lp/bugs/stories/bugtracker/xx-bugtracker.rst |
2133 | +++ b/lib/lp/bugs/stories/bugtracker/xx-bugtracker.rst |
2134 | @@ -52,9 +52,9 @@ aren't allowed. |
2135 | ... "Mantis" |
2136 | ... ).click() |
2137 | >>> user_browser.getControl("Title").value = "Test Mantis Tracker" |
2138 | - >>> user_browser.getControl( |
2139 | - ... "Summary" |
2140 | - ... ).value = "This is a test MANTIS tracker." |
2141 | + >>> user_browser.getControl("Summary").value = ( |
2142 | + ... "This is a test MANTIS tracker." |
2143 | + ... ) |
2144 | >>> url = "http://mantis.testing.org/" |
2145 | >>> user_browser.getControl("Location").value = url |
2146 | >>> user_browser.getControl("Contact details").value = "blah blah" |
2147 | @@ -73,9 +73,9 @@ If a bug tracker is already registered with the same location, the user |
2148 | is informed about it. |
2149 | |
2150 | >>> user_browser.getControl("Name").value = "testmantis" |
2151 | - >>> user_browser.getControl( |
2152 | - ... "Location" |
2153 | - ... ).value = "http://bugzilla.mozilla.org/" |
2154 | + >>> user_browser.getControl("Location").value = ( |
2155 | + ... "http://bugzilla.mozilla.org/" |
2156 | + ... ) |
2157 | >>> user_browser.getControl("Add").click() |
2158 | |
2159 | >>> user_browser.url |
2160 | @@ -105,9 +105,9 @@ we'll dig directly to the database. |
2161 | >>> gnome_bugzilla.aliases = ["http://alias.example.com/"] |
2162 | >>> logout() |
2163 | |
2164 | - >>> user_browser.getControl( |
2165 | - ... "Location" |
2166 | - ... ).value = "http://alias.example.com/" |
2167 | + >>> user_browser.getControl("Location").value = ( |
2168 | + ... "http://alias.example.com/" |
2169 | + ... ) |
2170 | >>> user_browser.getControl("Add").click() |
2171 | |
2172 | >>> user_browser.url |
2173 | @@ -165,9 +165,9 @@ bugtracker without them is acceptable. |
2174 | >>> user_browser.getControl("Name").value = "test-bugzilla" |
2175 | >>> user_browser.getControl("Title").value = "Test Bugzilla" |
2176 | >>> user_browser.getControl("Bug Tracker Type").value = ["Bugzilla"] |
2177 | - >>> user_browser.getControl( |
2178 | - ... "Location" |
2179 | - ... ).value = "http://bugzilla.example.org/" |
2180 | + >>> user_browser.getControl("Location").value = ( |
2181 | + ... "http://bugzilla.example.org/" |
2182 | + ... ) |
2183 | >>> user_browser.getControl("Add").click() |
2184 | >>> user_browser.url |
2185 | 'http://bugs.launchpad.test/bugs/bugtrackers/test-bugzilla' |
2186 | @@ -192,9 +192,9 @@ we'll get a nice error message. |
2187 | ... "Mantis" |
2188 | ... ).click() |
2189 | >>> user_browser.getControl("Title").value = "Test Mantis Tracker" |
2190 | - >>> user_browser.getControl( |
2191 | - ... "Summary" |
2192 | - ... ).value = "This is a test TRAC tracker." |
2193 | + >>> user_browser.getControl("Summary").value = ( |
2194 | + ... "This is a test TRAC tracker." |
2195 | + ... ) |
2196 | >>> url = "http://trac.example.org/tickets" |
2197 | >>> user_browser.getControl("Location").value = url |
2198 | >>> user_browser.getControl("Contact details").value = "blah blah" |
2199 | @@ -222,9 +222,9 @@ We can edit the details of the newly added bugtracker. |
2200 | >>> user_browser.getControl("Bug Tracker Type").getControl( |
2201 | ... "Bugzilla" |
2202 | ... ).click() |
2203 | - >>> user_browser.getControl( |
2204 | - ... "Summary" |
2205 | - ... ).value = "This is used to be a test TRAC bug tracker." |
2206 | + >>> user_browser.getControl("Summary").value = ( |
2207 | + ... "This is used to be a test TRAC bug tracker." |
2208 | + ... ) |
2209 | |
2210 | There is a cancel link if we change our mind: |
2211 | |
2212 | @@ -234,9 +234,9 @@ There is a cancel link if we change our mind: |
2213 | It's not possible to change the base URL to something that another bug |
2214 | tracker uses. |
2215 | |
2216 | - >>> user_browser.getControl( |
2217 | - ... "Location", index=0 |
2218 | - ... ).value = "http://bugzilla.mozilla.org/" |
2219 | + >>> user_browser.getControl("Location", index=0).value = ( |
2220 | + ... "http://bugzilla.mozilla.org/" |
2221 | + ... ) |
2222 | >>> user_browser.getControl("Change").click() |
2223 | |
2224 | >>> user_browser.url |
2225 | @@ -250,18 +250,18 @@ tracker uses. |
2226 | If the user inadvertently enters an invalid URL, they are shown an |
2227 | informative error message explaining why it is invalid. |
2228 | |
2229 | - >>> user_browser.getControl( |
2230 | - ... "Location", index=0 |
2231 | - ... ).value = "what? my wife does this stuff" |
2232 | + >>> user_browser.getControl("Location", index=0).value = ( |
2233 | + ... "what? my wife does this stuff" |
2234 | + ... ) |
2235 | >>> user_browser.getControl("Change").click() |
2236 | |
2237 | >>> print_feedback_messages(user_browser.contents) |
2238 | There is 1 error. |
2239 | "what? my wife does this stuff" is not a valid URI |
2240 | |
2241 | - >>> user_browser.getControl( |
2242 | - ... "Location", index=0 |
2243 | - ... ).value = "http://ξνεr.been.fishing?" |
2244 | + >>> user_browser.getControl("Location", index=0).value = ( |
2245 | + ... "http://ξνεr.been.fishing?" |
2246 | + ... ) |
2247 | >>> user_browser.getControl("Change").click() |
2248 | |
2249 | >>> print_feedback_messages(user_browser.contents) |
2250 | @@ -308,9 +308,9 @@ to change. |
2251 | http://mantis.testing.org/ (Alias) |
2252 | |
2253 | >>> user_browser.getLink("Change details").click() |
2254 | - >>> user_browser.getControl( |
2255 | - ... "Location", index=0 |
2256 | - ... ).value = "https://trac.example.org/tickets" |
2257 | + >>> user_browser.getControl("Location", index=0).value = ( |
2258 | + ... "https://trac.example.org/tickets" |
2259 | + ... ) |
2260 | >>> user_browser.getControl("Change").click() |
2261 | |
2262 | >>> print( |
2263 | @@ -337,9 +337,9 @@ They're added on the normal Change Details page. |
2264 | ... ) |
2265 | >>> user_browser.getLink("Change details").click() |
2266 | |
2267 | - >>> user_browser.getControl( |
2268 | - ... "Location aliases" |
2269 | - ... ).value = "http://pseudonym.example.com/" |
2270 | + >>> user_browser.getControl("Location aliases").value = ( |
2271 | + ... "http://pseudonym.example.com/" |
2272 | + ... ) |
2273 | >>> user_browser.getControl("Change").click() |
2274 | |
2275 | >>> bugtracker_url_list = find_tag_by_id( |
2276 | @@ -355,9 +355,9 @@ bugtracker. |
2277 | >>> user_browser.open( |
2278 | ... "http://launchpad.test/bugs/bugtrackers/testbugzilla/+edit" |
2279 | ... ) |
2280 | - >>> user_browser.getControl( |
2281 | - ... "Location aliases" |
2282 | - ... ).value = "http://bugzilla.mozilla.org/" |
2283 | + >>> user_browser.getControl("Location aliases").value = ( |
2284 | + ... "http://bugzilla.mozilla.org/" |
2285 | + ... ) |
2286 | >>> user_browser.getControl("Change").click() |
2287 | |
2288 | >>> print_feedback_messages(user_browser.contents) |
2289 | @@ -391,9 +391,9 @@ shown informative error messages. |
2290 | >>> user_browser.open( |
2291 | ... "http://launchpad.test/bugs/bugtrackers/testbugzilla/+edit" |
2292 | ... ) |
2293 | - >>> user_browser.getControl( |
2294 | - ... "Location aliases" |
2295 | - ... ).value = "ξνεr been http://fishing?" |
2296 | + >>> user_browser.getControl("Location aliases").value = ( |
2297 | + ... "ξνεr been http://fishing?" |
2298 | + ... ) |
2299 | >>> user_browser.getControl("Change").click() |
2300 | |
2301 | >>> print_feedback_messages(user_browser.contents) |
2302 | @@ -413,9 +413,9 @@ example bug tracker: |
2303 | ... ) |
2304 | >>> user_browser.getControl("Name").value = "freddy" |
2305 | >>> user_browser.getControl("Title").value = "Freddy's Bugs" |
2306 | - >>> user_browser.getControl( |
2307 | - ... "Location" |
2308 | - ... ).value = "http://freddy.example.com/" |
2309 | + >>> user_browser.getControl("Location").value = ( |
2310 | + ... "http://freddy.example.com/" |
2311 | + ... ) |
2312 | >>> user_browser.getControl("Add").click() |
2313 | |
2314 | Being brand-new and pristine, there will be nothing to prevent its |
2315 | diff --git a/lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.rst b/lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.rst |
2316 | index 4ef9680..93853ce 100644 |
2317 | --- a/lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.rst |
2318 | +++ b/lib/lp/bugs/stories/bugwatches/xx-edit-bugwatch.rst |
2319 | @@ -5,9 +5,9 @@ Edi a bug watch |
2320 | After a bug watch is recorded, it is possible to go back and change it. |
2321 | |
2322 | >>> admin_browser.open("http://bugs.launchpad.test/bugs/1/+watch/2") |
2323 | - >>> admin_browser.getControl( |
2324 | - ... "URL" |
2325 | - ... ).value = "https://bugzilla.mozilla.org/show_bug.cgi?id=1000" |
2326 | + >>> admin_browser.getControl("URL").value = ( |
2327 | + ... "https://bugzilla.mozilla.org/show_bug.cgi?id=1000" |
2328 | + ... ) |
2329 | >>> admin_browser.getControl("Change").click() |
2330 | >>> admin_browser.url |
2331 | 'http://bugs.launchpad.test/firefox/+bug/1' |
2332 | @@ -20,9 +20,9 @@ The URL supplied must be a valid bug tracker URL and must point to a |
2333 | bug tracker already registered with Launchpad. |
2334 | |
2335 | >>> admin_browser.open("http://bugs.launchpad.test/bugs/1/+watch/2") |
2336 | - >>> admin_browser.getControl( |
2337 | - ... "URL" |
2338 | - ... ).value = "https://bugzilla.mozilla.org/foo_bug.cgi?id=1000" |
2339 | + >>> admin_browser.getControl("URL").value = ( |
2340 | + ... "https://bugzilla.mozilla.org/foo_bug.cgi?id=1000" |
2341 | + ... ) |
2342 | >>> admin_browser.getControl("Change").click() |
2343 | >>> admin_browser.url |
2344 | 'http://bugs.launchpad.test/bugs/1/+watch/2/+edit' |
2345 | diff --git a/lib/lp/bugs/stories/cve/xx-cve-link-xss.rst b/lib/lp/bugs/stories/cve/xx-cve-link-xss.rst |
2346 | index f45f667..1a0beca 100644 |
2347 | --- a/lib/lp/bugs/stories/cve/xx-cve-link-xss.rst |
2348 | +++ b/lib/lp/bugs/stories/cve/xx-cve-link-xss.rst |
2349 | @@ -5,9 +5,9 @@ The CVE Sequence Number field and its related messages are properly |
2350 | escaped in order to prevent XSS. |
2351 | |
2352 | >>> user_browser.open("http://launchpad.test/firefox/+bug/6/+linkcve") |
2353 | - >>> user_browser.getControl( |
2354 | - ... "CVE Sequence Number" |
2355 | - ... ).value = '<script>alert("cheezburger");</script>' |
2356 | + >>> user_browser.getControl("CVE Sequence Number").value = ( |
2357 | + ... '<script>alert("cheezburger");</script>' |
2358 | + ... ) |
2359 | >>> user_browser.getControl("Continue").click() |
2360 | |
2361 | The value can be obtained correctly, which indicates that the markup |
2362 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.rst b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.rst |
2363 | index 8b7c0a8..f22fc18 100644 |
2364 | --- a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.rst |
2365 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-guidelines.rst |
2366 | @@ -92,13 +92,13 @@ description. |
2367 | ... context_path, |
2368 | ... ) |
2369 | ... user_browser.open(filebug_url) |
2370 | - ... user_browser.getControl( |
2371 | - ... "Summary", index=0 |
2372 | - ... ).value = "It doesn't work" |
2373 | + ... user_browser.getControl("Summary", index=0).value = ( |
2374 | + ... "It doesn't work" |
2375 | + ... ) |
2376 | ... user_browser.getControl("Continue").click() |
2377 | - ... user_browser.getControl( |
2378 | - ... "Further information" |
2379 | - ... ).value = "please help!" |
2380 | + ... user_browser.getControl("Further information").value = ( |
2381 | + ... "please help!" |
2382 | + ... ) |
2383 | ... print_guidelines(context_name, user_browser) |
2384 | ... user_browser.getControl("Submit Bug Report").click() |
2385 | ... print_acknowledgement_message(user_browser) |
2386 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.rst b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.rst |
2387 | index 5f36cf6..68642d6 100644 |
2388 | --- a/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.rst |
2389 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-bug-reporting-tools.rst |
2390 | @@ -134,9 +134,9 @@ Even if the form has errors the token will be present in the URL. |
2391 | If we go ahead submitting the bug, the bug will have all the extra |
2392 | information specified in the extra filebug data. |
2393 | |
2394 | - >>> user_browser.getControl( |
2395 | - ... "Further information" |
2396 | - ... ).value = "A bug description." |
2397 | + >>> user_browser.getControl("Further information").value = ( |
2398 | + ... "A bug description." |
2399 | + ... ) |
2400 | >>> user_browser.getControl("Submit Bug Report").click() |
2401 | >>> user_browser.url |
2402 | 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+bug/...' |
2403 | @@ -233,9 +233,9 @@ The user can of course change the tags if they want. |
2404 | |
2405 | >>> user_browser.getControl("Tags").value = "bar baz" |
2406 | >>> user_browser.getControl("Summary", index=0).value = "Bug Summary" |
2407 | - >>> user_browser.getControl( |
2408 | - ... "Further information" |
2409 | - ... ).value = "Bug description." |
2410 | + >>> user_browser.getControl("Further information").value = ( |
2411 | + ... "Bug description." |
2412 | + ... ) |
2413 | >>> user_browser.getControl("Submit Bug Report").click() |
2414 | >>> user_browser.url |
2415 | 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+bug/...' |
2416 | @@ -254,9 +254,9 @@ that will get their tags set as well. |
2417 | >>> user_browser.getControl("Summary", index=0).value = "Bug Summary" |
2418 | >>> user_browser.getControl("Continue").click() |
2419 | |
2420 | - >>> user_browser.getControl( |
2421 | - ... "Further information" |
2422 | - ... ).value = "Bug description." |
2423 | + >>> user_browser.getControl("Further information").value = ( |
2424 | + ... "Bug description." |
2425 | + ... ) |
2426 | >>> user_browser.getControl("Submit Bug Report").click() |
2427 | >>> user_browser.url |
2428 | 'http://bugs.launchpad.test/ubuntu/+source/mozilla-firefox/+bug/...' |
2429 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.rst b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.rst |
2430 | index 7178234..7dd3c82 100644 |
2431 | --- a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.rst |
2432 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug-tags.rst |
2433 | @@ -12,9 +12,9 @@ that deal with new package request with a certain tag. |
2434 | ... "http://bugs.launchpad.test/ubuntu/+filebug" |
2435 | ... "?field.tags=new-package" |
2436 | ... ) |
2437 | - >>> user_browser.getControl( |
2438 | - ... "Summary", index=0 |
2439 | - ... ).value = "Please package CoolApp" |
2440 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2441 | + ... "Please package CoolApp" |
2442 | + ... ) |
2443 | >>> user_browser.getControl("Continue").click() |
2444 | |
2445 | On the next page, possible duplicates are displayed as usual. No |
2446 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.rst b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.rst |
2447 | index ff30885..8df2c97 100644 |
2448 | --- a/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.rst |
2449 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-distro-guided-filebug.rst |
2450 | @@ -12,9 +12,9 @@ The example here are a little short - in reality we have a comprehensive |
2451 | database to find candidates from, our sample data has no real near-fits, |
2452 | see bug 612384 for the overall effort to provide a sensible search facility. |
2453 | |
2454 | - >>> user_browser.getControl( |
2455 | - ... "Summary", index=0 |
2456 | - ... ).value = "Thunderbird crashes opening" |
2457 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2458 | + ... "Thunderbird crashes opening" |
2459 | + ... ) |
2460 | >>> user_browser.getControl("Continue").click() |
2461 | |
2462 | ...yields one similar bug. |
2463 | @@ -43,9 +43,9 @@ back... |
2464 | # We should use goBack() here but can't because of bug #98372: |
2465 | # zope.testbrowser truncates document content after goBack(). |
2466 | >>> user_browser.open("http://launchpad.test/ubuntu/+filebug") |
2467 | - >>> user_browser.getControl( |
2468 | - ... "Summary", index=0 |
2469 | - ... ).value = "Thunderbird crashes when opening large emails" |
2470 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2471 | + ... "Thunderbird crashes when opening large emails" |
2472 | + ... ) |
2473 | >>> user_browser.getControl("Continue").click() |
2474 | |
2475 | ...and continue filing our bug. |
2476 | @@ -89,9 +89,9 @@ different in the user agent. |
2477 | |
2478 | Submitting a distinctive bug title... |
2479 | |
2480 | - >>> user_browser.getControl( |
2481 | - ... "Summary", index=0 |
2482 | - ... ).value = "Frobnobulator emits weird noises." |
2483 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2484 | + ... "Frobnobulator emits weird noises." |
2485 | + ... ) |
2486 | >>> user_browser.getControl("Continue").click() |
2487 | |
2488 | ...yields no similar bugs. In fact, the similar bugs table is not even |
2489 | @@ -107,9 +107,9 @@ But the bug can be filed as before. |
2490 | |
2491 | >>> user_browser.getControl(name="packagename_option").value = ["choose"] |
2492 | >>> user_browser.getControl("In what package").value = "mozilla-firefox" |
2493 | - >>> user_browser.getControl( |
2494 | - ... "Further information" |
2495 | - ... ).value = "Frobnobulator is a Firefox add-on, ..." |
2496 | + >>> user_browser.getControl("Further information").value = ( |
2497 | + ... "Frobnobulator is a Firefox add-on, ..." |
2498 | + ... ) |
2499 | >>> user_browser.getControl("Submit Bug Report").click() |
2500 | |
2501 | >>> print(user_browser.url) |
2502 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.rst b/lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.rst |
2503 | index 20ba75d..5bd7a33 100644 |
2504 | --- a/lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.rst |
2505 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-distro-sourcepackage-guided-filebug.rst |
2506 | @@ -6,9 +6,9 @@ Thunderbird bug. |
2507 | >>> user_browser.open( |
2508 | ... "http://launchpad.test/ubuntu/+source/mozilla-firefox/" "+filebug" |
2509 | ... ) |
2510 | - >>> user_browser.getControl( |
2511 | - ... name="field.title", index=0 |
2512 | - ... ).value = "Thunderbird crashes when opening large emails" |
2513 | + >>> user_browser.getControl(name="field.title", index=0).value = ( |
2514 | + ... "Thunderbird crashes when opening large emails" |
2515 | + ... ) |
2516 | >>> user_browser.getControl("Continue").click() |
2517 | |
2518 | In this case, since we search only Ubuntu Firefox bugs, there are no |
2519 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-filebug-attachments.rst b/lib/lp/bugs/stories/guided-filebug/xx-filebug-attachments.rst |
2520 | index 01ff274..32baa95 100644 |
2521 | --- a/lib/lp/bugs/stories/guided-filebug/xx-filebug-attachments.rst |
2522 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-filebug-attachments.rst |
2523 | @@ -17,9 +17,9 @@ guided filebug form. |
2524 | ... "A totally new " "bug with attachments" |
2525 | ... ) |
2526 | >>> user_browser.getControl("Continue").click() |
2527 | - >>> user_browser.getControl( |
2528 | - ... "Further information" |
2529 | - ... ).value = "We can now add attachments!" |
2530 | + >>> user_browser.getControl("Further information").value = ( |
2531 | + ... "We can now add attachments!" |
2532 | + ... ) |
2533 | |
2534 | No Privileges Person chooses to add an attachment to the bug. We create |
2535 | a file-like object to demonstrate this. |
2536 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-filebug-tags.rst b/lib/lp/bugs/stories/guided-filebug/xx-filebug-tags.rst |
2537 | index ae577cc..f708dd6 100644 |
2538 | --- a/lib/lp/bugs/stories/guided-filebug/xx-filebug-tags.rst |
2539 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-filebug-tags.rst |
2540 | @@ -14,9 +14,9 @@ is being filed. |
2541 | >>> user_browser.getControl("Summary", index=0).value = "Bug with tags" |
2542 | >>> user_browser.getControl("Continue").click() |
2543 | >>> user_browser.getControl("Tags").value = "foo bar" |
2544 | - >>> user_browser.getControl( |
2545 | - ... "Further information" |
2546 | - ... ).value = "This bug has tags" |
2547 | + >>> user_browser.getControl("Further information").value = ( |
2548 | + ... "This bug has tags" |
2549 | + ... ) |
2550 | >>> user_browser.getControl("Submit Bug Report").click() |
2551 | >>> user_browser.url |
2552 | 'http://bugs.launchpad.test/firefox/+bug/...' |
2553 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.rst b/lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.rst |
2554 | index d1f3847..dda726f 100644 |
2555 | --- a/lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.rst |
2556 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-product-guided-filebug.rst |
2557 | @@ -30,9 +30,9 @@ If no title is entered, the user is asked to supply one. |
2558 | The user fills in some keywords, and clicks a button to search existing |
2559 | bugs. |
2560 | |
2561 | - >>> user_browser.getControl( |
2562 | - ... "Summary", index=0 |
2563 | - ... ).value = "SVG images are broken" |
2564 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2565 | + ... "SVG images are broken" |
2566 | + ... ) |
2567 | >>> user_browser.getControl("Continue").click() |
2568 | |
2569 | The form is self-posting, so the user is still at +filebug. This makes |
2570 | @@ -91,9 +91,9 @@ subscribe to it instead of filing a new bug. This also loosely implies a |
2571 | "me too" vote. |
2572 | |
2573 | >>> user_browser.open("http://bugs.launchpad.test/firefox/+filebug") |
2574 | - >>> user_browser.getControl( |
2575 | - ... "Summary", index=0 |
2576 | - ... ).value = "SVG images are broken" |
2577 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2578 | + ... "SVG images are broken" |
2579 | + ... ) |
2580 | >>> user_browser.getControl("Continue").click() |
2581 | |
2582 | As before, we get a list of similar bugs to choose from. |
2583 | @@ -120,9 +120,9 @@ handled by a JavaScript FormOverlay, but for the sake of integration |
2584 | testing we'll test it here, too. |
2585 | |
2586 | >>> user_browser.open("http://bugs.launchpad.test/firefox/+filebug") |
2587 | - >>> user_browser.getControl( |
2588 | - ... "Summary", index=0 |
2589 | - ... ).value = "SVG images are broken" |
2590 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2591 | + ... "SVG images are broken" |
2592 | + ... ) |
2593 | >>> user_browser.getControl("Continue").click() |
2594 | |
2595 | There's a hidden field on the "yes, this is my bug" form, which we can |
2596 | @@ -150,9 +150,9 @@ different in the user agent. |
2597 | |
2598 | Submitting some distinctive details... |
2599 | |
2600 | - >>> user_browser.getControl( |
2601 | - ... "Summary", index=0 |
2602 | - ... ).value = "Frankenzombulon reanimated neighbour's dead pet" |
2603 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2604 | + ... "Frankenzombulon reanimated neighbour's dead pet" |
2605 | + ... ) |
2606 | >>> user_browser.getControl("Continue").click() |
2607 | |
2608 | ...yields no similar bugs. In fact, the similar bugs table is not even |
2609 | @@ -167,9 +167,9 @@ shown. |
2610 | But, as before, entering a description and submitting the bug takes the |
2611 | user to the bug page. |
2612 | |
2613 | - >>> user_browser.getControl( |
2614 | - ... "Further information" |
2615 | - ... ).value = "Frankenzombulon is only meant to check my mail." |
2616 | + >>> user_browser.getControl("Further information").value = ( |
2617 | + ... "Frankenzombulon is only meant to check my mail." |
2618 | + ... ) |
2619 | >>> user_browser.getControl("Submit Bug Report").click() |
2620 | >>> user_browser.url |
2621 | 'http://bugs.launchpad.test/firefox/+bug/...' |
2622 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.rst b/lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.rst |
2623 | index 2ef1540..34478f3 100644 |
2624 | --- a/lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.rst |
2625 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-project-guided-filebug.rst |
2626 | @@ -20,9 +20,9 @@ After we selected a product and entered a summary, we're sent to the |
2627 | product's +filebug page to search for duplicates. |
2628 | |
2629 | >>> user_browser.getControl("Project", index=0).value = ["evolution"] |
2630 | - >>> user_browser.getControl( |
2631 | - ... "Summary", index=0 |
2632 | - ... ).value = "Evolution crashes" |
2633 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2634 | + ... "Evolution crashes" |
2635 | + ... ) |
2636 | >>> user_browser.getControl("Continue").click() |
2637 | |
2638 | >>> user_browser.url |
2639 | diff --git a/lib/lp/bugs/stories/guided-filebug/xx-sorting-by-relevance.rst b/lib/lp/bugs/stories/guided-filebug/xx-sorting-by-relevance.rst |
2640 | index f997418..ef5584f 100644 |
2641 | --- a/lib/lp/bugs/stories/guided-filebug/xx-sorting-by-relevance.rst |
2642 | +++ b/lib/lp/bugs/stories/guided-filebug/xx-sorting-by-relevance.rst |
2643 | @@ -14,9 +14,9 @@ that point. |
2644 | |
2645 | >>> user_browser.open("http://launchpad.test/products/firefox/+filebug") |
2646 | |
2647 | - >>> user_browser.getControl( |
2648 | - ... "Summary", index=0 |
2649 | - ... ).value = "Firefox does not support complex SVG images" |
2650 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2651 | + ... "Firefox does not support complex SVG images" |
2652 | + ... ) |
2653 | >>> user_browser.getControl("Continue").click() |
2654 | |
2655 | >>> from lp.bugs.tests.bug import print_bugs_list |
2656 | @@ -30,9 +30,9 @@ be reversed. |
2657 | |
2658 | >>> user_browser.open("http://launchpad.test/products/firefox/+filebug") |
2659 | |
2660 | - >>> user_browser.getControl( |
2661 | - ... "Summary", index=0 |
2662 | - ... ).value = "Reflow problems with SVG" |
2663 | + >>> user_browser.getControl("Summary", index=0).value = ( |
2664 | + ... "Reflow problems with SVG" |
2665 | + ... ) |
2666 | >>> user_browser.getControl("Continue").click() |
2667 | |
2668 | >>> print_bugs_list(user_browser.contents, "similar-bugs") |
2669 | diff --git a/lib/lp/bugs/stories/standalone/xx-filebug-package-chooser-radio-buttons.rst b/lib/lp/bugs/stories/standalone/xx-filebug-package-chooser-radio-buttons.rst |
2670 | index 3185b95..1a215d7 100644 |
2671 | --- a/lib/lp/bugs/stories/standalone/xx-filebug-package-chooser-radio-buttons.rst |
2672 | +++ b/lib/lp/bugs/stories/standalone/xx-filebug-package-chooser-radio-buttons.rst |
2673 | @@ -20,9 +20,9 @@ will use the advanced filebug form to skip searching for dupes. |
2674 | If you enter a package name that doesn't exist in the distribution, |
2675 | you're returned to the page, with the "choose" radio button selected. |
2676 | |
2677 | - >>> user_browser.getControl( |
2678 | - ... name="field.packagename" |
2679 | - ... ).value = "nosuchpackage" |
2680 | + >>> user_browser.getControl(name="field.packagename").value = ( |
2681 | + ... "nosuchpackage" |
2682 | + ... ) |
2683 | >>> user_browser.getControl("Submit Bug Report").click() |
2684 | |
2685 | >>> user_browser.url |
2686 | diff --git a/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.rst b/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.rst |
2687 | index 6ea7a5f..9f4c059 100644 |
2688 | --- a/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.rst |
2689 | +++ b/lib/lp/bugs/stories/upstream-bugprivacy/xx-upstream-bug-privacy.rst |
2690 | @@ -3,17 +3,17 @@ contact, the maintainer will be subscribed to the bug instead. |
2691 | |
2692 | >>> browser = setupBrowser(auth="Basic foo.bar@canonical.com:test") |
2693 | >>> browser.open("http://localhost:9000/firefox/+filebug") |
2694 | - >>> browser.getControl( |
2695 | - ... "Summary", index=0 |
2696 | - ... ).value = "this is a newly created private bug" |
2697 | + >>> browser.getControl("Summary", index=0).value = ( |
2698 | + ... "this is a newly created private bug" |
2699 | + ... ) |
2700 | >>> browser.getControl("Continue").click() |
2701 | |
2702 | - >>> browser.getControl( |
2703 | - ... name="field.title" |
2704 | - ... ).value = "this is a newly created private bug" |
2705 | - >>> browser.getControl( |
2706 | - ... name="field.comment" |
2707 | - ... ).value = "very secret info here" |
2708 | + >>> browser.getControl(name="field.title").value = ( |
2709 | + ... "this is a newly created private bug" |
2710 | + ... ) |
2711 | + >>> browser.getControl(name="field.comment").value = ( |
2712 | + ... "very secret info here" |
2713 | + ... ) |
2714 | >>> browser.getControl("Private Security").selected = True |
2715 | >>> browser.getControl("Submit Bug Report").click() |
2716 | |
2717 | diff --git a/lib/lp/bugs/tests/test_bug.py b/lib/lp/bugs/tests/test_bug.py |
2718 | index 57680fb..d4265f9 100644 |
2719 | --- a/lib/lp/bugs/tests/test_bug.py |
2720 | +++ b/lib/lp/bugs/tests/test_bug.py |
2721 | @@ -438,9 +438,9 @@ class TestBugPermissions(TestCaseWithFactory, KarmaTestMixin): |
2722 | |
2723 | def test_target_bug_supervisor_can_edit(self): |
2724 | person = self.factory.makePerson() |
2725 | - removeSecurityProxy( |
2726 | - self.bug.default_bugtask.target |
2727 | - ).bug_supervisor = person |
2728 | + removeSecurityProxy(self.bug.default_bugtask.target).bug_supervisor = ( |
2729 | + person |
2730 | + ) |
2731 | with person_logged_in(person): |
2732 | self.assertTrue(checkPermission("launchpad.Edit", self.bug)) |
2733 | |
2734 | @@ -656,9 +656,9 @@ class TestBugLocking(TestCaseWithFactory): |
2735 | self.assertTrue(checkPermission("launchpad.Moderate", bug)) |
2736 | |
2737 | yet_another_person = self.factory.makePerson() |
2738 | - removeSecurityProxy( |
2739 | - bug.default_bugtask.target |
2740 | - ).bug_supervisor = yet_another_person |
2741 | + removeSecurityProxy(bug.default_bugtask.target).bug_supervisor = ( |
2742 | + yet_another_person |
2743 | + ) |
2744 | with person_logged_in(yet_another_person): |
2745 | self.assertTrue(checkPermission("launchpad.Moderate", bug)) |
2746 | |
2747 | diff --git a/lib/lp/bugs/tests/test_bug_messages.py b/lib/lp/bugs/tests/test_bug_messages.py |
2748 | index 5b926c2..c2a744a 100644 |
2749 | --- a/lib/lp/bugs/tests/test_bug_messages.py |
2750 | +++ b/lib/lp/bugs/tests/test_bug_messages.py |
2751 | @@ -45,7 +45,6 @@ class TestBugIndexedMessages(TestCaseWithFactory): |
2752 | |
2753 | |
2754 | class TestUserCanSetCommentVisibility(TestCaseWithFactory): |
2755 | - |
2756 | """Test whether expected users can toggle bug comment visibility.""" |
2757 | |
2758 | layer = DatabaseFunctionalLayer |
2759 | @@ -84,7 +83,6 @@ class TestUserCanSetCommentVisibility(TestCaseWithFactory): |
2760 | |
2761 | |
2762 | class TestBugLinkMessageSetsIncompleteStatus(TestCaseWithFactory): |
2763 | - |
2764 | """Test that Bug.linkMessage updates "Incomplete (without response)" bugs. |
2765 | |
2766 | They should transition from "Incomplete (without response)" to |
2767 | diff --git a/lib/lp/bugs/tests/test_bugtaskflat_triggers.py b/lib/lp/bugs/tests/test_bugtaskflat_triggers.py |
2768 | index 7f91c86..7ecbfca 100644 |
2769 | --- a/lib/lp/bugs/tests/test_bugtaskflat_triggers.py |
2770 | +++ b/lib/lp/bugs/tests/test_bugtaskflat_triggers.py |
2771 | @@ -331,9 +331,9 @@ class TestBugTaskFlatTriggers(BugTaskFlatTestMixin): |
2772 | # Triggers maintain BugTaskFlat when a bug is changed |
2773 | task = self.makeLoggedInTask() |
2774 | with self.bugtaskflat_is_updated(task, ["information_type"]): |
2775 | - removeSecurityProxy( |
2776 | - task.bug |
2777 | - ).information_type = InformationType.PUBLICSECURITY |
2778 | + removeSecurityProxy(task.bug).information_type = ( |
2779 | + InformationType.PUBLICSECURITY |
2780 | + ) |
2781 | |
2782 | def test_bug_make_private(self): |
2783 | # Triggers maintain BugTaskFlat when a bug is made private. |
2784 | @@ -341,9 +341,9 @@ class TestBugTaskFlatTriggers(BugTaskFlatTestMixin): |
2785 | with self.bugtaskflat_is_updated( |
2786 | task, ["information_type", "access_policies", "access_grants"] |
2787 | ): |
2788 | - removeSecurityProxy( |
2789 | - task.bug |
2790 | - ).information_type = InformationType.USERDATA |
2791 | + removeSecurityProxy(task.bug).information_type = ( |
2792 | + InformationType.USERDATA |
2793 | + ) |
2794 | |
2795 | def test_bug_make_public(self): |
2796 | # Triggers maintain BugTaskFlat when a bug is made public. |
2797 | diff --git a/lib/lp/buildmaster/builderproxy.py b/lib/lp/buildmaster/builderproxy.py |
2798 | index cdc5c36..be65e29 100644 |
2799 | --- a/lib/lp/buildmaster/builderproxy.py |
2800 | +++ b/lib/lp/buildmaster/builderproxy.py |
2801 | @@ -40,13 +40,13 @@ class BuilderProxyMixin: |
2802 | ) -> Generator[None, Dict[str, str], None]: |
2803 | if _get_proxy_config("builder_proxy_host") and allow_internet: |
2804 | token = yield self._requestProxyToken() |
2805 | - args[ |
2806 | - "proxy_url" |
2807 | - ] = "http://{username}:{password}@{host}:{port}".format( |
2808 | - username=token["username"], |
2809 | - password=token["secret"], |
2810 | - host=_get_proxy_config("builder_proxy_host"), |
2811 | - port=_get_proxy_config("builder_proxy_port"), |
2812 | + args["proxy_url"] = ( |
2813 | + "http://{username}:{password}@{host}:{port}".format( |
2814 | + username=token["username"], |
2815 | + password=token["secret"], |
2816 | + host=_get_proxy_config("builder_proxy_host"), |
2817 | + port=_get_proxy_config("builder_proxy_port"), |
2818 | + ) |
2819 | ) |
2820 | args["revocation_endpoint"] = "{endpoint}/{token}".format( |
2821 | endpoint=_get_proxy_config("builder_proxy_auth_api_endpoint"), |
2822 | diff --git a/lib/lp/buildmaster/model/buildfarmjob.py b/lib/lp/buildmaster/model/buildfarmjob.py |
2823 | index a152c14..e3a910a 100644 |
2824 | --- a/lib/lp/buildmaster/model/buildfarmjob.py |
2825 | +++ b/lib/lp/buildmaster/model/buildfarmjob.py |
2826 | @@ -264,9 +264,9 @@ class BuildFarmJobMixin: |
2827 | # XXX cprov 20060615 bug=120584: Currently buildduration includes |
2828 | # the scanner latency, it should really be asking the worker for |
2829 | # the duration spent building locally. |
2830 | - self.build_farm_job.date_finished = ( |
2831 | - self.date_finished |
2832 | - ) = date_finished or datetime.now(timezone.utc) |
2833 | + self.build_farm_job.date_finished = self.date_finished = ( |
2834 | + date_finished or datetime.now(timezone.utc) |
2835 | + ) |
2836 | self.emitMetric("finished", status=status.name) |
2837 | |
2838 | def gotFailure(self): |
2839 | diff --git a/lib/lp/charms/browser/tests/test_charmrecipe.py b/lib/lp/charms/browser/tests/test_charmrecipe.py |
2840 | index 427b96f..d3a27b7 100644 |
2841 | --- a/lib/lp/charms/browser/tests/test_charmrecipe.py |
2842 | +++ b/lib/lp/charms/browser/tests/test_charmrecipe.py |
2843 | @@ -235,9 +235,9 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView): |
2844 | project, view_name="+new-charm-recipe", user=self.person |
2845 | ) |
2846 | browser.getControl(name="field.name").value = "charm-name" |
2847 | - browser.getControl( |
2848 | - name="field.git_ref.repository" |
2849 | - ).value = git_ref_shortened_path |
2850 | + browser.getControl(name="field.git_ref.repository").value = ( |
2851 | + git_ref_shortened_path |
2852 | + ) |
2853 | browser.getControl(name="field.git_ref.path").value = git_ref_path |
2854 | browser.getControl("Create charm recipe").click() |
2855 | |
2856 | @@ -321,15 +321,15 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView): |
2857 | browser.getControl( |
2858 | name="field.auto_build_channels.charmcraft" |
2859 | ).value = "edge" |
2860 | - browser.getControl( |
2861 | - name="field.auto_build_channels.core" |
2862 | - ).value = "stable" |
2863 | - browser.getControl( |
2864 | - name="field.auto_build_channels.core18" |
2865 | - ).value = "beta" |
2866 | - browser.getControl( |
2867 | - name="field.auto_build_channels.core20" |
2868 | - ).value = "edge/feature" |
2869 | + browser.getControl(name="field.auto_build_channels.core").value = ( |
2870 | + "stable" |
2871 | + ) |
2872 | + browser.getControl(name="field.auto_build_channels.core18").value = ( |
2873 | + "beta" |
2874 | + ) |
2875 | + browser.getControl(name="field.auto_build_channels.core20").value = ( |
2876 | + "edge/feature" |
2877 | + ) |
2878 | browser.getControl("Create charm recipe").click() |
2879 | |
2880 | content = find_main_content(browser.contents) |
2881 | @@ -366,9 +366,9 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView): |
2882 | browser.getControl("Automatically upload to store").selected = True |
2883 | browser.getControl("Registered store name").value = "charmhub-name" |
2884 | self.assertFalse(browser.getControl("Stable").selected) |
2885 | - browser.getControl( |
2886 | - name="field.store_channels.add_track" |
2887 | - ).value = "track" |
2888 | + browser.getControl(name="field.store_channels.add_track").value = ( |
2889 | + "track" |
2890 | + ) |
2891 | browser.getControl(name="field.store_channels.add_risk").value = [ |
2892 | "edge" |
2893 | ] |
2894 | @@ -525,13 +525,13 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView): |
2895 | browser.getControl("Automatically upload to store").selected = True |
2896 | browser.getControl("Registered store name").value = "charmhub-name" |
2897 | self.assertFalse(browser.getControl("Stable").selected) |
2898 | - browser.getControl( |
2899 | - name="field.store_channels.add_track" |
2900 | - ).value = "track" |
2901 | + browser.getControl(name="field.store_channels.add_track").value = ( |
2902 | + "track" |
2903 | + ) |
2904 | browser.getControl("Edge").selected = True |
2905 | - browser.getControl( |
2906 | - name="field.store_channels.add_branch" |
2907 | - ).value = "branch" |
2908 | + browser.getControl(name="field.store_channels.add_branch").value = ( |
2909 | + "branch" |
2910 | + ) |
2911 | |
2912 | browser.getControl("Create charm recipe").click() |
2913 | |
2914 | @@ -560,9 +560,9 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView): |
2915 | browser.getControl("Automatically upload to store").selected = True |
2916 | browser.getControl(name="field.name").value = "test-recipe-name" |
2917 | browser.getControl("Registered store name").value = "charmhub-name" |
2918 | - browser.getControl( |
2919 | - name="field.store_channels.add_track" |
2920 | - ).value = "new-track" |
2921 | + browser.getControl(name="field.store_channels.add_track").value = ( |
2922 | + "new-track" |
2923 | + ) |
2924 | |
2925 | browser.getControl("Create charm recipe").click() |
2926 | |
2927 | @@ -574,12 +574,12 @@ class TestCharmRecipeAddView(BaseTestCharmRecipeView): |
2928 | browser.getControl("Automatically upload to store").selected = True |
2929 | browser.getControl(name="field.name").value = "test-recipe-name" |
2930 | browser.getControl("Registered store name").value = "charmhub-name" |
2931 | - browser.getControl( |
2932 | - name="field.store_channels.add_track" |
2933 | - ).value = "new-track" |
2934 | - browser.getControl( |
2935 | - name="field.store_channels.add_branch" |
2936 | - ).value = "new-branch" |
2937 | + browser.getControl(name="field.store_channels.add_track").value = ( |
2938 | + "new-track" |
2939 | + ) |
2940 | + browser.getControl(name="field.store_channels.add_branch").value = ( |
2941 | + "new-branch" |
2942 | + ) |
2943 | |
2944 | browser.getControl("Create charm recipe").click() |
2945 | |
2946 | @@ -662,9 +662,9 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView): |
2947 | browser.getLink("Edit charm recipe").click() |
2948 | browser.getControl("Owner").value = ["new-team"] |
2949 | browser.getControl(name="field.name").value = "new-name" |
2950 | - browser.getControl( |
2951 | - name="field.git_ref.repository" |
2952 | - ).value = new_git_ref_identity |
2953 | + browser.getControl(name="field.git_ref.repository").value = ( |
2954 | + new_git_ref_identity |
2955 | + ) |
2956 | browser.getControl(name="field.git_ref.path").value = new_git_ref_path |
2957 | browser.getControl("Build path").value = "some-path" |
2958 | browser.getControl( |
2959 | @@ -723,12 +723,12 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView): |
2960 | ) |
2961 | view_url = canonical_url(recipe, view_name="+edit") |
2962 | browser = self.getNonRedirectingBrowser(url=view_url, user=self.person) |
2963 | - browser.getControl( |
2964 | - name="field.store_channels.add_track" |
2965 | - ).value = "new-track" |
2966 | - browser.getControl( |
2967 | - name="field.store_channels.add_branch" |
2968 | - ).value = "new-branch" |
2969 | + browser.getControl(name="field.store_channels.add_track").value = ( |
2970 | + "new-track" |
2971 | + ) |
2972 | + browser.getControl(name="field.store_channels.add_branch").value = ( |
2973 | + "new-branch" |
2974 | + ) |
2975 | browser.getControl(name="field.store_channels.add_risk").value = [ |
2976 | "edge" |
2977 | ] |
2978 | @@ -799,12 +799,12 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView): |
2979 | ) |
2980 | view_url = canonical_url(recipe, view_name="+edit") |
2981 | browser = self.getNonRedirectingBrowser(url=view_url, user=self.person) |
2982 | - browser.getControl( |
2983 | - name="field.store_channels.track_0" |
2984 | - ).value = "new-track" |
2985 | - browser.getControl( |
2986 | - name="field.store_channels.branch_0" |
2987 | - ).value = "new-branch" |
2988 | + browser.getControl(name="field.store_channels.track_0").value = ( |
2989 | + "new-track" |
2990 | + ) |
2991 | + browser.getControl(name="field.store_channels.branch_0").value = ( |
2992 | + "new-branch" |
2993 | + ) |
2994 | browser.getControl(name="field.store_channels.risk_0").value = [ |
2995 | "candidate" |
2996 | ] |
2997 | @@ -901,9 +901,9 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView): |
2998 | |
2999 | # If the user entered only Track for the new channel entry, |
3000 | # ensure we error with missing Risk message. |
3001 | - browser.getControl( |
3002 | - name="field.store_channels.add_track" |
3003 | - ).value = "new-track" |
3004 | + browser.getControl(name="field.store_channels.add_track").value = ( |
3005 | + "new-track" |
3006 | + ) |
3007 | |
3008 | browser.getControl("Update charm recipe").click() |
3009 | |
3010 | @@ -913,9 +913,9 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView): |
3011 | # ensure we error with missing Risk message. |
3012 | browser = self.getViewBrowser(recipe, user=self.person) |
3013 | browser.getLink("Edit charm recipe").click() |
3014 | - browser.getControl( |
3015 | - name="field.store_channels.add_branch" |
3016 | - ).value = "new-branch" |
3017 | + browser.getControl(name="field.store_channels.add_branch").value = ( |
3018 | + "new-branch" |
3019 | + ) |
3020 | |
3021 | browser.getControl("Update charm recipe").click() |
3022 | |
3023 | @@ -925,12 +925,12 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView): |
3024 | # ensure we error with missing Risk message. |
3025 | browser = self.getViewBrowser(recipe, user=self.person) |
3026 | browser.getLink("Edit charm recipe").click() |
3027 | - browser.getControl( |
3028 | - name="field.store_channels.add_track" |
3029 | - ).value = "new-track" |
3030 | - browser.getControl( |
3031 | - name="field.store_channels.add_branch" |
3032 | - ).value = "new-branch" |
3033 | + browser.getControl(name="field.store_channels.add_track").value = ( |
3034 | + "new-track" |
3035 | + ) |
3036 | + browser.getControl(name="field.store_channels.add_branch").value = ( |
3037 | + "new-branch" |
3038 | + ) |
3039 | |
3040 | browser.getControl("Update charm recipe").click() |
3041 | |
3042 | @@ -1012,9 +1012,9 @@ class TestCharmRecipeEditView(BaseTestCharmRecipeView): |
3043 | private_ref_path = private_ref.path |
3044 | browser = self.getViewBrowser(recipe, user=self.person) |
3045 | browser.getLink("Edit charm recipe").click() |
3046 | - browser.getControl( |
3047 | - name="field.git_ref.repository" |
3048 | - ).value = private_ref_identity |
3049 | + browser.getControl(name="field.git_ref.repository").value = ( |
3050 | + private_ref_identity |
3051 | + ) |
3052 | browser.getControl(name="field.git_ref.path").value = private_ref_path |
3053 | browser.getControl("Update charm recipe").click() |
3054 | self.assertEqual( |
3055 | diff --git a/lib/lp/charms/browser/tests/test_charmrecipelisting.py b/lib/lp/charms/browser/tests/test_charmrecipelisting.py |
3056 | index a9baeea..e37f3b8 100644 |
3057 | --- a/lib/lp/charms/browser/tests/test_charmrecipelisting.py |
3058 | +++ b/lib/lp/charms/browser/tests/test_charmrecipelisting.py |
3059 | @@ -215,9 +215,9 @@ class TestCharmRecipeListing(BrowserTestCase): |
3060 | with MemoryFeatureFixture({CHARM_RECIPE_ALLOW_CREATE: "on"}): |
3061 | recipes = [create_recipe() for i in range(count)] |
3062 | for i, recipe in enumerate(recipes): |
3063 | - removeSecurityProxy( |
3064 | - recipe |
3065 | - ).date_last_modified = start_time - timedelta(seconds=i) |
3066 | + removeSecurityProxy(recipe).date_last_modified = ( |
3067 | + start_time - timedelta(seconds=i) |
3068 | + ) |
3069 | return [ |
3070 | soupmatchers.Tag( |
3071 | "charm recipe link", |
3072 | diff --git a/lib/lp/charms/tests/test_charmrecipe.py b/lib/lp/charms/tests/test_charmrecipe.py |
3073 | index df6ba5a..0b41a97 100644 |
3074 | --- a/lib/lp/charms/tests/test_charmrecipe.py |
3075 | +++ b/lib/lp/charms/tests/test_charmrecipe.py |
3076 | @@ -736,10 +736,8 @@ class TestCharmRecipe(TestCaseWithFactory): |
3077 | } |
3078 | ) |
3079 | ) |
3080 | - self.useFixture( |
3081 | - GitHostingFixture() |
3082 | - ).getBlob.failure = GitRepositoryBlobNotFound( |
3083 | - "placeholder", "charmcraft.yaml" |
3084 | + self.useFixture(GitHostingFixture()).getBlob.failure = ( |
3085 | + GitRepositoryBlobNotFound("placeholder", "charmcraft.yaml") |
3086 | ) |
3087 | old_distro_series = self.factory.makeDistroSeries( |
3088 | distribution=getUtility(ILaunchpadCelebrities).ubuntu, |
3089 | diff --git a/lib/lp/charms/tests/test_charmrecipejob.py b/lib/lp/charms/tests/test_charmrecipejob.py |
3090 | index 2b33d2e..38be8d9 100644 |
3091 | --- a/lib/lp/charms/tests/test_charmrecipejob.py |
3092 | +++ b/lib/lp/charms/tests/test_charmrecipejob.py |
3093 | @@ -239,9 +239,9 @@ class TestCharmRecipeRequestBuildsJob(TestCaseWithFactory): |
3094 | job = CharmRecipeRequestBuildsJob.create( |
3095 | recipe, recipe.registrant, channels={"core": "stable"} |
3096 | ) |
3097 | - self.useFixture( |
3098 | - GitHostingFixture() |
3099 | - ).getBlob.failure = CannotParseCharmcraftYaml("Nonsense on stilts") |
3100 | + self.useFixture(GitHostingFixture()).getBlob.failure = ( |
3101 | + CannotParseCharmcraftYaml("Nonsense on stilts") |
3102 | + ) |
3103 | with dbuser(config.ICharmRecipeRequestBuildsJobSource.dbuser): |
3104 | JobRunner([job]).runAll() |
3105 | now = get_transaction_timestamp(IStore(recipe)) |
3106 | diff --git a/lib/lp/code/browser/branchmergeproposal.py b/lib/lp/code/browser/branchmergeproposal.py |
3107 | index ecf1251..4d4d0cd 100644 |
3108 | --- a/lib/lp/code/browser/branchmergeproposal.py |
3109 | +++ b/lib/lp/code/browser/branchmergeproposal.py |
3110 | @@ -637,11 +637,12 @@ class BranchMergeProposalView( |
3111 | "code.bzr.diff.disable_proxy" |
3112 | ): |
3113 | # This fallback works for public branches, but not private ones. |
3114 | - cache.objects[ |
3115 | - "branch_diff_link" |
3116 | - ] = "https://%s/+loggerhead/%s/diff/" % ( |
3117 | - config.launchpad.code_domain, |
3118 | - self.context.source_branch.unique_name, |
3119 | + cache.objects["branch_diff_link"] = ( |
3120 | + "https://%s/+loggerhead/%s/diff/" |
3121 | + % ( |
3122 | + config.launchpad.code_domain, |
3123 | + self.context.source_branch.unique_name, |
3124 | + ) |
3125 | ) |
3126 | else: |
3127 | cache.objects["branch_diff_link"] = ( |
3128 | diff --git a/lib/lp/code/browser/branchsubscription.py b/lib/lp/code/browser/branchsubscription.py |
3129 | index 46b53a5..5877a14 100644 |
3130 | --- a/lib/lp/code/browser/branchsubscription.py |
3131 | +++ b/lib/lp/code/browser/branchsubscription.py |
3132 | @@ -64,7 +64,6 @@ class BranchPortletSubscribersContent(LaunchpadView): |
3133 | |
3134 | |
3135 | class _BranchSubscriptionView(LaunchpadFormView): |
3136 | - |
3137 | """Contains the common functionality of the Add and Edit views.""" |
3138 | |
3139 | schema = IBranchSubscription |
3140 | diff --git a/lib/lp/code/browser/tests/test_branch.py b/lib/lp/code/browser/tests/test_branch.py |
3141 | index 4987a31..0dd2c8b 100644 |
3142 | --- a/lib/lp/code/browser/tests/test_branch.py |
3143 | +++ b/lib/lp/code/browser/tests/test_branch.py |
3144 | @@ -1092,9 +1092,9 @@ class TestBranchProposalsVisible(TestCaseWithFactory): |
3145 | # If the target is private, the landing targets should not include it. |
3146 | bmp = self.factory.makeBranchMergeProposal() |
3147 | branch = bmp.source_branch |
3148 | - removeSecurityProxy( |
3149 | - bmp.target_branch |
3150 | - ).information_type = InformationType.USERDATA |
3151 | + removeSecurityProxy(bmp.target_branch).information_type = ( |
3152 | + InformationType.USERDATA |
3153 | + ) |
3154 | view = create_view(branch, "+index") |
3155 | self.assertTrue(view.no_merges) |
3156 | self.assertEqual([], view.landing_targets) |
3157 | @@ -1115,9 +1115,9 @@ class TestBranchProposalsVisible(TestCaseWithFactory): |
3158 | # it. |
3159 | bmp = self.factory.makeBranchMergeProposal() |
3160 | branch = bmp.target_branch |
3161 | - removeSecurityProxy( |
3162 | - bmp.source_branch |
3163 | - ).information_type = InformationType.USERDATA |
3164 | + removeSecurityProxy(bmp.source_branch).information_type = ( |
3165 | + InformationType.USERDATA |
3166 | + ) |
3167 | view = create_view(branch, "+index") |
3168 | self.assertTrue(view.no_merges) |
3169 | self.assertEqual([], view.landing_candidates) |
3170 | @@ -1137,9 +1137,9 @@ class TestBranchProposalsVisible(TestCaseWithFactory): |
3171 | # the target is private, then the dependent_branches are not shown. |
3172 | branch = self.factory.makeProductBranch() |
3173 | bmp = self.factory.makeBranchMergeProposal(prerequisite_branch=branch) |
3174 | - removeSecurityProxy( |
3175 | - bmp.source_branch |
3176 | - ).information_type = InformationType.USERDATA |
3177 | + removeSecurityProxy(bmp.source_branch).information_type = ( |
3178 | + InformationType.USERDATA |
3179 | + ) |
3180 | view = create_view(branch, "+index") |
3181 | self.assertTrue(view.no_merges) |
3182 | self.assertEqual([], view.dependent_branches) |
3183 | diff --git a/lib/lp/code/browser/tests/test_branchmergeproposal.py b/lib/lp/code/browser/tests/test_branchmergeproposal.py |
3184 | index fb29e40..f0269b0 100644 |
3185 | --- a/lib/lp/code/browser/tests/test_branchmergeproposal.py |
3186 | +++ b/lib/lp/code/browser/tests/test_branchmergeproposal.py |
3187 | @@ -951,9 +951,9 @@ class TestRegisterBranchMergeProposalViewGit( |
3188 | def test_default_branch(self): |
3189 | with admin_logged_in(): |
3190 | target_branch = self._makeTargetBranch(target_default=True) |
3191 | - removeSecurityProxy( |
3192 | - target_branch.repository |
3193 | - )._default_branch = target_branch.path |
3194 | + removeSecurityProxy(target_branch.repository)._default_branch = ( |
3195 | + target_branch.path |
3196 | + ) |
3197 | view = self._createView() |
3198 | self.assertEqual( |
3199 | target_branch.repository.default_branch.split("/")[-1], |
3200 | diff --git a/lib/lp/code/browser/tests/test_branchmergeproposallisting.py b/lib/lp/code/browser/tests/test_branchmergeproposallisting.py |
3201 | index 113f3ba..f95cc3b 100644 |
3202 | --- a/lib/lp/code/browser/tests/test_branchmergeproposallisting.py |
3203 | +++ b/lib/lp/code/browser/tests/test_branchmergeproposallisting.py |
3204 | @@ -548,9 +548,9 @@ class ProductContextMixin: |
3205 | |
3206 | def setUp(self): |
3207 | super().setUp() |
3208 | - self.git_target = ( |
3209 | - self.bzr_target |
3210 | - ) = self.context = self.factory.makeProduct() |
3211 | + self.git_target = self.bzr_target = self.context = ( |
3212 | + self.factory.makeProduct() |
3213 | + ) |
3214 | self.user = self.git_target.owner |
3215 | self.owner = None |
3216 | |
3217 | @@ -575,9 +575,9 @@ class DistributionSourcePackageContextMixin: |
3218 | |
3219 | def setUp(self): |
3220 | super().setUp() |
3221 | - self.git_target = ( |
3222 | - self.context |
3223 | - ) = self.factory.makeDistributionSourcePackage() |
3224 | + self.git_target = self.context = ( |
3225 | + self.factory.makeDistributionSourcePackage() |
3226 | + ) |
3227 | with admin_logged_in(): |
3228 | getUtility(IService, "sharing").sharePillarInformation( |
3229 | self.context.distribution, |
3230 | diff --git a/lib/lp/code/browser/tests/test_sourcepackagerecipe.py b/lib/lp/code/browser/tests/test_sourcepackagerecipe.py |
3231 | index 5cfc74f..dc11382 100644 |
3232 | --- a/lib/lp/code/browser/tests/test_sourcepackagerecipe.py |
3233 | +++ b/lib/lp/code/browser/tests/test_sourcepackagerecipe.py |
3234 | @@ -1964,11 +1964,11 @@ class TestSourcePackageRecipeBuildViewMixin: |
3235 | distro_series = self.factory.makeDistroSeries( |
3236 | name="squirrel", distribution=archive.distribution |
3237 | ) |
3238 | - removeSecurityProxy( |
3239 | - distro_series |
3240 | - ).nominatedarchindep = self.factory.makeDistroArchSeries( |
3241 | - distroseries=distro_series, |
3242 | - processor=getUtility(IProcessorSet).getByName("386"), |
3243 | + removeSecurityProxy(distro_series).nominatedarchindep = ( |
3244 | + self.factory.makeDistroArchSeries( |
3245 | + distroseries=distro_series, |
3246 | + processor=getUtility(IProcessorSet).getByName("386"), |
3247 | + ) |
3248 | ) |
3249 | build = self.factory.makeSourcePackageRecipeBuild( |
3250 | requester=self.user, |
3251 | diff --git a/lib/lp/code/doc/codeimport-event.rst b/lib/lp/code/doc/codeimport-event.rst |
3252 | index 2bddc7a..c557780 100644 |
3253 | --- a/lib/lp/code/doc/codeimport-event.rst |
3254 | +++ b/lib/lp/code/doc/codeimport-event.rst |
3255 | @@ -197,9 +197,9 @@ state of the code import. |
3256 | Then changes can be applied. |
3257 | |
3258 | >>> from lp.code.enums import CodeImportReviewStatus |
3259 | - >>> removeSecurityProxy( |
3260 | - ... svn_import |
3261 | - ... ).review_status = CodeImportReviewStatus.SUSPENDED |
3262 | + >>> removeSecurityProxy(svn_import).review_status = ( |
3263 | + ... CodeImportReviewStatus.SUSPENDED |
3264 | + ... ) |
3265 | |
3266 | After applying changes, the newModify method can create an event that |
3267 | details the changes that have been applied. |
3268 | diff --git a/lib/lp/code/errors.py b/lib/lp/code/errors.py |
3269 | index 82042a5..fe758c6 100644 |
3270 | --- a/lib/lp/code/errors.py |
3271 | +++ b/lib/lp/code/errors.py |
3272 | @@ -214,14 +214,12 @@ class AlreadyLatestFormat(CannotUpgradeBranch): |
3273 | |
3274 | |
3275 | class CannotUpgradeNonHosted(CannotUpgradeBranch): |
3276 | - |
3277 | """Raised on attempt to upgrade a non-Hosted branch.""" |
3278 | |
3279 | _msg_template = "Cannot upgrade non-hosted branch %s" |
3280 | |
3281 | |
3282 | class UpgradePending(CannotUpgradeBranch): |
3283 | - |
3284 | """Raised on attempt to upgrade a branch already in the latest format.""" |
3285 | |
3286 | _msg_template = "An upgrade is already in progress for branch %s." |
3287 | diff --git a/lib/lp/code/mail/branch.py b/lib/lp/code/mail/branch.py |
3288 | index c880ae5..99945c2 100644 |
3289 | --- a/lib/lp/code/mail/branch.py |
3290 | +++ b/lib/lp/code/mail/branch.py |
3291 | @@ -195,9 +195,9 @@ class RecipientReason(basemailer.RecipientReason): |
3292 | if self.merge_proposal is not None: |
3293 | source = self._getBranchIdentity(self.merge_proposal.merge_source) |
3294 | target = self._getBranchIdentity(self.merge_proposal.merge_target) |
3295 | - template_values[ |
3296 | - "merge_proposal" |
3297 | - ] = "the proposed merge of %s into %s" % (source, target) |
3298 | + template_values["merge_proposal"] = ( |
3299 | + "the proposed merge of %s into %s" % (source, target) |
3300 | + ) |
3301 | return template_values |
3302 | |
3303 | |
3304 | @@ -278,10 +278,10 @@ class BranchMailer(BaseMailer): |
3305 | branch, recipient |
3306 | ) |
3307 | else: |
3308 | - actual_recipients[ |
3309 | - recipient |
3310 | - ] = RecipientReason.forBranchSubscriber( |
3311 | - subscription, branch, recipient, rationale |
3312 | + actual_recipients[recipient] = ( |
3313 | + RecipientReason.forBranchSubscriber( |
3314 | + subscription, branch, recipient, rationale |
3315 | + ) |
3316 | ) |
3317 | if user is not None: |
3318 | from_address = format_address_for_person(user) |
3319 | diff --git a/lib/lp/code/mail/branchmergeproposal.py b/lib/lp/code/mail/branchmergeproposal.py |
3320 | index 4992286..abd7f27 100644 |
3321 | --- a/lib/lp/code/mail/branchmergeproposal.py |
3322 | +++ b/lib/lp/code/mail/branchmergeproposal.py |
3323 | @@ -216,9 +216,9 @@ class BMPMailer(BranchMailer): |
3324 | params["gap"] = "\n\n" |
3325 | |
3326 | if self.preview_diff is not None and self.preview_diff.oversized: |
3327 | - params[ |
3328 | - "diff_cutoff_warning" |
3329 | - ] = "The attached diff has been truncated due to its size.\n" |
3330 | + params["diff_cutoff_warning"] = ( |
3331 | + "The attached diff has been truncated due to its size.\n" |
3332 | + ) |
3333 | |
3334 | params["reviews"] = self._getRequestedReviews() |
3335 | params["commit_message"] = self._getCommitMessage() |
3336 | diff --git a/lib/lp/code/mail/tests/test_branch.py b/lib/lp/code/mail/tests/test_branch.py |
3337 | index c9285fc..c46b00d 100644 |
3338 | --- a/lib/lp/code/mail/tests/test_branch.py |
3339 | +++ b/lib/lp/code/mail/tests/test_branch.py |
3340 | @@ -259,9 +259,9 @@ class TestBranchMailerHeadersMixin: |
3341 | # Test the email headers for a branch modified email. |
3342 | bob = self.factory.makePerson(email="bob@example.com") |
3343 | branch = self.makeBranch(owner=bob) |
3344 | - branch.getSubscription( |
3345 | - bob |
3346 | - ).notification_level = BranchSubscriptionNotificationLevel.FULL |
3347 | + branch.getSubscription(bob).notification_level = ( |
3348 | + BranchSubscriptionNotificationLevel.FULL |
3349 | + ) |
3350 | switch_dbuser(config.IBranchModifiedMailJobSource.dbuser) |
3351 | mailer = BranchMailer.forBranchModified(branch, branch.owner, None) |
3352 | mailer.message_id = "<foobar-example-com>" |
3353 | @@ -282,9 +282,9 @@ class TestBranchMailerHeadersMixin: |
3354 | # Test the email headers for new revision email. |
3355 | bob = self.factory.makePerson(email="bob@example.com") |
3356 | branch = self.makeBranch(owner=bob) |
3357 | - branch.getSubscription( |
3358 | - bob |
3359 | - ).notification_level = BranchSubscriptionNotificationLevel.FULL |
3360 | + branch.getSubscription(bob).notification_level = ( |
3361 | + BranchSubscriptionNotificationLevel.FULL |
3362 | + ) |
3363 | switch_dbuser(config.IRevisionsAddedJobSource.dbuser) |
3364 | mailer = BranchMailer.forRevision( |
3365 | branch, |
3366 | @@ -426,9 +426,9 @@ class TestBranchMailerSubjectMixin: |
3367 | # No string interpolation should occur on the subject. |
3368 | branch = self.makeBranch() |
3369 | # Subscribe the owner to get revision email. |
3370 | - branch.getSubscription( |
3371 | - branch.owner |
3372 | - ).notification_level = BranchSubscriptionNotificationLevel.FULL |
3373 | + branch.getSubscription(branch.owner).notification_level = ( |
3374 | + BranchSubscriptionNotificationLevel.FULL |
3375 | + ) |
3376 | switch_dbuser(config.IRevisionsAddedJobSource.dbuser) |
3377 | mailer = BranchMailer.forRevision( |
3378 | branch, |
3379 | diff --git a/lib/lp/code/model/branchmergeproposal.py b/lib/lp/code/model/branchmergeproposal.py |
3380 | index 7abdeff..a697a66 100644 |
3381 | --- a/lib/lp/code/model/branchmergeproposal.py |
3382 | +++ b/lib/lp/code/model/branchmergeproposal.py |
3383 | @@ -1602,9 +1602,9 @@ class BranchMergeProposal(StormBase, BugLinkTargetMixin): |
3384 | diffs = load_related(Diff, preview_diffs, ["diff_id"]) |
3385 | preview_diff_map = {} |
3386 | for previewdiff in preview_diffs: |
3387 | - preview_diff_map[ |
3388 | - previewdiff.branch_merge_proposal_id |
3389 | - ] = previewdiff |
3390 | + preview_diff_map[previewdiff.branch_merge_proposal_id] = ( |
3391 | + previewdiff |
3392 | + ) |
3393 | for mp in branch_merge_proposals: |
3394 | get_property_cache(mp).preview_diff = preview_diff_map.get(mp.id) |
3395 | |
3396 | diff --git a/lib/lp/code/model/githosting.py b/lib/lp/code/model/githosting.py |
3397 | index 5ed215a..9a42a4c 100644 |
3398 | --- a/lib/lp/code/model/githosting.py |
3399 | +++ b/lib/lp/code/model/githosting.py |
3400 | @@ -275,9 +275,11 @@ class GitHostingClient: |
3401 | path, |
3402 | sources, |
3403 | target, |
3404 | - "" |
3405 | - if previous_target is None |
3406 | - else " (stopping at %s)" % previous_target, |
3407 | + ( |
3408 | + "" |
3409 | + if previous_target is None |
3410 | + else " (stopping at %s)" % previous_target |
3411 | + ), |
3412 | ) |
3413 | ) |
3414 | return self._post( |
3415 | diff --git a/lib/lp/code/model/gitref.py b/lib/lp/code/model/gitref.py |
3416 | index 9abe5d1..48c8f32 100644 |
3417 | --- a/lib/lp/code/model/gitref.py |
3418 | +++ b/lib/lp/code/model/gitref.py |
3419 | @@ -427,20 +427,26 @@ class GitRefMixin: |
3420 | { |
3421 | "sha1": self.commit_sha1, |
3422 | "message": self.commit_message, |
3423 | - "author": None |
3424 | - if self.author is None |
3425 | - else { |
3426 | - "name": self.author.name_without_email, |
3427 | - "email": self.author.email, |
3428 | - "time": seconds_since_epoch(self.author_date), |
3429 | - }, |
3430 | - "committer": None |
3431 | - if self.committer is None |
3432 | - else { |
3433 | - "name": self.committer.name_without_email, |
3434 | - "email": self.committer.email, |
3435 | - "time": seconds_since_epoch(self.committer_date), |
3436 | - }, |
3437 | + "author": ( |
3438 | + None |
3439 | + if self.author is None |
3440 | + else { |
3441 | + "name": self.author.name_without_email, |
3442 | + "email": self.author.email, |
3443 | + "time": seconds_since_epoch(self.author_date), |
3444 | + } |
3445 | + ), |
3446 | + "committer": ( |
3447 | + None |
3448 | + if self.committer is None |
3449 | + else { |
3450 | + "name": self.committer.name_without_email, |
3451 | + "email": self.committer.email, |
3452 | + "time": seconds_since_epoch( |
3453 | + self.committer_date |
3454 | + ), |
3455 | + } |
3456 | + ), |
3457 | } |
3458 | ] |
3459 | return log |
3460 | diff --git a/lib/lp/code/model/tests/test_branchmergeproposaljobs.py b/lib/lp/code/model/tests/test_branchmergeproposaljobs.py |
3461 | index f1d7889..5edd3fa 100644 |
3462 | --- a/lib/lp/code/model/tests/test_branchmergeproposaljobs.py |
3463 | +++ b/lib/lp/code/model/tests/test_branchmergeproposaljobs.py |
3464 | @@ -354,9 +354,9 @@ class TestUpdatePreviewDiffJob(DiffTestCase): |
3465 | self.factory.makeRevisionsForBranch(bmp.target_branch, count=1) |
3466 | # Kludge a branch being a bit out of date in a way that will make |
3467 | # pending_writes true, without anything else failing. |
3468 | - removeSecurityProxy( |
3469 | - bmp.source_branch |
3470 | - ).last_mirrored_id = self.factory.getUniqueString() |
3471 | + removeSecurityProxy(bmp.source_branch).last_mirrored_id = ( |
3472 | + self.factory.getUniqueString() |
3473 | + ) |
3474 | job = UpdatePreviewDiffJob.create(bmp) |
3475 | # pop_notifications() |
3476 | JobRunner([job]).runAll() |
3477 | diff --git a/lib/lp/code/model/tests/test_cibuild.py b/lib/lp/code/model/tests/test_cibuild.py |
3478 | index b80c3e9..78d7f14 100644 |
3479 | --- a/lib/lp/code/model/tests/test_cibuild.py |
3480 | +++ b/lib/lp/code/model/tests/test_cibuild.py |
3481 | @@ -504,12 +504,12 @@ class TestCIBuild(TestCaseWithFactory): |
3482 | |
3483 | def test_getConfiguration_not_found(self): |
3484 | build = self.factory.makeCIBuild() |
3485 | - self.useFixture( |
3486 | - GitHostingFixture() |
3487 | - ).getBlob.failure = GitRepositoryBlobNotFound( |
3488 | - build.git_repository.getInternalPath(), |
3489 | - ".launchpad.yaml", |
3490 | - rev=build.commit_sha1, |
3491 | + self.useFixture(GitHostingFixture()).getBlob.failure = ( |
3492 | + GitRepositoryBlobNotFound( |
3493 | + build.git_repository.getInternalPath(), |
3494 | + ".launchpad.yaml", |
3495 | + rev=build.commit_sha1, |
3496 | + ) |
3497 | ) |
3498 | self.assertRaisesWithContent( |
3499 | MissingConfiguration, |
3500 | @@ -520,9 +520,9 @@ class TestCIBuild(TestCaseWithFactory): |
3501 | |
3502 | def test_getConfiguration_fetch_error(self): |
3503 | build = self.factory.makeCIBuild() |
3504 | - self.useFixture( |
3505 | - GitHostingFixture() |
3506 | - ).getBlob.failure = GitRepositoryScanFault("Boom") |
3507 | + self.useFixture(GitHostingFixture()).getBlob.failure = ( |
3508 | + GitRepositoryScanFault("Boom") |
3509 | + ) |
3510 | self.assertRaisesWithContent( |
3511 | CannotFetchConfiguration, |
3512 | "Failed to get .launchpad.yaml from %s: Boom" |
3513 | diff --git a/lib/lp/code/model/tests/test_gitrepository.py b/lib/lp/code/model/tests/test_gitrepository.py |
3514 | index b4dbef8..5ab6996 100644 |
3515 | --- a/lib/lp/code/model/tests/test_gitrepository.py |
3516 | +++ b/lib/lp/code/model/tests/test_gitrepository.py |
3517 | @@ -2340,9 +2340,9 @@ class TestGitRepositoryRefs(TestCaseWithFactory): |
3518 | self.assertEqual(ref.repository, ref_HEAD.repository) |
3519 | self.assertEqual("HEAD", ref_HEAD.path) |
3520 | self.assertRaises(NotFoundError, getattr, ref_HEAD, "commit_sha1") |
3521 | - removeSecurityProxy( |
3522 | - ref.repository |
3523 | - )._default_branch = "refs/heads/missing" |
3524 | + removeSecurityProxy(ref.repository)._default_branch = ( |
3525 | + "refs/heads/missing" |
3526 | + ) |
3527 | self.assertRaises(NotFoundError, getattr, ref_HEAD, "commit_sha1") |
3528 | removeSecurityProxy(ref.repository)._default_branch = ref.path |
3529 | self.assertEqual(ref.commit_sha1, ref_HEAD.commit_sha1) |
3530 | diff --git a/lib/lp/code/model/tests/test_sourcepackagerecipe.py b/lib/lp/code/model/tests/test_sourcepackagerecipe.py |
3531 | index 715dd9a..08d92b5 100644 |
3532 | --- a/lib/lp/code/model/tests/test_sourcepackagerecipe.py |
3533 | +++ b/lib/lp/code/model/tests/test_sourcepackagerecipe.py |
3534 | @@ -123,9 +123,9 @@ class GitMixin: |
3535 | |
3536 | @staticmethod |
3537 | def setInformationType(branch, information_type): |
3538 | - removeSecurityProxy( |
3539 | - branch |
3540 | - ).repository.information_type = information_type |
3541 | + removeSecurityProxy(branch).repository.information_type = ( |
3542 | + information_type |
3543 | + ) |
3544 | |
3545 | def makeRecipeText(self): |
3546 | branch = self.makeBranch() |
3547 | diff --git a/lib/lp/code/model/tests/test_sourcepackagerecipebuild.py b/lib/lp/code/model/tests/test_sourcepackagerecipebuild.py |
3548 | index d08294d..82227d7 100644 |
3549 | --- a/lib/lp/code/model/tests/test_sourcepackagerecipebuild.py |
3550 | +++ b/lib/lp/code/model/tests/test_sourcepackagerecipebuild.py |
3551 | @@ -51,9 +51,9 @@ class TestSourcePackageRecipeBuild(TestCaseWithFactory): |
3552 | distroseries_i386 = distroseries.newArch( |
3553 | "i386", getUtility(IProcessorSet).getByName("386"), False, person |
3554 | ) |
3555 | - removeSecurityProxy( |
3556 | - distroseries |
3557 | - ).nominatedarchindep = distroseries_i386 |
3558 | + removeSecurityProxy(distroseries).nominatedarchindep = ( |
3559 | + distroseries_i386 |
3560 | + ) |
3561 | if archive is None: |
3562 | archive = self.factory.makeArchive() |
3563 | |
3564 | diff --git a/lib/lp/code/stories/branches/package-branch-merge-proposals.rst b/lib/lp/code/stories/branches/package-branch-merge-proposals.rst |
3565 | index 41401cf..4d49605 100644 |
3566 | --- a/lib/lp/code/stories/branches/package-branch-merge-proposals.rst |
3567 | +++ b/lib/lp/code/stories/branches/package-branch-merge-proposals.rst |
3568 | @@ -18,7 +18,7 @@ branches. |
3569 | >>> browser = setupBrowser(auth="Basic eric@example.com:test") |
3570 | >>> browser.open(b1_url) |
3571 | >>> browser.getLink("Propose for merging").click() |
3572 | - >>> browser.getControl( |
3573 | - ... name="field.target_branch.target_branch" |
3574 | - ... ).value = b2_name |
3575 | + >>> browser.getControl(name="field.target_branch.target_branch").value = ( |
3576 | + ... b2_name |
3577 | + ... ) |
3578 | >>> browser.getControl("Propose Merge").click() |
3579 | diff --git a/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.rst b/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.rst |
3580 | index eeb9b40..fc70eb3 100644 |
3581 | --- a/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.rst |
3582 | +++ b/lib/lp/code/stories/branches/package-branch-merges-with-product-branches.rst |
3583 | @@ -27,9 +27,9 @@ with a product branch. |
3584 | >>> browser = setupBrowser(auth="Basic eric@example.com:test") |
3585 | >>> browser.open(b1_url) |
3586 | >>> browser.getLink("Propose for merging").click() |
3587 | - >>> browser.getControl( |
3588 | - ... name="field.target_branch.target_branch" |
3589 | - ... ).value = b2_name |
3590 | + >>> browser.getControl(name="field.target_branch.target_branch").value = ( |
3591 | + ... b2_name |
3592 | + ... ) |
3593 | >>> browser.getControl("Propose Merge").click() |
3594 | |
3595 | >>> print_errors(browser.contents) |
3596 | @@ -47,7 +47,7 @@ Linking the packages makes this possible. |
3597 | |
3598 | >>> browser.open(b1_url) |
3599 | >>> browser.getLink("Propose for merging").click() |
3600 | - >>> browser.getControl( |
3601 | - ... name="field.target_branch.target_branch" |
3602 | - ... ).value = b2_name |
3603 | + >>> browser.getControl(name="field.target_branch.target_branch").value = ( |
3604 | + ... b2_name |
3605 | + ... ) |
3606 | >>> browser.getControl("Propose Merge").click() |
3607 | diff --git a/lib/lp/code/stories/branches/xx-branch-edit.rst b/lib/lp/code/stories/branches/xx-branch-edit.rst |
3608 | index e6a8443..35d0af4 100644 |
3609 | --- a/lib/lp/code/stories/branches/xx-branch-edit.rst |
3610 | +++ b/lib/lp/code/stories/branches/xx-branch-edit.rst |
3611 | @@ -54,9 +54,9 @@ Then, post the changes to the summary. Also add a trailing slash to the |
3612 | URL. |
3613 | |
3614 | >>> browser.getControl("Branch URL").value += "/" |
3615 | - >>> browser.getControl( |
3616 | - ... "Description" |
3617 | - ... ).value = "Klingon support for Gnome Terminal" |
3618 | + >>> browser.getControl("Description").value = ( |
3619 | + ... "Klingon support for Gnome Terminal" |
3620 | + ... ) |
3621 | >>> browser.getControl("Change Branch").click() |
3622 | |
3623 | We should be redirected to the branch page, check that our changes were |
3624 | @@ -212,9 +212,9 @@ Edit forms do the same URL validation checks as the add forms. |
3625 | |
3626 | >>> browser.open("http://code.launchpad.test/~name12/gnome-terminal/main") |
3627 | >>> browser.getLink("Change branch details").click() |
3628 | - >>> browser.getControl( |
3629 | - ... "Branch URL" |
3630 | - ... ).value = "http://bazaar.launchpad.test/~foo/bar/baz" |
3631 | + >>> browser.getControl("Branch URL").value = ( |
3632 | + ... "http://bazaar.launchpad.test/~foo/bar/baz" |
3633 | + ... ) |
3634 | >>> browser.getControl("Change Branch").click() |
3635 | |
3636 | >>> print_feedback_messages(browser.contents) |
3637 | @@ -228,9 +228,9 @@ Check that when editing a hosted branch the URL field is not shown. |
3638 | ... "http://code.launchpad.test/~name12/gnome-terminal/scanned" |
3639 | ... ) |
3640 | >>> browser.getLink("Change branch details").click() |
3641 | - >>> browser.getControl( |
3642 | - ... "Branch URL" |
3643 | - ... ).value = "http://acme.example.com/~foo/bar/baz" |
3644 | + >>> browser.getControl("Branch URL").value = ( |
3645 | + ... "http://acme.example.com/~foo/bar/baz" |
3646 | + ... ) |
3647 | Traceback (most recent call last): |
3648 | ... |
3649 | LookupError: label ...'Branch URL' |
3650 | diff --git a/lib/lp/code/stories/branches/xx-branch-listings.rst b/lib/lp/code/stories/branches/xx-branch-listings.rst |
3651 | index 95ecebc..dbc43b2 100644 |
3652 | --- a/lib/lp/code/stories/branches/xx-branch-listings.rst |
3653 | +++ b/lib/lp/code/stories/branches/xx-branch-listings.rst |
3654 | @@ -404,9 +404,9 @@ development focus branch. |
3655 | |
3656 | >>> admin_browser.open("http://launchpad.test/gnome-terminal/trunk") |
3657 | >>> admin_browser.getLink("Link to branch").click() |
3658 | - >>> admin_browser.getControl( |
3659 | - ... name="field.branch_location" |
3660 | - ... ).value = "~name12/gnome-terminal/main" |
3661 | + >>> admin_browser.getControl(name="field.branch_location").value = ( |
3662 | + ... "~name12/gnome-terminal/main" |
3663 | + ... ) |
3664 | >>> admin_browser.getControl("Update").click() |
3665 | |
3666 | Now when we look at the branches for gnome-terminal, the main branch |
3667 | @@ -430,18 +430,18 @@ are comma separated and in alphabetical order. |
3668 | >>> admin_browser.getLink("Register a series").click() |
3669 | >>> admin_browser.getControl("Name").value = "pre-1.0" |
3670 | >>> admin_browser.getControl("Summary").value = "summary" |
3671 | - >>> admin_browser.getControl( |
3672 | - ... "Branch" |
3673 | - ... ).value = "~name12/gnome-terminal/main" |
3674 | + >>> admin_browser.getControl("Branch").value = ( |
3675 | + ... "~name12/gnome-terminal/main" |
3676 | + ... ) |
3677 | >>> admin_browser.getControl("Register Series").click() |
3678 | |
3679 | >>> admin_browser.open("http://launchpad.test/gnome-terminal") |
3680 | >>> admin_browser.getLink("Register a series").click() |
3681 | >>> admin_browser.getControl("Name").value = "alpha" |
3682 | >>> admin_browser.getControl("Summary").value = "summary" |
3683 | - >>> admin_browser.getControl( |
3684 | - ... "Branch" |
3685 | - ... ).value = "~name12/gnome-terminal/main" |
3686 | + >>> admin_browser.getControl("Branch").value = ( |
3687 | + ... "~name12/gnome-terminal/main" |
3688 | + ... ) |
3689 | >>> admin_browser.getControl("Register Series").click() |
3690 | |
3691 | The current development focus is shown first though. |
3692 | diff --git a/lib/lp/code/stories/branches/xx-branchmergeproposals.rst b/lib/lp/code/stories/branches/xx-branchmergeproposals.rst |
3693 | index fac9d1c..682badb 100644 |
3694 | --- a/lib/lp/code/stories/branches/xx-branchmergeproposals.rst |
3695 | +++ b/lib/lp/code/stories/branches/xx-branchmergeproposals.rst |
3696 | @@ -69,9 +69,9 @@ Logged in users can register a merge proposal. |
3697 | >>> nopriv_browser.getControl( |
3698 | ... name="field.target_branch.target_branch" |
3699 | ... ).value = "~name12/gnome-terminal/main" |
3700 | - >>> nopriv_browser.getControl( |
3701 | - ... name="field.prerequisite_branch" |
3702 | - ... ).value = "~name12/gnome-terminal/pushed" |
3703 | + >>> nopriv_browser.getControl(name="field.prerequisite_branch").value = ( |
3704 | + ... "~name12/gnome-terminal/pushed" |
3705 | + ... ) |
3706 | >>> print_tag_with_id(nopriv_browser.contents, "field.reviewer") |
3707 | <BLANKLINE> |
3708 | |
3709 | @@ -117,9 +117,9 @@ Since the plan is to merge a branch into another branch, it makes sense that a |
3710 | commit message can be set. |
3711 | |
3712 | >>> nopriv_browser.getLink(url="edit-commit-message").click() |
3713 | - >>> nopriv_browser.getControl( |
3714 | - ... name="field.commit_message" |
3715 | - ... ).value = "Add more <b>mojo</b>" |
3716 | + >>> nopriv_browser.getControl(name="field.commit_message").value = ( |
3717 | + ... "Add more <b>mojo</b>" |
3718 | + ... ) |
3719 | >>> nopriv_browser.getControl("Update").click() |
3720 | |
3721 | >>> print_tag_with_id(nopriv_browser.contents, "edit-commit_message") |
3722 | @@ -219,9 +219,9 @@ People who are logged in can perform reviews. |
3723 | |
3724 | >>> nopriv_browser.open(klingon_proposal) |
3725 | >>> nopriv_browser.getLink("Add a review or comment").click() |
3726 | - >>> nopriv_browser.getControl( |
3727 | - ... name="field.comment" |
3728 | - ... ).value = "Don't like it" |
3729 | + >>> nopriv_browser.getControl(name="field.comment").value = ( |
3730 | + ... "Don't like it" |
3731 | + ... ) |
3732 | >>> nopriv_browser.getControl(name="field.vote").getControl( |
3733 | ... "Disapprove" |
3734 | ... ).click() |
3735 | @@ -438,9 +438,9 @@ is shown. |
3736 | |
3737 | >>> admin_browser.open("http://launchpad.test/firefox/trunk") |
3738 | >>> admin_browser.getLink("Link to branch").click() |
3739 | - >>> admin_browser.getControl( |
3740 | - ... name="field.branch_location" |
3741 | - ... ).value = "~name12/firefox/main" |
3742 | + >>> admin_browser.getControl(name="field.branch_location").value = ( |
3743 | + ... "~name12/firefox/main" |
3744 | + ... ) |
3745 | >>> admin_browser.getControl("Update").click() |
3746 | |
3747 | # Just show the radio buttons for the branch widgets. |
3748 | diff --git a/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.rst b/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.rst |
3749 | index 3da38a6..9961c24 100644 |
3750 | --- a/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.rst |
3751 | +++ b/lib/lp/code/stories/branches/xx-claiming-team-code-reviews.rst |
3752 | @@ -25,9 +25,9 @@ Logging in as an admin helps with setting things up. |
3753 | >>> eric_browser = setupBrowser(auth="Basic eric@example.com:test") |
3754 | >>> eric_browser.open(branch_url) |
3755 | >>> eric_browser.getLink("Propose for merging").click() |
3756 | - >>> eric_browser.getControl( |
3757 | - ... "Description of the change" |
3758 | - ... ).value = "This fix is awesome!" |
3759 | + >>> eric_browser.getControl("Description of the change").value = ( |
3760 | + ... "This fix is awesome!" |
3761 | + ... ) |
3762 | >>> eric_browser.getControl("Propose Merge").click() |
3763 | |
3764 | The reviewer table shows both the Vikings team and Eric himself. |
3765 | diff --git a/lib/lp/code/stories/branches/xx-private-branch-listings.rst b/lib/lp/code/stories/branches/xx-private-branch-listings.rst |
3766 | index 8f24d0d..d76ceec 100644 |
3767 | --- a/lib/lp/code/stories/branches/xx-private-branch-listings.rst |
3768 | +++ b/lib/lp/code/stories/branches/xx-private-branch-listings.rst |
3769 | @@ -249,9 +249,9 @@ There are no branches linked to this bug. |
3770 | Now link to a private branch. |
3771 | |
3772 | >>> landscape_dev_browser.getLink("Link a related branch").click() |
3773 | - >>> landscape_dev_browser.getControl( |
3774 | - ... "Branch" |
3775 | - ... ).value = "~landscape-developers/landscape/trunk" |
3776 | + >>> landscape_dev_browser.getControl("Branch").value = ( |
3777 | + ... "~landscape-developers/landscape/trunk" |
3778 | + ... ) |
3779 | >>> landscape_dev_browser.getControl("Continue").click() |
3780 | >>> printBugBranchLinks(landscape_dev_browser) |
3781 | lp://dev/~landscape-developers/landscape/trunk |
3782 | @@ -273,9 +273,9 @@ those who shouldn't be able to see it. |
3783 | |
3784 | >>> admin_browser.open("http://launchpad.test/landscape/trunk") |
3785 | >>> admin_browser.getLink("Change details").click() |
3786 | - >>> admin_browser.getControl( |
3787 | - ... "Branch" |
3788 | - ... ).value = "~landscape-developers/landscape/trunk" |
3789 | + >>> admin_browser.getControl("Branch").value = ( |
3790 | + ... "~landscape-developers/landscape/trunk" |
3791 | + ... ) |
3792 | >>> admin_browser.getControl("Change").click() |
3793 | |
3794 | Since the admin user is able to see all private branches the branch details |
3795 | diff --git a/lib/lp/code/stories/branches/xx-product-branches.rst b/lib/lp/code/stories/branches/xx-product-branches.rst |
3796 | index 7e99fe2..1785058 100644 |
3797 | --- a/lib/lp/code/stories/branches/xx-product-branches.rst |
3798 | +++ b/lib/lp/code/stories/branches/xx-product-branches.rst |
3799 | @@ -133,9 +133,9 @@ once, but both series are shown in the listing. |
3800 | Firstly lets associate release--0.9.1 with the 1.0 series. |
3801 | |
3802 | >>> admin_browser.open("http://launchpad.test/firefox/1.0/+setbranch") |
3803 | - >>> admin_browser.getControl( |
3804 | - ... "Branch:" |
3805 | - ... ).value = "~mark/firefox/release--0.9.1" |
3806 | + >>> admin_browser.getControl("Branch:").value = ( |
3807 | + ... "~mark/firefox/release--0.9.1" |
3808 | + ... ) |
3809 | >>> admin_browser.getControl("Update").click() |
3810 | |
3811 | >>> browser.open("http://code.launchpad.test/firefox") |
3812 | diff --git a/lib/lp/code/stories/codeimport/xx-admin-codeimport.rst b/lib/lp/code/stories/codeimport/xx-admin-codeimport.rst |
3813 | index aabece2..84b4f82 100644 |
3814 | --- a/lib/lp/code/stories/codeimport/xx-admin-codeimport.rst |
3815 | +++ b/lib/lp/code/stories/codeimport/xx-admin-codeimport.rst |
3816 | @@ -167,9 +167,9 @@ url. |
3817 | This is true for Subversion imports, |
3818 | |
3819 | >>> import_browser.open(svn_import_location + "/+edit-import") |
3820 | - >>> import_browser.getControl( |
3821 | - ... "URL" |
3822 | - ... ).value = "svn://user:password@svn-new.example.com/fooix/trunk" |
3823 | + >>> import_browser.getControl("URL").value = ( |
3824 | + ... "svn://user:password@svn-new.example.com/fooix/trunk" |
3825 | + ... ) |
3826 | >>> import_browser.getControl("Update").click() |
3827 | >>> print_feedback_messages(import_browser.contents) |
3828 | The code import has been updated. |
3829 | @@ -177,9 +177,9 @@ This is true for Subversion imports, |
3830 | bzr-svn imports, |
3831 | |
3832 | >>> import_browser.open(bzr_svn_import_location + "/+edit-import") |
3833 | - >>> import_browser.getControl( |
3834 | - ... "URL" |
3835 | - ... ).value = "svn://user:password@svn-new.example.com/bzr-svn/trunk" |
3836 | + >>> import_browser.getControl("URL").value = ( |
3837 | + ... "svn://user:password@svn-new.example.com/bzr-svn/trunk" |
3838 | + ... ) |
3839 | >>> import_browser.getControl("Update").click() |
3840 | >>> print_feedback_messages(import_browser.contents) |
3841 | The code import has been updated. |
3842 | @@ -187,9 +187,9 @@ bzr-svn imports, |
3843 | CVS imports, |
3844 | |
3845 | >>> import_browser.open(cvs_import_location + "/+edit-import") |
3846 | - >>> import_browser.getControl( |
3847 | - ... "Repository" |
3848 | - ... ).value = ":pserver:anonymous@cvs-new.example.com:/fooix" |
3849 | + >>> import_browser.getControl("Repository").value = ( |
3850 | + ... ":pserver:anonymous@cvs-new.example.com:/fooix" |
3851 | + ... ) |
3852 | >>> import_browser.getControl("Module").value = "fooix2" |
3853 | >>> import_browser.getControl("Update").click() |
3854 | >>> print_feedback_messages(import_browser.contents) |
3855 | @@ -198,9 +198,9 @@ CVS imports, |
3856 | Git-to-Bazaar imports, |
3857 | |
3858 | >>> import_browser.open(git_import_location + "/+edit-import") |
3859 | - >>> import_browser.getControl( |
3860 | - ... "URL" |
3861 | - ... ).value = "git://user:password@git-new.example.org/fooix" |
3862 | + >>> import_browser.getControl("URL").value = ( |
3863 | + ... "git://user:password@git-new.example.org/fooix" |
3864 | + ... ) |
3865 | >>> import_browser.getControl("Update").click() |
3866 | >>> print_feedback_messages(import_browser.contents) |
3867 | The code import has been updated. |
3868 | @@ -208,9 +208,9 @@ Git-to-Bazaar imports, |
3869 | Git-to-Git imports, |
3870 | |
3871 | >>> import_browser.open(git_to_git_import_location + "/+edit-import") |
3872 | - >>> import_browser.getControl( |
3873 | - ... "URL" |
3874 | - ... ).value = "git://user:password@git-new.example.org/fooix2" |
3875 | + >>> import_browser.getControl("URL").value = ( |
3876 | + ... "git://user:password@git-new.example.org/fooix2" |
3877 | + ... ) |
3878 | >>> import_browser.getControl("Update").click() |
3879 | >>> print_feedback_messages(import_browser.contents) |
3880 | The code import has been updated. |
3881 | @@ -218,9 +218,9 @@ Git-to-Git imports, |
3882 | and imports targeting source packages. |
3883 | |
3884 | >>> import_browser.open(package_import_location + "/+edit-import") |
3885 | - >>> import_browser.getControl( |
3886 | - ... "URL" |
3887 | - ... ).value = "http://metal.example.org/zap" |
3888 | + >>> import_browser.getControl("URL").value = ( |
3889 | + ... "http://metal.example.org/zap" |
3890 | + ... ) |
3891 | >>> import_browser.getControl("Update").click() |
3892 | >>> print_feedback_messages(import_browser.contents) |
3893 | The code import has been updated. |
3894 | diff --git a/lib/lp/code/stories/codeimport/xx-create-codeimport.rst b/lib/lp/code/stories/codeimport/xx-create-codeimport.rst |
3895 | index 6ad51a8..184fe0b 100644 |
3896 | --- a/lib/lp/code/stories/codeimport/xx-create-codeimport.rst |
3897 | +++ b/lib/lp/code/stories/codeimport/xx-create-codeimport.rst |
3898 | @@ -44,9 +44,9 @@ importing will be available to any user. |
3899 | >>> owner_browser.getLink("Configure Code").click() |
3900 | >>> owner_browser.getControl("Bazaar", index=0).click() |
3901 | >>> owner_browser.getControl("Import a branch").click() |
3902 | - >>> owner_browser.getControl( |
3903 | - ... "Branch URL" |
3904 | - ... ).value = "git://example.com/firefox" |
3905 | + >>> owner_browser.getControl("Branch URL").value = ( |
3906 | + ... "git://example.com/firefox" |
3907 | + ... ) |
3908 | >>> owner_browser.getControl("Git", index=1).click() |
3909 | >>> owner_browser.getControl("Branch name").value = "trunk" |
3910 | >>> owner_browser.getControl("Update").click() |
3911 | @@ -71,9 +71,9 @@ The user is required to enter a project that the import is for, a name |
3912 | for the import branch, and a Bazaar branch location. |
3913 | |
3914 | >>> browser.getControl("Name").value = "mirrored" |
3915 | - >>> browser.getControl( |
3916 | - ... "Branch URL", index=0 |
3917 | - ... ).value = "http://bzr.example.com/firefox/trunk" |
3918 | + >>> browser.getControl("Branch URL", index=0).value = ( |
3919 | + ... "http://bzr.example.com/firefox/trunk" |
3920 | + ... ) |
3921 | >>> browser.getControl("Request Import").click() |
3922 | |
3923 | When the user clicks continue, the import branch is created |
3924 | @@ -96,9 +96,9 @@ URL. |
3925 | |
3926 | >>> browser.open("http://code.launchpad.test/+code-imports/+new") |
3927 | >>> browser.getControl("Name").value = "with-password" |
3928 | - >>> browser.getControl( |
3929 | - ... "Branch URL", index=0 |
3930 | - ... ).value = "http://user:password@bzr.example.com/firefox/trunk" |
3931 | + >>> browser.getControl("Branch URL", index=0).value = ( |
3932 | + ... "http://user:password@bzr.example.com/firefox/trunk" |
3933 | + ... ) |
3934 | >>> browser.getControl("Project").value = "firefox" |
3935 | >>> browser.getControl("Request Import").click() |
3936 | >>> print( |
3937 | @@ -115,9 +115,9 @@ Specifying a Launchpad URL results in an error. |
3938 | |
3939 | >>> browser.open("http://code.launchpad.test/+code-imports/+new") |
3940 | >>> browser.getControl("Name").value = "invalid" |
3941 | - >>> browser.getControl( |
3942 | - ... "Branch URL", index=0 |
3943 | - ... ).value = "http://bazaar.launchpad.net/firefox/trunk" |
3944 | + >>> browser.getControl("Branch URL", index=0).value = ( |
3945 | + ... "http://bazaar.launchpad.net/firefox/trunk" |
3946 | + ... ) |
3947 | >>> browser.getControl("Project").value = "firefox" |
3948 | >>> browser.getControl("Request Import").click() |
3949 | >>> print_feedback_messages(browser.contents) |
3950 | @@ -131,9 +131,9 @@ But a Launchpad Git URL is OK. |
3951 | >>> browser.getControl("Project").value = "firefox" |
3952 | >>> browser.getControl("Name").value = "lp-git-import" |
3953 | >>> browser.getControl("Git", index=0).click() |
3954 | - >>> browser.getControl( |
3955 | - ... "Repo URL", index=0 |
3956 | - ... ).value = "git://git.launchpad.net/firefox.git" |
3957 | + >>> browser.getControl("Repo URL", index=0).value = ( |
3958 | + ... "git://git.launchpad.net/firefox.git" |
3959 | + ... ) |
3960 | >>> browser.getControl("Request Import").click() |
3961 | >>> print( |
3962 | ... extract_text(find_tag_by_id(browser.contents, "import-details")) |
3963 | @@ -154,9 +154,9 @@ a name for the import branch, and a subversion branch location. |
3964 | >>> browser.getControl("Subversion").click() |
3965 | >>> browser.getControl("Project").value = "firefox" |
3966 | >>> browser.getControl("Name").value = "imported" |
3967 | - >>> browser.getControl( |
3968 | - ... "Branch URL", index=1 |
3969 | - ... ).value = "http://svn.example.com/firefox/trunk" |
3970 | + >>> browser.getControl("Branch URL", index=1).value = ( |
3971 | + ... "http://svn.example.com/firefox/trunk" |
3972 | + ... ) |
3973 | >>> browser.getControl("Request Import").click() |
3974 | |
3975 | When the user clicks continue, the import branch is created |
3976 | @@ -189,9 +189,9 @@ URL. |
3977 | >>> browser.open("http://code.launchpad.test/+code-imports/+new") |
3978 | >>> browser.getControl("Subversion").click() |
3979 | >>> browser.getControl("Name").value = "svn-with-password" |
3980 | - >>> browser.getControl( |
3981 | - ... "Branch URL", index=1 |
3982 | - ... ).value = "http://user:password@svn.example.com/firefox/trunk" |
3983 | + >>> browser.getControl("Branch URL", index=1).value = ( |
3984 | + ... "http://user:password@svn.example.com/firefox/trunk" |
3985 | + ... ) |
3986 | >>> browser.getControl("Project").value = "firefox" |
3987 | >>> browser.getControl("Request Import").click() |
3988 | >>> print( |
3989 | @@ -215,9 +215,9 @@ a name for the import branch, and a Git repository location. |
3990 | >>> browser.getControl("Project").value = "firefox" |
3991 | >>> browser.getControl("Name").value = "git-import" |
3992 | >>> browser.getControl("Git", index=0).click() |
3993 | - >>> browser.getControl( |
3994 | - ... "Repo URL", index=0 |
3995 | - ... ).value = "git://example.com/firefox.git" |
3996 | + >>> browser.getControl("Repo URL", index=0).value = ( |
3997 | + ... "git://example.com/firefox.git" |
3998 | + ... ) |
3999 | >>> browser.getControl("Request Import").click() |
4000 | |
4001 | When the user clicks continue, the approved import branch is created. |
4002 | @@ -246,9 +246,9 @@ allowed to match that of an existing Bazaar-targeted import. |
4003 | >>> browser.getControl("Name").value = "upstream" |
4004 | >>> browser.getControl("Git", index=0).click() |
4005 | >>> browser.getControl("Git", index=1).click() |
4006 | - >>> browser.getControl( |
4007 | - ... "Repo URL", index=0 |
4008 | - ... ).value = "git://example.com/firefox.git" |
4009 | + >>> browser.getControl("Repo URL", index=0).value = ( |
4010 | + ... "git://example.com/firefox.git" |
4011 | + ... ) |
4012 | >>> with GitHostingFixture(): |
4013 | ... browser.getControl("Request Import").click() |
4014 | ... |
4015 | @@ -275,9 +275,9 @@ to identify the CVS branch. A project and branch name are also required. |
4016 | >>> browser.getControl("Project").value = "firefox" |
4017 | >>> browser.getControl("Name").value = "import2" |
4018 | >>> browser.getControl("CVS").click() |
4019 | - >>> browser.getControl( |
4020 | - ... "Repository" |
4021 | - ... ).value = ":pserver:anonymous@cvs.example.com:/mozilla/cvs" |
4022 | + >>> browser.getControl("Repository").value = ( |
4023 | + ... ":pserver:anonymous@cvs.example.com:/mozilla/cvs" |
4024 | + ... ) |
4025 | >>> browser.getControl("Module").value = "firefox" |
4026 | >>> browser.getControl("Request Import").click() |
4027 | |
4028 | @@ -301,9 +301,9 @@ purposes. |
4029 | >>> browser.getControl("Project").value = "firefox" |
4030 | >>> browser.getControl("Name").value = "import2" |
4031 | >>> browser.getControl("CVS").click() |
4032 | - >>> browser.getControl( |
4033 | - ... "Repository" |
4034 | - ... ).value = ":anonymous@cvs.example.com:/mozilla/cvs" |
4035 | + >>> browser.getControl("Repository").value = ( |
4036 | + ... ":anonymous@cvs.example.com:/mozilla/cvs" |
4037 | + ... ) |
4038 | >>> browser.getControl("Module").value = "firefox" |
4039 | >>> browser.getControl("Request Import").click() |
4040 | |
4041 | @@ -325,9 +325,9 @@ The error is shown even if the project is different. |
4042 | >>> browser.getControl("Project").value = "thunderbird" |
4043 | >>> browser.getControl("Name").value = "imported" |
4044 | >>> browser.getControl("CVS").click() |
4045 | - >>> browser.getControl( |
4046 | - ... "Repository" |
4047 | - ... ).value = ":pserver:anonymous@cvs.example.com:/mozilla/cvs" |
4048 | + >>> browser.getControl("Repository").value = ( |
4049 | + ... ":pserver:anonymous@cvs.example.com:/mozilla/cvs" |
4050 | + ... ) |
4051 | >>> browser.getControl("Module").value = "firefox" |
4052 | >>> browser.getControl("Request Import").click() |
4053 | |
4054 | @@ -337,9 +337,9 @@ The error is shown even if the project is different. |
4055 | the imported branch ~no-priv/firefox/import2. |
4056 | |
4057 | >>> browser.getControl("Subversion").click() |
4058 | - >>> browser.getControl( |
4059 | - ... "Branch URL", index=1 |
4060 | - ... ).value = "http://svn.example.com/firefox/trunk" |
4061 | + >>> browser.getControl("Branch URL", index=1).value = ( |
4062 | + ... "http://svn.example.com/firefox/trunk" |
4063 | + ... ) |
4064 | >>> browser.getControl("Request Import").click() |
4065 | |
4066 | >>> print_feedback_messages(browser.contents) |
4067 | @@ -360,9 +360,9 @@ one. |
4068 | >>> browser.getControl("Subversion").click() |
4069 | >>> browser.getControl("Project").value = "firefox" |
4070 | >>> browser.getControl("Name").value = "imported" |
4071 | - >>> browser.getControl( |
4072 | - ... "Branch URL", index=1 |
4073 | - ... ).value = "http://svn.example.com/firefox/other" |
4074 | + >>> browser.getControl("Branch URL", index=1).value = ( |
4075 | + ... "http://svn.example.com/firefox/other" |
4076 | + ... ) |
4077 | >>> browser.getControl("Request Import").click() |
4078 | >>> print_feedback_messages(browser.contents) |
4079 | There is 1 error. |
4080 | @@ -378,9 +378,9 @@ then an error is shown to the user. |
4081 | >>> browser.open("http://code.launchpad.test/+code-imports/+new") |
4082 | >>> browser.getControl("Project").value = "launchpad" |
4083 | >>> browser.getControl("Name").value = "imported" |
4084 | - >>> browser.getControl( |
4085 | - ... "Branch URL", index=0 |
4086 | - ... ).value = "http://svn.example.com/launchpage/fake" |
4087 | + >>> browser.getControl("Branch URL", index=0).value = ( |
4088 | + ... "http://svn.example.com/launchpage/fake" |
4089 | + ... ) |
4090 | >>> browser.getControl("Request Import").click() |
4091 | >>> print_feedback_messages(browser.contents) |
4092 | There is 1 error. |
4093 | @@ -396,9 +396,9 @@ existing product, an error is shown to the user. |
4094 | >>> browser.open("http://code.launchpad.test/+code-imports/+new") |
4095 | >>> browser.getControl("Project").value = "no-such-product" |
4096 | >>> browser.getControl("Name").value = "imported" |
4097 | - >>> browser.getControl( |
4098 | - ... "Branch URL", index=0 |
4099 | - ... ).value = "http://svn.example.com/launchpage/fake" |
4100 | + >>> browser.getControl("Branch URL", index=0).value = ( |
4101 | + ... "http://svn.example.com/launchpage/fake" |
4102 | + ... ) |
4103 | >>> browser.getControl("Request Import").click() |
4104 | >>> print_feedback_messages(browser.contents) |
4105 | There is 1 error. |
4106 | @@ -423,9 +423,9 @@ Change the owner to be a team that sample person is a member of. |
4107 | >>> sample_browser.getControl("Owner").value = ["landscape-developers"] |
4108 | >>> sample_browser.getControl("Owner").displayValue |
4109 | ['Landscape Developers (landscape-developers)'] |
4110 | - >>> sample_browser.getControl( |
4111 | - ... "Branch URL", index=0 |
4112 | - ... ).value = "http://svn.example.com/firefox-beta/trunk" |
4113 | + >>> sample_browser.getControl("Branch URL", index=0).value = ( |
4114 | + ... "http://svn.example.com/firefox-beta/trunk" |
4115 | + ... ) |
4116 | >>> sample_browser.getControl("Request Import").click() |
4117 | |
4118 | >>> print_tag_with_id(sample_browser.contents, "registration") |
4119 | @@ -438,9 +438,9 @@ Admins can specify any owner for a new code import. |
4120 | >>> admin_browser = setupBrowser(auth="Basic admin@canonical.com:test") |
4121 | >>> admin_browser.open("http://code.launchpad.test/firefox/+new-import") |
4122 | >>> admin_browser.getControl("Owner").value = "mark" |
4123 | - >>> admin_browser.getControl( |
4124 | - ... "Branch URL", index=0 |
4125 | - ... ).value = "http://svn.example.com/firefox-theta/trunk" |
4126 | + >>> admin_browser.getControl("Branch URL", index=0).value = ( |
4127 | + ... "http://svn.example.com/firefox-theta/trunk" |
4128 | + ... ) |
4129 | >>> admin_browser.getControl("Request Import").click() |
4130 | |
4131 | >>> print_tag_with_id(admin_browser.contents, "registration") |
4132 | diff --git a/lib/lp/code/vocabularies/tests/test_gitref_vocabularies.py b/lib/lp/code/vocabularies/tests/test_gitref_vocabularies.py |
4133 | index afbdbdf..0a4cc4e 100644 |
4134 | --- a/lib/lp/code/vocabularies/tests/test_gitref_vocabularies.py |
4135 | +++ b/lib/lp/code/vocabularies/tests/test_gitref_vocabularies.py |
4136 | @@ -67,9 +67,9 @@ class TestGitRefVocabulary(TestCaseWithFactory): |
4137 | "refs/tags/next-1.0", |
4138 | ] |
4139 | ) |
4140 | - removeSecurityProxy( |
4141 | - ref_master.repository |
4142 | - )._default_branch = ref_master.path |
4143 | + removeSecurityProxy(ref_master.repository)._default_branch = ( |
4144 | + ref_master.path |
4145 | + ) |
4146 | vocab = self.vocabulary_class(ref_master.repository) |
4147 | self.assertContentEqual( |
4148 | [term.value.path for term in vocab.searchForTerms("master")], |
4149 | @@ -117,9 +117,9 @@ class TestGitRefVocabulary(TestCaseWithFactory): |
4150 | "refs/heads/master-older", |
4151 | ] |
4152 | ) |
4153 | - removeSecurityProxy( |
4154 | - ref_master.repository |
4155 | - )._default_branch = ref_master.path |
4156 | + removeSecurityProxy(ref_master.repository)._default_branch = ( |
4157 | + ref_master.path |
4158 | + ) |
4159 | now = datetime.now(timezone.utc) |
4160 | removeSecurityProxy(ref_master_old).committer_date = now - timedelta( |
4161 | days=1 |
4162 | @@ -197,9 +197,9 @@ class TestGitBranchVocabulary(TestCaseWithFactory): |
4163 | "refs/tags/next-1.0", |
4164 | ] |
4165 | ) |
4166 | - removeSecurityProxy( |
4167 | - ref_master.repository |
4168 | - )._default_branch = ref_master.path |
4169 | + removeSecurityProxy(ref_master.repository)._default_branch = ( |
4170 | + ref_master.path |
4171 | + ) |
4172 | vocab = self.vocabulary_class(ref_master.repository) |
4173 | self.assertContentEqual( |
4174 | [term.title for term in vocab.searchForTerms("master")], ["master"] |
4175 | @@ -234,9 +234,9 @@ class TestGitBranchVocabulary(TestCaseWithFactory): |
4176 | "refs/heads/master-older", |
4177 | ] |
4178 | ) |
4179 | - removeSecurityProxy( |
4180 | - ref_master.repository |
4181 | - )._default_branch = ref_master.path |
4182 | + removeSecurityProxy(ref_master.repository)._default_branch = ( |
4183 | + ref_master.path |
4184 | + ) |
4185 | now = datetime.now(timezone.utc) |
4186 | removeSecurityProxy(ref_master_old).committer_date = now - timedelta( |
4187 | days=1 |
4188 | diff --git a/lib/lp/codehosting/bzrutils.py b/lib/lp/codehosting/bzrutils.py |
4189 | index c3e1d32..9a637a6 100644 |
4190 | --- a/lib/lp/codehosting/bzrutils.py |
4191 | +++ b/lib/lp/codehosting/bzrutils.py |
4192 | @@ -315,13 +315,13 @@ def get_branch_info(branch): |
4193 | # XXX: Aaron Bentley 2008-06-13 |
4194 | # Bazaar does not provide a public API for learning about |
4195 | # format markers. Fix this in Bazaar, then here. |
4196 | - info[ |
4197 | - "control_string" |
4198 | - ] = branch.controldir._format.get_format_string().decode() |
4199 | + info["control_string"] = ( |
4200 | + branch.controldir._format.get_format_string().decode() |
4201 | + ) |
4202 | info["branch_string"] = branch._format.get_format_string().decode() |
4203 | - info[ |
4204 | - "repository_string" |
4205 | - ] = branch.repository._format.get_format_string().decode() |
4206 | + info["repository_string"] = ( |
4207 | + branch.repository._format.get_format_string().decode() |
4208 | + ) |
4209 | return info |
4210 | |
4211 | |
4212 | diff --git a/lib/lp/codehosting/vfs/tests/test_branchfs.py b/lib/lp/codehosting/vfs/tests/test_branchfs.py |
4213 | index 5a7f958..e472924 100644 |
4214 | --- a/lib/lp/codehosting/vfs/tests/test_branchfs.py |
4215 | +++ b/lib/lp/codehosting/vfs/tests/test_branchfs.py |
4216 | @@ -168,10 +168,10 @@ class TestTransportDispatch(TestCase): |
4217 | def test_makeTransport_control(self): |
4218 | # makeTransport returns a control transport for the tuple. |
4219 | log = [] |
4220 | - self.factory._transport_factories[ |
4221 | - CONTROL_TRANSPORT |
4222 | - ] = lambda default_stack_on, trailing_path: log.append( |
4223 | - default_stack_on |
4224 | + self.factory._transport_factories[CONTROL_TRANSPORT] = ( |
4225 | + lambda default_stack_on, trailing_path: log.append( |
4226 | + default_stack_on |
4227 | + ) |
4228 | ) |
4229 | transport, path = self.factory.makeTransport( |
4230 | (CONTROL_TRANSPORT, {"default_stack_on": "foo"}, "bar/baz") |
4231 | @@ -182,9 +182,9 @@ class TestTransportDispatch(TestCase): |
4232 | def test_makeTransport_branch(self): |
4233 | # makeTransport returns a control transport for the tuple. |
4234 | log = [] |
4235 | - self.factory._transport_factories[ |
4236 | - BRANCH_TRANSPORT |
4237 | - ] = lambda id, writable, trailing_path: log.append((id, writable)) |
4238 | + self.factory._transport_factories[BRANCH_TRANSPORT] = ( |
4239 | + lambda id, writable, trailing_path: log.append((id, writable)) |
4240 | + ) |
4241 | transport, path = self.factory.makeTransport( |
4242 | (BRANCH_TRANSPORT, {"id": 1, "writable": True}, "bar/baz") |
4243 | ) |
4244 | diff --git a/lib/lp/coop/answersbugs/stories/question-makebug.rst b/lib/lp/coop/answersbugs/stories/question-makebug.rst |
4245 | index 18defa3..64707f9 100644 |
4246 | --- a/lib/lp/coop/answersbugs/stories/question-makebug.rst |
4247 | +++ b/lib/lp/coop/answersbugs/stories/question-makebug.rst |
4248 | @@ -36,12 +36,12 @@ bug. |
4249 | Clicking the 'Create' button creates the bug with the user-specified title |
4250 | and description and redirects the user to the bug page. |
4251 | |
4252 | - >>> browser.getControl( |
4253 | - ... "Summary" |
4254 | - ... ).value = "W3C SVG demo doesn't work in Firefox" |
4255 | - >>> browser.getControl( |
4256 | - ... "Description" |
4257 | - ... ).value = "Browsing to the W3C SVG demo results in a blank page." |
4258 | + >>> browser.getControl("Summary").value = ( |
4259 | + ... "W3C SVG demo doesn't work in Firefox" |
4260 | + ... ) |
4261 | + >>> browser.getControl("Description").value = ( |
4262 | + ... "Browsing to the W3C SVG demo results in a blank page." |
4263 | + ... ) |
4264 | >>> browser.getControl("Create").click() |
4265 | >>> browser.url |
4266 | '.../firefox/+bug/...' |
4267 | @@ -80,9 +80,9 @@ to it. |
4268 | It works with distribution questions as well. |
4269 | |
4270 | >>> browser.open("http://launchpad.test/ubuntu/+question/5/+makebug") |
4271 | - >>> browser.getControl( |
4272 | - ... "Summary" |
4273 | - ... ).value = "Ubuntu Installer can't find CDROM" |
4274 | + >>> browser.getControl("Summary").value = ( |
4275 | + ... "Ubuntu Installer can't find CDROM" |
4276 | + ... ) |
4277 | >>> browser.getControl("Create Bug Report").click() |
4278 | >>> browser.url |
4279 | '.../ubuntu/+bug/...' |
4280 | diff --git a/lib/lp/coop/answersbugs/tests/test_doc.py b/lib/lp/coop/answersbugs/tests/test_doc.py |
4281 | index 2547ef0..56fc4bc 100644 |
4282 | --- a/lib/lp/coop/answersbugs/tests/test_doc.py |
4283 | +++ b/lib/lp/coop/answersbugs/tests/test_doc.py |
4284 | @@ -66,9 +66,9 @@ def bugLinkedToQuestionSetUp(test): |
4285 | |
4286 | setUp(test) |
4287 | bugtask_id = _createUbuntuBugTaskLinkedToQuestion() |
4288 | - test.globs[ |
4289 | - "get_bugtask_linked_to_question" |
4290 | - ] = get_bugtask_linked_to_question |
4291 | + test.globs["get_bugtask_linked_to_question"] = ( |
4292 | + get_bugtask_linked_to_question |
4293 | + ) |
4294 | # Log in here, since we don't want to set up an non-anonymous |
4295 | # interaction in the test. |
4296 | login("no-priv@canonical.com") |
4297 | diff --git a/lib/lp/oci/browser/tests/test_ocirecipe.py b/lib/lp/oci/browser/tests/test_ocirecipe.py |
4298 | index bb11c3c..60ecc0d 100644 |
4299 | --- a/lib/lp/oci/browser/tests/test_ocirecipe.py |
4300 | +++ b/lib/lp/oci/browser/tests/test_ocirecipe.py |
4301 | @@ -212,9 +212,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4302 | ) |
4303 | browser.getControl(name="field.name").value = "recipe-name" |
4304 | browser.getControl("Description").value = "Recipe description" |
4305 | - browser.getControl( |
4306 | - name="field.git_ref.repository" |
4307 | - ).value = git_ref_identity |
4308 | + browser.getControl(name="field.git_ref.repository").value = ( |
4309 | + git_ref_identity |
4310 | + ) |
4311 | browser.getControl(name="field.git_ref.path").value = git_ref_path |
4312 | browser.getControl("Create OCI recipe").click() |
4313 | |
4314 | @@ -291,9 +291,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4315 | ) |
4316 | browser.getControl(name="field.name").value = "recipe-name" |
4317 | browser.getControl("Description").value = "Recipe description" |
4318 | - browser.getControl( |
4319 | - name="field.git_ref.repository" |
4320 | - ).value = git_ref_identity |
4321 | + browser.getControl(name="field.git_ref.repository").value = ( |
4322 | + git_ref_identity |
4323 | + ) |
4324 | browser.getControl(name="field.git_ref.path").value = git_ref_path |
4325 | browser.getControl("Create OCI recipe").click() |
4326 | self.assertIn("Branch does not match format", browser.contents) |
4327 | @@ -308,13 +308,13 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4328 | ) |
4329 | browser.getControl(name="field.name").value = "recipe-name" |
4330 | browser.getControl("Description").value = "Recipe description" |
4331 | - browser.getControl( |
4332 | - name="field.git_ref.repository" |
4333 | - ).value = git_ref_identity |
4334 | + browser.getControl(name="field.git_ref.repository").value = ( |
4335 | + git_ref_identity |
4336 | + ) |
4337 | browser.getControl(name="field.git_ref.path").value = git_ref_path |
4338 | - browser.getControl( |
4339 | - "Build-time ARG variables" |
4340 | - ).value = "VAR1=10\nVAR2=20" |
4341 | + browser.getControl("Build-time ARG variables").value = ( |
4342 | + "VAR1=10\nVAR2=20" |
4343 | + ) |
4344 | browser.getControl("Create OCI recipe").click() |
4345 | |
4346 | content = find_main_content(browser.contents) |
4347 | @@ -337,9 +337,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4348 | ) |
4349 | browser.getControl(name="field.name").value = "recipe-name" |
4350 | browser.getControl("Description").value = "Recipe description" |
4351 | - browser.getControl( |
4352 | - name="field.git_ref.repository" |
4353 | - ).value = git_ref_identity |
4354 | + browser.getControl(name="field.git_ref.repository").value = ( |
4355 | + git_ref_identity |
4356 | + ) |
4357 | browser.getControl(name="field.git_ref.path").value = git_ref_path |
4358 | |
4359 | image_name = self.factory.getUniqueUnicode() |
4360 | @@ -413,9 +413,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4361 | processors = browser.getControl(name="field.processors") |
4362 | processors.value = ["386", "amd64"] |
4363 | browser.getControl(name="field.name").value = "recipe-name" |
4364 | - browser.getControl( |
4365 | - name="field.git_ref.repository" |
4366 | - ).value = git_ref_identity |
4367 | + browser.getControl(name="field.git_ref.repository").value = ( |
4368 | + git_ref_identity |
4369 | + ) |
4370 | browser.getControl(name="field.git_ref.path").value = git_ref_path |
4371 | browser.getControl("Create OCI recipe").click() |
4372 | login_person(self.person) |
4373 | @@ -513,9 +513,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4374 | ) |
4375 | browser.getControl(name="field.name").value = "recipe-name" |
4376 | browser.getControl("Description").value = "Recipe description" |
4377 | - browser.getControl( |
4378 | - name="field.git_ref.repository" |
4379 | - ).value = git_ref_identity |
4380 | + browser.getControl(name="field.git_ref.repository").value = ( |
4381 | + git_ref_identity |
4382 | + ) |
4383 | browser.getControl(name="field.git_ref.path").value = git_ref_path |
4384 | official_control = browser.getControl("Official recipe") |
4385 | official_control.selected = True |
4386 | @@ -547,9 +547,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4387 | ) |
4388 | browser.getControl(name="field.name").value = "recipe-name" |
4389 | browser.getControl("Description").value = "Recipe description" |
4390 | - browser.getControl( |
4391 | - name="field.git_ref.repository" |
4392 | - ).value = git_ref_identity |
4393 | + browser.getControl(name="field.git_ref.repository").value = ( |
4394 | + git_ref_identity |
4395 | + ) |
4396 | browser.getControl(name="field.git_ref.path").value = git_ref_path |
4397 | official_control = browser.getControl("Official recipe") |
4398 | official_control.selected = True |
4399 | @@ -565,9 +565,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4400 | ) |
4401 | browser2.getControl(name="field.name").value = "recipe-name" |
4402 | browser2.getControl("Description").value = "Recipe description" |
4403 | - browser2.getControl( |
4404 | - name="field.git_ref.repository" |
4405 | - ).value = git_ref2_identity |
4406 | + browser2.getControl(name="field.git_ref.repository").value = ( |
4407 | + git_ref2_identity |
4408 | + ) |
4409 | browser2.getControl(name="field.git_ref.path").value = git_ref2_path |
4410 | official_control = browser2.getControl("Official recipe") |
4411 | official_control.selected = True |
4412 | @@ -598,9 +598,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4413 | ) |
4414 | browser.getControl(name="field.name").value = "recipe-name" |
4415 | browser.getControl("Description").value = "Recipe description" |
4416 | - browser.getControl( |
4417 | - name="field.git_ref.repository" |
4418 | - ).value = git_ref_identity |
4419 | + browser.getControl(name="field.git_ref.repository").value = ( |
4420 | + git_ref_identity |
4421 | + ) |
4422 | browser.getControl(name="field.git_ref.path").value = git_ref_path |
4423 | official_control = browser.getControl("Official recipe") |
4424 | official_control.selected = True |
4425 | @@ -621,9 +621,9 @@ class TestOCIRecipeAddView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4426 | ) |
4427 | browser.getControl(name="field.name").value = "recipe-name" |
4428 | browser.getControl("Description").value = "Recipe description" |
4429 | - browser.getControl( |
4430 | - name="field.git_ref.repository" |
4431 | - ).value = git_ref_identity |
4432 | + browser.getControl(name="field.git_ref.repository").value = ( |
4433 | + git_ref_identity |
4434 | + ) |
4435 | browser.getControl(name="field.git_ref.path").value = "non-exist" |
4436 | browser.getControl("Create OCI recipe").click() |
4437 | |
4438 | @@ -786,9 +786,9 @@ class TestOCIRecipeEditView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4439 | browser.getControl("Owner").value = ["new-team"] |
4440 | browser.getControl(name="field.name").value = "new-name" |
4441 | browser.getControl("Description").value = "New description" |
4442 | - browser.getControl( |
4443 | - name="field.git_ref.repository" |
4444 | - ).value = new_git_ref_identity |
4445 | + browser.getControl(name="field.git_ref.repository").value = ( |
4446 | + new_git_ref_identity |
4447 | + ) |
4448 | browser.getControl(name="field.git_ref.path").value = new_git_ref_path |
4449 | browser.getControl("Build file path").value = "Dockerfile-2" |
4450 | browser.getControl("Build directory context").value = "apath" |
4451 | @@ -840,9 +840,9 @@ class TestOCIRecipeEditView(OCIConfigHelperMixin, BaseTestOCIRecipeView): |
4452 | |
4453 | browser = self.getViewBrowser(recipe, user=self.person) |
4454 | browser.getLink("Edit OCI recipe").click() |
4455 | - browser.getControl( |
4456 | - name="field.git_ref.path" |
4457 | - ).value = "refs/heads/invalid" |
4458 | + browser.getControl(name="field.git_ref.path").value = ( |
4459 | + "refs/heads/invalid" |
4460 | + ) |
4461 | browser.getControl("Update OCI recipe").click() |
4462 | self.assertIn("Branch does not match format", browser.contents) |
4463 | |
4464 | @@ -2572,9 +2572,9 @@ class TestOCIRecipeEditPushRulesView( |
4465 | browser = self.getViewBrowser(self.recipe, user=self.person) |
4466 | browser.getLink("Edit push rules").click() |
4467 | with person_logged_in(self.person): |
4468 | - browser.getControl( |
4469 | - name="field.delete.%d" % push_rule_id |
4470 | - ).value = True |
4471 | + browser.getControl(name="field.delete.%d" % push_rule_id).value = ( |
4472 | + True |
4473 | + ) |
4474 | browser.getControl("Save").click() |
4475 | |
4476 | with person_logged_in(self.person): |
4477 | @@ -2653,9 +2653,9 @@ class TestOCIRecipeEditPushRulesView( |
4478 | browser.getControl(name="field.add_region").value = "somewhere-02" |
4479 | browser.getControl(name="field.add_username").value = "username" |
4480 | browser.getControl(name="field.add_password").value = "password" |
4481 | - browser.getControl( |
4482 | - name="field.add_confirm_password" |
4483 | - ).value = "password" |
4484 | + browser.getControl(name="field.add_confirm_password").value = ( |
4485 | + "password" |
4486 | + ) |
4487 | browser.getControl("Save").click() |
4488 | with person_logged_in(self.person): |
4489 | rules = list( |
4490 | @@ -2700,14 +2700,15 @@ class TestOCIRecipeEditPushRulesView( |
4491 | browser = self.getViewBrowser(self.recipe, user=self.person) |
4492 | browser.getLink("Edit push rules").click() |
4493 | browser.getControl(name="field.add_credentials").value = "existing" |
4494 | - browser.getControl( |
4495 | - name="field.add_image_name" |
4496 | - ).value = existing_image_name |
4497 | - browser.getControl( |
4498 | - name="field.existing_credentials" |
4499 | - ).value = "%s %s" % ( |
4500 | - quote(existing_registry_url), |
4501 | - quote(existing_username), |
4502 | + browser.getControl(name="field.add_image_name").value = ( |
4503 | + existing_image_name |
4504 | + ) |
4505 | + browser.getControl(name="field.existing_credentials").value = ( |
4506 | + "%s %s" |
4507 | + % ( |
4508 | + quote(existing_registry_url), |
4509 | + quote(existing_username), |
4510 | + ) |
4511 | ) |
4512 | browser.getControl("Save").click() |
4513 | self.assertIn( |
4514 | @@ -2826,9 +2827,9 @@ class TestOCIRecipeEditPushRulesView( |
4515 | |
4516 | # set image name to valid string |
4517 | with person_logged_in(self.person): |
4518 | - browser.getControl( |
4519 | - name="field.image_name.%d" % rule.id |
4520 | - ).value = "image1" |
4521 | + browser.getControl(name="field.image_name.%d" % rule.id).value = ( |
4522 | + "image1" |
4523 | + ) |
4524 | browser.getControl("Save").click() |
4525 | |
4526 | # and assert model changed |
4527 | @@ -2867,9 +2868,9 @@ class TestOCIRecipeEditPushRulesView( |
4528 | browser.getControl(name="field.add_region").value = "new_region1" |
4529 | browser.getControl(name="field.add_username").value = "new_username" |
4530 | browser.getControl(name="field.add_password").value = "password" |
4531 | - browser.getControl( |
4532 | - name="field.add_confirm_password" |
4533 | - ).value = "password" |
4534 | + browser.getControl(name="field.add_confirm_password").value = ( |
4535 | + "password" |
4536 | + ) |
4537 | |
4538 | browser.getControl("Save").click() |
4539 | with person_logged_in(self.person): |
4540 | diff --git a/lib/lp/oci/model/ocirecipebuildbehaviour.py b/lib/lp/oci/model/ocirecipebuildbehaviour.py |
4541 | index 4ce649a..dd12112 100644 |
4542 | --- a/lib/lp/oci/model/ocirecipebuildbehaviour.py |
4543 | +++ b/lib/lp/oci/model/ocirecipebuildbehaviour.py |
4544 | @@ -117,9 +117,9 @@ class OCIRecipeBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase): |
4545 | } |
4546 | if build_request: |
4547 | info["build_request_id"] = build_request.id |
4548 | - info[ |
4549 | - "build_request_timestamp" |
4550 | - ] = build_request.date_requested.isoformat() |
4551 | + info["build_request_timestamp"] = ( |
4552 | + build_request.date_requested.isoformat() |
4553 | + ) |
4554 | info["architectures"] = [ |
4555 | i.distro_arch_series.architecturetag for i in builds |
4556 | ] |
4557 | @@ -175,9 +175,9 @@ class OCIRecipeBuildBehaviour(BuilderProxyMixin, BuildFarmJobBehaviourBase): |
4558 | ) |
4559 | args["git_repository"] = url |
4560 | else: |
4561 | - args[ |
4562 | - "git_repository" |
4563 | - ] = build.recipe.git_repository.git_https_url |
4564 | + args["git_repository"] = ( |
4565 | + build.recipe.git_repository.git_https_url |
4566 | + ) |
4567 | else: |
4568 | raise CannotBuild( |
4569 | "Source repository for ~%s/%s has been deleted." |
4570 | diff --git a/lib/lp/registry/browser/person.py b/lib/lp/registry/browser/person.py |
4571 | index de0003d..7a51447 100644 |
4572 | --- a/lib/lp/registry/browser/person.py |
4573 | +++ b/lib/lp/registry/browser/person.py |
4574 | @@ -3872,9 +3872,9 @@ class PersonRelatedSoftwareView(LaunchpadView): |
4575 | BuildStatus.MANUALDEPWAIT, |
4576 | BuildStatus.CHROOTWAIT, |
4577 | ] |
4578 | - needs_build_by_package[ |
4579 | - build.source_package_release.id |
4580 | - ] = needs_build |
4581 | + needs_build_by_package[build.source_package_release.id] = ( |
4582 | + needs_build |
4583 | + ) |
4584 | |
4585 | return (builds_by_package, needs_build_by_package) |
4586 | |
4587 | diff --git a/lib/lp/registry/browser/pillar.py b/lib/lp/registry/browser/pillar.py |
4588 | index 22fec1a..830253d 100644 |
4589 | --- a/lib/lp/registry/browser/pillar.py |
4590 | +++ b/lib/lp/registry/browser/pillar.py |
4591 | @@ -295,9 +295,9 @@ class PillarViewMixin: |
4592 | SimpleVocabulary.fromItems(policy_items), |
4593 | value_fn=lambda item: item.name, |
4594 | ) |
4595 | - cache.objects[ |
4596 | - "team_membership_policy_data" |
4597 | - ] = team_membership_policy_data |
4598 | + cache.objects["team_membership_policy_data"] = ( |
4599 | + team_membership_policy_data |
4600 | + ) |
4601 | |
4602 | |
4603 | class PillarSharingView(LaunchpadView): |
4604 | @@ -385,9 +385,9 @@ class PillarSharingView(LaunchpadView): |
4605 | cache.objects["sharing_permissions"] = self.sharing_permissions |
4606 | cache.objects["bug_sharing_policies"] = self.bug_sharing_policies |
4607 | cache.objects["branch_sharing_policies"] = self.branch_sharing_policies |
4608 | - cache.objects[ |
4609 | - "specification_sharing_policies" |
4610 | - ] = self.specification_sharing_policies |
4611 | + cache.objects["specification_sharing_policies"] = ( |
4612 | + self.specification_sharing_policies |
4613 | + ) |
4614 | cache.objects["has_edit_permission"] = check_permission( |
4615 | "launchpad.Edit", self.context |
4616 | ) |
4617 | @@ -402,9 +402,9 @@ class PillarSharingView(LaunchpadView): |
4618 | "launchpad.LimitedView", |
4619 | [grantee for grantee, _, _ in batch_navigator.batch], |
4620 | ) |
4621 | - cache.objects[ |
4622 | - "grantee_data" |
4623 | - ] = self._getSharingService().jsonGranteeData(batch_navigator.batch) |
4624 | + cache.objects["grantee_data"] = ( |
4625 | + self._getSharingService().jsonGranteeData(batch_navigator.batch) |
4626 | + ) |
4627 | cache.objects.update( |
4628 | get_batch_properties_for_json_cache(self, batch_navigator) |
4629 | ) |
4630 | diff --git a/lib/lp/registry/browser/product.py b/lib/lp/registry/browser/product.py |
4631 | index 3a5008a..400192d 100644 |
4632 | --- a/lib/lp/registry/browser/product.py |
4633 | +++ b/lib/lp/registry/browser/product.py |
4634 | @@ -2228,9 +2228,9 @@ class ProductSetBranchView( |
4635 | rcs_type = data.get("rcs_type") |
4636 | |
4637 | # Set the valid schemes based on rcs_type. |
4638 | - self.widgets[ |
4639 | - "repo_url" |
4640 | - ].field.allowed_schemes = self._validSchemes(rcs_type) |
4641 | + self.widgets["repo_url"].field.allowed_schemes = ( |
4642 | + self._validSchemes(rcs_type) |
4643 | + ) |
4644 | # The branch location is not required for validation. |
4645 | self._setRequired(["branch_location"], False) |
4646 | # The cvs_module is required if it is a CVS import. |
4647 | @@ -2759,9 +2759,9 @@ class ProjectAddStepTwo(StepView, ProductLicenseMixin, ReturnToReferrerMixin): |
4648 | self.widgets["name"].read_only = True |
4649 | # The "hint" is really more of an explanation at this point, but the |
4650 | # phrasing is different. |
4651 | - self.widgets[ |
4652 | - "name" |
4653 | - ].hint = "When published, this will be the project's URL." |
4654 | + self.widgets["name"].hint = ( |
4655 | + "When published, this will be the project's URL." |
4656 | + ) |
4657 | self.widgets["display_name"].visible = False |
4658 | self.widgets["source_package_name"].visible = False |
4659 | self.widgets["distroseries"].visible = False |
4660 | diff --git a/lib/lp/registry/browser/tests/test_distribution_views.py b/lib/lp/registry/browser/tests/test_distribution_views.py |
4661 | index 178f5dd..9867d95 100644 |
4662 | --- a/lib/lp/registry/browser/tests/test_distribution_views.py |
4663 | +++ b/lib/lp/registry/browser/tests/test_distribution_views.py |
4664 | @@ -604,9 +604,9 @@ class TestDistroEditView(OCIConfigHelperMixin, TestCaseWithFactory): |
4665 | transaction.commit() |
4666 | password = self.factory.getUniqueUnicode() |
4667 | edit_form["field.oci_registry_credentials.url"] = url |
4668 | - edit_form[ |
4669 | - "field.oci_registry_credentials.username" |
4670 | - ] = credentials.username |
4671 | + edit_form["field.oci_registry_credentials.username"] = ( |
4672 | + credentials.username |
4673 | + ) |
4674 | edit_form["field.oci_registry_credentials.region"] = "" |
4675 | edit_form["field.oci_registry_credentials.password"] = password |
4676 | edit_form["field.oci_registry_credentials.confirm_password"] = password |
4677 | diff --git a/lib/lp/registry/browser/tests/test_distroseries.py b/lib/lp/registry/browser/tests/test_distroseries.py |
4678 | index 2298c5c..30b4642 100644 |
4679 | --- a/lib/lp/registry/browser/tests/test_distroseries.py |
4680 | +++ b/lib/lp/registry/browser/tests/test_distroseries.py |
4681 | @@ -1401,12 +1401,12 @@ class TestDistroSeriesLocalDifferences( |
4682 | ) |
4683 | |
4684 | # Delete the publications. |
4685 | - removeSecurityProxy( |
4686 | - difference.source_pub |
4687 | - ).status = PackagePublishingStatus.DELETED |
4688 | - removeSecurityProxy( |
4689 | - difference.parent_source_pub |
4690 | - ).status = PackagePublishingStatus.DELETED |
4691 | + removeSecurityProxy(difference.source_pub).status = ( |
4692 | + PackagePublishingStatus.DELETED |
4693 | + ) |
4694 | + removeSecurityProxy(difference.parent_source_pub).status = ( |
4695 | + PackagePublishingStatus.DELETED |
4696 | + ) |
4697 | # Flush out the changes and invalidate caches (esp. property caches). |
4698 | flush_database_caches() |
4699 | |
4700 | diff --git a/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py b/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py |
4701 | index f165611..d7c979c 100644 |
4702 | --- a/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py |
4703 | +++ b/lib/lp/registry/browser/tests/test_distroseriesdifference_views.py |
4704 | @@ -159,9 +159,9 @@ class DistroSeriesDifferenceTestCase(TestCaseWithFactory): |
4705 | DistroSeriesDifferenceType.MISSING_FROM_DERIVED_SERIES |
4706 | ) |
4707 | ) |
4708 | - removeSecurityProxy( |
4709 | - ds_diff |
4710 | - ).parent_source_pub.status = PackagePublishingStatus.DELETED |
4711 | + removeSecurityProxy(ds_diff).parent_source_pub.status = ( |
4712 | + PackagePublishingStatus.DELETED |
4713 | + ) |
4714 | ds_diff.update() |
4715 | |
4716 | view = create_initialized_view(ds_diff, "+listing-distroseries-extra") |
4717 | diff --git a/lib/lp/registry/browser/tests/test_person.py b/lib/lp/registry/browser/tests/test_person.py |
4718 | index 19425f4..47a580c 100644 |
4719 | --- a/lib/lp/registry/browser/tests/test_person.py |
4720 | +++ b/lib/lp/registry/browser/tests/test_person.py |
4721 | @@ -1874,9 +1874,9 @@ class TestPersonOCIRegistryCredentialsView( |
4722 | browser.getControl(name="field.add_owner").value = [new_owner_name] |
4723 | browser.getControl(name="field.add_username").value = "new_username" |
4724 | browser.getControl(name="field.add_password").value = "password" |
4725 | - browser.getControl( |
4726 | - name="field.add_confirm_password" |
4727 | - ).value = "password" |
4728 | + browser.getControl(name="field.add_confirm_password").value = ( |
4729 | + "password" |
4730 | + ) |
4731 | browser.getControl("Save").click() |
4732 | |
4733 | with person_logged_in(self.user): |
4734 | diff --git a/lib/lp/registry/browser/tests/test_poll.py b/lib/lp/registry/browser/tests/test_poll.py |
4735 | index 773dec5..fb1ed86 100644 |
4736 | --- a/lib/lp/registry/browser/tests/test_poll.py |
4737 | +++ b/lib/lp/registry/browser/tests/test_poll.py |
4738 | @@ -68,12 +68,12 @@ class TestPollAddView(BrowserTestCase): |
4739 | ) |
4740 | browser.getControl("The unique name of this poll").value = "colour" |
4741 | browser.getControl("The title of this poll").value = "Favourite Colour" |
4742 | - browser.getControl( |
4743 | - "The date and time when this poll opens" |
4744 | - ).value = str(now + timedelta(days=1)) |
4745 | - browser.getControl( |
4746 | - "The date and time when this poll closes" |
4747 | - ).value = str(now + timedelta(days=2)) |
4748 | + browser.getControl("The date and time when this poll opens").value = ( |
4749 | + str(now + timedelta(days=1)) |
4750 | + ) |
4751 | + browser.getControl("The date and time when this poll closes").value = ( |
4752 | + str(now + timedelta(days=2)) |
4753 | + ) |
4754 | browser.getControl( |
4755 | "The proposition that is going to be voted" |
4756 | ).value = "What is your favourite colour?" |
4757 | @@ -89,12 +89,12 @@ class TestPollAddView(BrowserTestCase): |
4758 | browser = self.getViewBrowser(team, view_name="+newpoll", user=person) |
4759 | browser.getControl("The unique name of this poll").value = "colour" |
4760 | browser.getControl("The title of this poll").value = "Favourite Colour" |
4761 | - browser.getControl( |
4762 | - "The date and time when this poll opens" |
4763 | - ).value = str(now + timedelta(days=1)) |
4764 | - browser.getControl( |
4765 | - "The date and time when this poll closes" |
4766 | - ).value = str(now + timedelta(days=2)) |
4767 | + browser.getControl("The date and time when this poll opens").value = ( |
4768 | + str(now + timedelta(days=1)) |
4769 | + ) |
4770 | + browser.getControl("The date and time when this poll closes").value = ( |
4771 | + str(now + timedelta(days=2)) |
4772 | + ) |
4773 | browser.getControl( |
4774 | "The proposition that is going to be voted" |
4775 | ).value = "What is your favourite colour?" |
4776 | diff --git a/lib/lp/registry/browser/tests/test_product.py b/lib/lp/registry/browser/tests/test_product.py |
4777 | index 3d1775f..4c6fc92 100644 |
4778 | --- a/lib/lp/registry/browser/tests/test_product.py |
4779 | +++ b/lib/lp/registry/browser/tests/test_product.py |
4780 | @@ -1442,9 +1442,9 @@ class TestBrowserProductSetBranchView(BrowserTestCase): |
4781 | self.assertEqual( |
4782 | project_name, browser.getControl("Git repository name").value |
4783 | ) |
4784 | - browser.getControl( |
4785 | - "Git repository URL" |
4786 | - ).value = "https://git.example.org/imported" |
4787 | + browser.getControl("Git repository URL").value = ( |
4788 | + "https://git.example.org/imported" |
4789 | + ) |
4790 | browser.getControl("Update").click() |
4791 | |
4792 | tag = Tag( |
4793 | @@ -1471,9 +1471,9 @@ class TestBrowserProductSetBranchView(BrowserTestCase): |
4794 | browser.getControl( |
4795 | "Import a Git repository hosted somewhere else" |
4796 | ).click() |
4797 | - browser.getControl( |
4798 | - "Git repository URL" |
4799 | - ).value = "svn://svn.example.org/imported" |
4800 | + browser.getControl("Git repository URL").value = ( |
4801 | + "svn://svn.example.org/imported" |
4802 | + ) |
4803 | browser.getControl("Update").click() |
4804 | |
4805 | tag = Tag( |
4806 | diff --git a/lib/lp/registry/browser/tests/test_productseries_views.py b/lib/lp/registry/browser/tests/test_productseries_views.py |
4807 | index b74fd49..f43eb49 100644 |
4808 | --- a/lib/lp/registry/browser/tests/test_productseries_views.py |
4809 | +++ b/lib/lp/registry/browser/tests/test_productseries_views.py |
4810 | @@ -195,9 +195,9 @@ class TestWithBrowser(BrowserTestCase): |
4811 | distroseries=ubuntu_series, publish=True |
4812 | ) |
4813 | browser = self.getBrowser(productseries, "+ubuntupkg") |
4814 | - browser.getControl( |
4815 | - "Source Package Name" |
4816 | - ).value = sp.sourcepackagename.name |
4817 | + browser.getControl("Source Package Name").value = ( |
4818 | + sp.sourcepackagename.name |
4819 | + ) |
4820 | browser.getControl(ubuntu_series.displayname).selected = True |
4821 | browser.getControl("Update").click() |
4822 | tag = soupmatchers.Tag( |
4823 | diff --git a/lib/lp/registry/browser/tests/test_sourcepackage_views.py b/lib/lp/registry/browser/tests/test_sourcepackage_views.py |
4824 | index 9e60016..e171884 100644 |
4825 | --- a/lib/lp/registry/browser/tests/test_sourcepackage_views.py |
4826 | +++ b/lib/lp/registry/browser/tests/test_sourcepackage_views.py |
4827 | @@ -159,9 +159,9 @@ class TestSourcePackageViewHelpers(TestCaseWithFactory): |
4828 | def test_get_register_upstream_url_homepage(self): |
4829 | source_package = self._makePublishedSourcePackage() |
4830 | # SourcePackageReleases cannot be modified by users. |
4831 | - removeSecurityProxy( |
4832 | - source_package.currentrelease |
4833 | - ).homepage = "http://eg.dom/bonkers" |
4834 | + removeSecurityProxy(source_package.currentrelease).homepage = ( |
4835 | + "http://eg.dom/bonkers" |
4836 | + ) |
4837 | url = get_register_upstream_url(source_package) |
4838 | self.assertInQueryString( |
4839 | url, "field.homepageurl", "http://eg.dom/bonkers" |
4840 | diff --git a/lib/lp/registry/doc/productseries.rst b/lib/lp/registry/doc/productseries.rst |
4841 | index 5f931ff..7c55335 100644 |
4842 | --- a/lib/lp/registry/doc/productseries.rst |
4843 | +++ b/lib/lp/registry/doc/productseries.rst |
4844 | @@ -233,9 +233,9 @@ Now, we will make one of them accepted, the other declined, and both of |
4845 | them informational. |
4846 | |
4847 | >>> from lp.blueprints.enums import SpecificationImplementationStatus |
4848 | - >>> a.definition_status = ( |
4849 | - ... b.definition_status |
4850 | - ... ) = SpecificationDefinitionStatus.APPROVED |
4851 | + >>> a.definition_status = b.definition_status = ( |
4852 | + ... SpecificationDefinitionStatus.APPROVED |
4853 | + ... ) |
4854 | >>> a.implementation_status = ( |
4855 | ... SpecificationImplementationStatus.INFORMATIONAL |
4856 | ... ) |
4857 | diff --git a/lib/lp/registry/doc/teammembership.rst b/lib/lp/registry/doc/teammembership.rst |
4858 | index 173cd53..2865825 100644 |
4859 | --- a/lib/lp/registry/doc/teammembership.rst |
4860 | +++ b/lib/lp/registry/doc/teammembership.rst |
4861 | @@ -696,9 +696,9 @@ deactivated, so it should not be flagged as expired. |
4862 | True |
4863 | >>> sp_on_ubuntu_translators.status.title |
4864 | 'Deactivated' |
4865 | - >>> removeSecurityProxy( |
4866 | - ... sp_on_ubuntu_translators |
4867 | - ... ).dateexpires = one_day_ago |
4868 | + >>> removeSecurityProxy(sp_on_ubuntu_translators).dateexpires = ( |
4869 | + ... one_day_ago |
4870 | + ... ) |
4871 | >>> flush_database_updates() |
4872 | |
4873 | >>> for membership in membershipset.getMembershipsToExpire(): |
4874 | diff --git a/lib/lp/registry/mail/teammembership.py b/lib/lp/registry/mail/teammembership.py |
4875 | index b305930..46749ee 100644 |
4876 | --- a/lib/lp/registry/mail/teammembership.py |
4877 | +++ b/lib/lp/registry/mail/teammembership.py |
4878 | @@ -147,14 +147,14 @@ class TeamMembershipMailer(BaseMailer): |
4879 | template_name = "new-member-notification.txt" |
4880 | subject = "You have been added to %s" % team.name |
4881 | for recipient in get_recipients(member): |
4882 | - recipients[ |
4883 | - recipient |
4884 | - ] = TeamMembershipRecipientReason.forNewMember( |
4885 | - member, |
4886 | - team, |
4887 | - recipient, |
4888 | - subject=subject, |
4889 | - template_name=template_name, |
4890 | + recipients[recipient] = ( |
4891 | + TeamMembershipRecipientReason.forNewMember( |
4892 | + member, |
4893 | + team, |
4894 | + recipient, |
4895 | + subject=subject, |
4896 | + template_name=template_name, |
4897 | + ) |
4898 | ) |
4899 | # Open teams do not notify admins about new members. |
4900 | if team.membership_policy != TeamMembershipPolicy.OPEN: |
4901 | @@ -286,10 +286,13 @@ class TeamMembershipMailer(BaseMailer): |
4902 | recipient_class = "bulk" |
4903 | else: |
4904 | recipient_class = "personal" |
4905 | - recipients[ |
4906 | - recipient |
4907 | - ] = TeamMembershipRecipientReason.forMember( |
4908 | - member, team, recipient, recipient_class=recipient_class |
4909 | + recipients[recipient] = ( |
4910 | + TeamMembershipRecipientReason.forMember( |
4911 | + member, |
4912 | + team, |
4913 | + recipient, |
4914 | + recipient_class=recipient_class, |
4915 | + ) |
4916 | ) |
4917 | # Don't send admin notifications for open teams: they're |
4918 | # unrestricted, so notifications on join/leave do not help the |
4919 | @@ -300,10 +303,10 @@ class TeamMembershipMailer(BaseMailer): |
4920 | # The new member may also be a team admin; don't send |
4921 | # two notifications in that case. |
4922 | if recipient not in recipients: |
4923 | - recipients[ |
4924 | - recipient |
4925 | - ] = TeamMembershipRecipientReason.forAdmin( |
4926 | - admin, team, recipient, recipient_class="bulk" |
4927 | + recipients[recipient] = ( |
4928 | + TeamMembershipRecipientReason.forAdmin( |
4929 | + admin, team, recipient, recipient_class="bulk" |
4930 | + ) |
4931 | ) |
4932 | |
4933 | extra_params = { |
4934 | diff --git a/lib/lp/registry/model/distribution.py b/lib/lp/registry/model/distribution.py |
4935 | index 924c672..62ee160 100644 |
4936 | --- a/lib/lp/registry/model/distribution.py |
4937 | +++ b/lib/lp/registry/model/distribution.py |
4938 | @@ -2441,9 +2441,9 @@ class DistributionSet: |
4939 | result = {} |
4940 | for spr, distro_id in releases: |
4941 | distro = getUtility(IDistributionSet).get(distro_id) |
4942 | - result[ |
4943 | - distro.getSourcePackage(spr.sourcepackagename) |
4944 | - ] = DistributionSourcePackageRelease(distro, spr) |
4945 | + result[distro.getSourcePackage(spr.sourcepackagename)] = ( |
4946 | + DistributionSourcePackageRelease(distro, spr) |
4947 | + ) |
4948 | return result |
4949 | |
4950 | def getDerivedDistributions(self): |
4951 | diff --git a/lib/lp/registry/model/distroseries.py b/lib/lp/registry/model/distroseries.py |
4952 | index f67348b..78283b9 100644 |
4953 | --- a/lib/lp/registry/model/distroseries.py |
4954 | +++ b/lib/lp/registry/model/distroseries.py |
4955 | @@ -966,9 +966,9 @@ class DistroSeries( |
4956 | @strict_supported_component_dependencies.setter |
4957 | def strict_supported_component_dependencies(self, value): |
4958 | assert isinstance(value, bool) |
4959 | - self.publishing_options[ |
4960 | - "strict_supported_component_dependencies" |
4961 | - ] = value |
4962 | + self.publishing_options["strict_supported_component_dependencies"] = ( |
4963 | + value |
4964 | + ) |
4965 | |
4966 | @property |
4967 | def publish_i18n_index(self): |
4968 | @@ -1872,9 +1872,9 @@ class DistroSeriesSet: |
4969 | result = {} |
4970 | for spr, series_id in releases: |
4971 | series = getUtility(IDistroSeriesSet).get(series_id) |
4972 | - result[ |
4973 | - series.getSourcePackage(spr.sourcepackagename) |
4974 | - ] = DistributionSourcePackageRelease(series.distribution, spr) |
4975 | + result[series.getSourcePackage(spr.sourcepackagename)] = ( |
4976 | + DistributionSourcePackageRelease(series.distribution, spr) |
4977 | + ) |
4978 | return result |
4979 | |
4980 | def search(self, distribution=None, isreleased=None, orderBy=None): |
4981 | diff --git a/lib/lp/registry/model/mailinglist.py b/lib/lp/registry/model/mailinglist.py |
4982 | index f3fcaf5..470d124 100644 |
4983 | --- a/lib/lp/registry/model/mailinglist.py |
4984 | +++ b/lib/lp/registry/model/mailinglist.py |
4985 | @@ -328,9 +328,9 @@ class MailingList(StormBase): |
4986 | # We also need to remove the email's security proxy because |
4987 | # this method will be called via the internal XMLRPC rather |
4988 | # than as a response to a user action. |
4989 | - removeSecurityProxy( |
4990 | |
4991 | - ).status = EmailAddressStatus.VALIDATED |
4992 | + removeSecurityProxy(email).status = ( |
4993 | + EmailAddressStatus.VALIDATED |
4994 | + ) |
4995 | assert ( |
4996 | email.person == self.team |
4997 | ), "Email already associated with another team." |
4998 | diff --git a/lib/lp/registry/stories/announcements/xx-announcements.rst b/lib/lp/registry/stories/announcements/xx-announcements.rst |
4999 | index a051a28..a6ff3c5 100644 |
5000 | --- a/lib/lp/registry/stories/announcements/xx-announcements.rst |
The diff has been truncated for viewing.
I have quickly scanned the MP - this looks fine. I trust our test suite to find any possible regression. As we do not have test first, merge later setup currently, I suggest to merge this as is and fix any fallout, which I do not expect a lot.
Thanks for remembering to add a git-blame- revs-entry.