← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Cristian Gonzalez has proposed merging ~cristiangsp/launchpad:linting-f402 into launchpad:master.

Commit message:
Fixing F402 linting errors.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cristiangsp/launchpad/+git/launchpad/+merge/406641

Fixing F402 linting errors.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cristiangsp/launchpad:linting-f402 into launchpad:master.
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):
 
     def hasActions(self):
         """Return True if some actions are possible for this user."""
-        for action in self.actions:
-            if action.available():
+        for operation in self.actions:
+            if operation.available():
                 return True
         return False
 
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):
         # This is a hack to make it possible to change the label of our main
         # action in subclasses.
         actions = []
-        for action in self.actions:
+        for operation in self.actions:
             # Only change the label of our 'continue' action.
-            if action.__name__ == 'field.actions.continue':
-                action.label = self.main_action_label
-            actions.append(action)
+            if operation.__name__ == 'field.actions.continue':
+                operation.label = self.main_action_label
+            actions.append(operation)
         self.actions = actions
         return super(StepView, self).render()
 
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):
     def display_deletion_requirements(self):
         """Normal deletion requirements, indication of permissions.
 
-        :return: A list of tuples of (item, action, reason, allowed)
+        :return: A list of tuples of (item, operation, reason, allowed)
         """
         reqs = []
-        for item, (action, reason) in six.iteritems(
+        for item, (operation, reason) in six.iteritems(
                 self.context.deletionRequirements(eager_load=True)):
             allowed = check_permission('launchpad.Edit', item)
-            reqs.append((item, action, reason, allowed))
+            reqs.append((item, operation, reason, allowed))
         return reqs
 
     @cachedproperty
@@ -1008,19 +1008,19 @@ class BranchDeletionView(LaunchpadFormView):
         'item', 'reason' and 'allowed'.
         """
         row_dict = {'delete': [], 'alter': [], 'break_link': []}
-        for item, action, reason, allowed in (
+        for item, operation, reason, allowed in (
             self.display_deletion_requirements):
             if IBugBranch.providedBy(item):
-                action = 'break_link'
+                operation = 'break_link'
             elif ISpecificationBranch.providedBy(item):
-                action = 'break_link'
+                operation = 'break_link'
             elif IProductSeries.providedBy(item):
-                action = 'break_link'
+                operation = 'break_link'
             row = {'item': item,
                    'reason': reason,
                    'allowed': allowed,
                   }
-            row_dict[action].append(row)
+            row_dict[operation].append(row)
         return row_dict
 
     @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):
     def display_deletion_requirements(self):
         """Normal deletion requirements, indication of permissions.
 
-        :return: A list of tuples of (item, action, reason, allowed)
+        :return: A list of tuples of (item, operation, reason, allowed)
         """
         reqs = []
-        for item, (action, reason) in six.iteritems(
+        for item, (operation, reason) in six.iteritems(
                 self.context.getDeletionRequirements(eager_load=True)):
             allowed = check_permission("launchpad.Edit", item)
-            reqs.append((item, action, reason, allowed))
+            reqs.append((item, operation, reason, allowed))
         return reqs
 
     def all_permitted(self):
@@ -1405,13 +1405,13 @@ class GitRepositoryDeletionView(LaunchpadFormView):
         "item", "reason" and "allowed".
         """
         row_dict = {"delete": [], "alter": []}
-        for item, action, reason, allowed in (
+        for item, operation, reason, allowed in (
             self.display_deletion_requirements):
             row = {"item": item,
                    "reason": reason,
                    "allowed": allowed,
                   }
-            row_dict[action].append(row)
+            row_dict[operation].append(row)
         return row_dict
 
     @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):
         self.assertEqual(200, response.status)
         self.assertEqual(0, response.jsonBody())
         with person_logged_in(person):
-            for _ in range(5):
+            for item in range(5):
                 self.factory.makeGitRepository()
-            for _ in range(3):
+            for item in range(3):
                 repo = self.factory.makeGitRepository()
                 removeSecurityProxy(repo).loose_object_count = 7000
                 removeSecurityProxy(repo).pack_count = 43