Merge ~cristiangsp/launchpad:linting-f402 into launchpad:master

Proposed by Cristian Gonzalez
Status: Merged
Approved by: Cristian Gonzalez
Approved revision: 3d8ead1db97de517c66dc38b36897f4069573c95
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cristiangsp/launchpad:linting-f402
Merge into: launchpad:master
Diff against target: 134 lines (+21/-21)
5 files modified
lib/lp/answers/browser/question.py (+2/-2)
lib/lp/app/browser/multistep.py (+4/-4)
lib/lp/code/browser/branch.py (+8/-8)
lib/lp/code/browser/gitrepository.py (+5/-5)
lib/lp/code/model/tests/test_gitrepository.py (+2/-2)
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+406641@code.launchpad.net

Commit message

Fixing F402 linting errors.

Description of the change

Fixing F402 linting errors.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/answers/browser/question.py b/lib/lp/answers/browser/question.py
2index 52cff40..de8039a 100644
3--- a/lib/lp/answers/browser/question.py
4+++ b/lib/lp/answers/browser/question.py
5@@ -957,8 +957,8 @@ class QuestionWorkflowView(LaunchpadFormView, LinkFAQMixin):
6
7 def hasActions(self):
8 """Return True if some actions are possible for this user."""
9- for action in self.actions:
10- if action.available():
11+ for operation in self.actions:
12+ if operation.available():
13 return True
14 return False
15
16diff --git a/lib/lp/app/browser/multistep.py b/lib/lp/app/browser/multistep.py
17index 76cf29d..ac77961 100644
18--- a/lib/lp/app/browser/multistep.py
19+++ b/lib/lp/app/browser/multistep.py
20@@ -238,11 +238,11 @@ class StepView(LaunchpadFormView):
21 # This is a hack to make it possible to change the label of our main
22 # action in subclasses.
23 actions = []
24- for action in self.actions:
25+ for operation in self.actions:
26 # Only change the label of our 'continue' action.
27- if action.__name__ == 'field.actions.continue':
28- action.label = self.main_action_label
29- actions.append(action)
30+ if operation.__name__ == 'field.actions.continue':
31+ operation.label = self.main_action_label
32+ actions.append(operation)
33 self.actions = actions
34 return super(StepView, self).render()
35
36diff --git a/lib/lp/code/browser/branch.py b/lib/lp/code/browser/branch.py
37index f7502e7..cbd4a37 100644
38--- a/lib/lp/code/browser/branch.py
39+++ b/lib/lp/code/browser/branch.py
40@@ -952,13 +952,13 @@ class BranchDeletionView(LaunchpadFormView):
41 def display_deletion_requirements(self):
42 """Normal deletion requirements, indication of permissions.
43
44- :return: A list of tuples of (item, action, reason, allowed)
45+ :return: A list of tuples of (item, operation, reason, allowed)
46 """
47 reqs = []
48- for item, (action, reason) in six.iteritems(
49+ for item, (operation, reason) in six.iteritems(
50 self.context.deletionRequirements(eager_load=True)):
51 allowed = check_permission('launchpad.Edit', item)
52- reqs.append((item, action, reason, allowed))
53+ reqs.append((item, operation, reason, allowed))
54 return reqs
55
56 @cachedproperty
57@@ -1008,19 +1008,19 @@ class BranchDeletionView(LaunchpadFormView):
58 'item', 'reason' and 'allowed'.
59 """
60 row_dict = {'delete': [], 'alter': [], 'break_link': []}
61- for item, action, reason, allowed in (
62+ for item, operation, reason, allowed in (
63 self.display_deletion_requirements):
64 if IBugBranch.providedBy(item):
65- action = 'break_link'
66+ operation = 'break_link'
67 elif ISpecificationBranch.providedBy(item):
68- action = 'break_link'
69+ operation = 'break_link'
70 elif IProductSeries.providedBy(item):
71- action = 'break_link'
72+ operation = 'break_link'
73 row = {'item': item,
74 'reason': reason,
75 'allowed': allowed,
76 }
77- row_dict[action].append(row)
78+ row_dict[operation].append(row)
79 return row_dict
80
81 @property
82diff --git a/lib/lp/code/browser/gitrepository.py b/lib/lp/code/browser/gitrepository.py
83index fb51ca1..4214e3f 100644
84--- a/lib/lp/code/browser/gitrepository.py
85+++ b/lib/lp/code/browser/gitrepository.py
86@@ -1364,13 +1364,13 @@ class GitRepositoryDeletionView(LaunchpadFormView):
87 def display_deletion_requirements(self):
88 """Normal deletion requirements, indication of permissions.
89
90- :return: A list of tuples of (item, action, reason, allowed)
91+ :return: A list of tuples of (item, operation, reason, allowed)
92 """
93 reqs = []
94- for item, (action, reason) in six.iteritems(
95+ for item, (operation, reason) in six.iteritems(
96 self.context.getDeletionRequirements(eager_load=True)):
97 allowed = check_permission("launchpad.Edit", item)
98- reqs.append((item, action, reason, allowed))
99+ reqs.append((item, operation, reason, allowed))
100 return reqs
101
102 def all_permitted(self):
103@@ -1405,13 +1405,13 @@ class GitRepositoryDeletionView(LaunchpadFormView):
104 "item", "reason" and "allowed".
105 """
106 row_dict = {"delete": [], "alter": []}
107- for item, action, reason, allowed in (
108+ for item, operation, reason, allowed in (
109 self.display_deletion_requirements):
110 row = {"item": item,
111 "reason": reason,
112 "allowed": allowed,
113 }
114- row_dict[action].append(row)
115+ row_dict[operation].append(row)
116 return row_dict
117
118 @property
119diff --git a/lib/lp/code/model/tests/test_gitrepository.py b/lib/lp/code/model/tests/test_gitrepository.py
120index 203ceda..de296a7 100644
121--- a/lib/lp/code/model/tests/test_gitrepository.py
122+++ b/lib/lp/code/model/tests/test_gitrepository.py
123@@ -4142,9 +4142,9 @@ class TestGitRepositoryWebservice(TestCaseWithFactory):
124 self.assertEqual(200, response.status)
125 self.assertEqual(0, response.jsonBody())
126 with person_logged_in(person):
127- for _ in range(5):
128+ for item in range(5):
129 self.factory.makeGitRepository()
130- for _ in range(3):
131+ for item in range(3):
132 repo = self.factory.makeGitRepository()
133 removeSecurityProxy(repo).loose_object_count = 7000
134 removeSecurityProxy(repo).pack_count = 43

Subscribers

People subscribed via source and target branches

to status/vote changes: