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 (community) 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
diff --git a/lib/lp/answers/browser/question.py b/lib/lp/answers/browser/question.py
index 52cff40..de8039a 100644
--- a/lib/lp/answers/browser/question.py
+++ b/lib/lp/answers/browser/question.py
@@ -957,8 +957,8 @@ class QuestionWorkflowView(LaunchpadFormView, LinkFAQMixin):
957957
958 def hasActions(self):958 def hasActions(self):
959 """Return True if some actions are possible for this user."""959 """Return True if some actions are possible for this user."""
960 for action in self.actions:960 for operation in self.actions:
961 if action.available():961 if operation.available():
962 return True962 return True
963 return False963 return False
964964
diff --git a/lib/lp/app/browser/multistep.py b/lib/lp/app/browser/multistep.py
index 76cf29d..ac77961 100644
--- a/lib/lp/app/browser/multistep.py
+++ b/lib/lp/app/browser/multistep.py
@@ -238,11 +238,11 @@ class StepView(LaunchpadFormView):
238 # This is a hack to make it possible to change the label of our main238 # This is a hack to make it possible to change the label of our main
239 # action in subclasses.239 # action in subclasses.
240 actions = []240 actions = []
241 for action in self.actions:241 for operation in self.actions:
242 # Only change the label of our 'continue' action.242 # Only change the label of our 'continue' action.
243 if action.__name__ == 'field.actions.continue':243 if operation.__name__ == 'field.actions.continue':
244 action.label = self.main_action_label244 operation.label = self.main_action_label
245 actions.append(action)245 actions.append(operation)
246 self.actions = actions246 self.actions = actions
247 return super(StepView, self).render()247 return super(StepView, self).render()
248248
diff --git a/lib/lp/code/browser/branch.py b/lib/lp/code/browser/branch.py
index f7502e7..cbd4a37 100644
--- a/lib/lp/code/browser/branch.py
+++ b/lib/lp/code/browser/branch.py
@@ -952,13 +952,13 @@ class BranchDeletionView(LaunchpadFormView):
952 def display_deletion_requirements(self):952 def display_deletion_requirements(self):
953 """Normal deletion requirements, indication of permissions.953 """Normal deletion requirements, indication of permissions.
954954
955 :return: A list of tuples of (item, action, reason, allowed)955 :return: A list of tuples of (item, operation, reason, allowed)
956 """956 """
957 reqs = []957 reqs = []
958 for item, (action, reason) in six.iteritems(958 for item, (operation, reason) in six.iteritems(
959 self.context.deletionRequirements(eager_load=True)):959 self.context.deletionRequirements(eager_load=True)):
960 allowed = check_permission('launchpad.Edit', item)960 allowed = check_permission('launchpad.Edit', item)
961 reqs.append((item, action, reason, allowed))961 reqs.append((item, operation, reason, allowed))
962 return reqs962 return reqs
963963
964 @cachedproperty964 @cachedproperty
@@ -1008,19 +1008,19 @@ class BranchDeletionView(LaunchpadFormView):
1008 'item', 'reason' and 'allowed'.1008 'item', 'reason' and 'allowed'.
1009 """1009 """
1010 row_dict = {'delete': [], 'alter': [], 'break_link': []}1010 row_dict = {'delete': [], 'alter': [], 'break_link': []}
1011 for item, action, reason, allowed in (1011 for item, operation, reason, allowed in (
1012 self.display_deletion_requirements):1012 self.display_deletion_requirements):
1013 if IBugBranch.providedBy(item):1013 if IBugBranch.providedBy(item):
1014 action = 'break_link'1014 operation = 'break_link'
1015 elif ISpecificationBranch.providedBy(item):1015 elif ISpecificationBranch.providedBy(item):
1016 action = 'break_link'1016 operation = 'break_link'
1017 elif IProductSeries.providedBy(item):1017 elif IProductSeries.providedBy(item):
1018 action = 'break_link'1018 operation = 'break_link'
1019 row = {'item': item,1019 row = {'item': item,
1020 'reason': reason,1020 'reason': reason,
1021 'allowed': allowed,1021 'allowed': allowed,
1022 }1022 }
1023 row_dict[action].append(row)1023 row_dict[operation].append(row)
1024 return row_dict1024 return row_dict
10251025
1026 @property1026 @property
diff --git a/lib/lp/code/browser/gitrepository.py b/lib/lp/code/browser/gitrepository.py
index fb51ca1..4214e3f 100644
--- a/lib/lp/code/browser/gitrepository.py
+++ b/lib/lp/code/browser/gitrepository.py
@@ -1364,13 +1364,13 @@ class GitRepositoryDeletionView(LaunchpadFormView):
1364 def display_deletion_requirements(self):1364 def display_deletion_requirements(self):
1365 """Normal deletion requirements, indication of permissions.1365 """Normal deletion requirements, indication of permissions.
13661366
1367 :return: A list of tuples of (item, action, reason, allowed)1367 :return: A list of tuples of (item, operation, reason, allowed)
1368 """1368 """
1369 reqs = []1369 reqs = []
1370 for item, (action, reason) in six.iteritems(1370 for item, (operation, reason) in six.iteritems(
1371 self.context.getDeletionRequirements(eager_load=True)):1371 self.context.getDeletionRequirements(eager_load=True)):
1372 allowed = check_permission("launchpad.Edit", item)1372 allowed = check_permission("launchpad.Edit", item)
1373 reqs.append((item, action, reason, allowed))1373 reqs.append((item, operation, reason, allowed))
1374 return reqs1374 return reqs
13751375
1376 def all_permitted(self):1376 def all_permitted(self):
@@ -1405,13 +1405,13 @@ class GitRepositoryDeletionView(LaunchpadFormView):
1405 "item", "reason" and "allowed".1405 "item", "reason" and "allowed".
1406 """1406 """
1407 row_dict = {"delete": [], "alter": []}1407 row_dict = {"delete": [], "alter": []}
1408 for item, action, reason, allowed in (1408 for item, operation, reason, allowed in (
1409 self.display_deletion_requirements):1409 self.display_deletion_requirements):
1410 row = {"item": item,1410 row = {"item": item,
1411 "reason": reason,1411 "reason": reason,
1412 "allowed": allowed,1412 "allowed": allowed,
1413 }1413 }
1414 row_dict[action].append(row)1414 row_dict[operation].append(row)
1415 return row_dict1415 return row_dict
14161416
1417 @property1417 @property
diff --git a/lib/lp/code/model/tests/test_gitrepository.py b/lib/lp/code/model/tests/test_gitrepository.py
index 203ceda..de296a7 100644
--- a/lib/lp/code/model/tests/test_gitrepository.py
+++ b/lib/lp/code/model/tests/test_gitrepository.py
@@ -4142,9 +4142,9 @@ class TestGitRepositoryWebservice(TestCaseWithFactory):
4142 self.assertEqual(200, response.status)4142 self.assertEqual(200, response.status)
4143 self.assertEqual(0, response.jsonBody())4143 self.assertEqual(0, response.jsonBody())
4144 with person_logged_in(person):4144 with person_logged_in(person):
4145 for _ in range(5):4145 for item in range(5):
4146 self.factory.makeGitRepository()4146 self.factory.makeGitRepository()
4147 for _ in range(3):4147 for item in range(3):
4148 repo = self.factory.makeGitRepository()4148 repo = self.factory.makeGitRepository()
4149 removeSecurityProxy(repo).loose_object_count = 70004149 removeSecurityProxy(repo).loose_object_count = 7000
4150 removeSecurityProxy(repo).pack_count = 434150 removeSecurityProxy(repo).pack_count = 43

Subscribers

People subscribed via source and target branches

to status/vote changes: