allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [04/17] allura git commit: [#7864] update pyflakes to avoid invalid warnings from @property.setter dupe fn name; fix new pyflakes warnings
Date Thu, 16 Apr 2015 17:05:01 GMT
[#7864] update pyflakes to avoid invalid warnings from @property.setter dupe fn name; fix new
pyflakes warnings


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/567b1d41
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/567b1d41
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/567b1d41

Branch: refs/heads/hs/7852
Commit: 567b1d41befe2571e0f7cdd02f061282b1427ffd
Parents: c72837d
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Apr 8 16:04:12 2015 -0400
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Wed Apr 15 11:04:03 2015 +0000

----------------------------------------------------------------------
 Allura/allura/command/show_models.py        | 4 ++--
 Allura/allura/controllers/repository.py     | 8 ++++----
 Allura/allura/controllers/site_admin.py     | 6 +++---
 Allura/allura/lib/helpers.py                | 4 ++--
 Allura/allura/model/project.py              | 2 +-
 Allura/allura/tests/test_commands.py        | 7 +++----
 Allura/allura/tests/unit/test_repo.py       | 6 +++---
 ForgeSVN/forgesvn/model/svn.py              | 3 +--
 ForgeTracker/forgetracker/import_support.py | 4 ++--
 ForgeTracker/forgetracker/tracker_main.py   | 6 +++---
 requirements.txt                            | 2 +-
 11 files changed, 25 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/Allura/allura/command/show_models.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/show_models.py b/Allura/allura/command/show_models.py
index 36aa29e..d941e9e 100644
--- a/Allura/allura/command/show_models.py
+++ b/Allura/allura/command/show_models.py
@@ -359,8 +359,8 @@ def dump_cls(depth, cls):
 
 def dfs(root, graph, depth=0):
     yield depth, root
-    for c in graph[root][1]:
-        for r in dfs(c, graph, depth + 1):
+    for node in graph[root][1]:
+        for r in dfs(node, graph, depth + 1):
             yield r
 
 

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 34210ce..b36449c 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -254,8 +254,8 @@ class RepoRootController(BaseController, FeedController):
         columns = []
 
         def find_column(columns):
-            for i, c in enumerate(columns):
-                if c is None:
+            for i, col in enumerate(columns):
+                if col is None:
                     return i
             columns.append(None)
             return len(columns) - 1
@@ -757,8 +757,8 @@ def topo_sort(children, parents, dates, head_ids):
         visited.add(next)
         yield next
         for p in parents[next]:
-            for c in children[p]:
-                if c not in visited:
+            for child in children[p]:
+                if child not in visited:
                     break
             else:
                 to_visit.append(p)

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index a85680b..ee47274 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -275,18 +275,18 @@ class SiteAdminController(object):
                     _id = obj['id'].split('#')[1]
                     obj['object'] = mongo_objects.get(_id)
                 # Some objects can be deleted, but still have index in solr, should skip
those
-                objects = [obj for obj in objects if obj.get('object')]
+                objects = [o for o in objects if o.get('object')]
 
         def convert_fields(obj):
             # throw the type away (e.g. '_s' from 'url_s')
             result = {}
-            for k,v in obj.iteritems():
+            for k,val in obj.iteritems():
                 name = k.rsplit('_', 1)
                 if len(name) == 2:
                     name = name[0]
                 else:
                     name = k
-                result[name] = v
+                result[name] = val
             return result
 
         return {

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/Allura/allura/lib/helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 3cd14fb..36932a3 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -583,8 +583,8 @@ def twophase_transaction(*engines):
     txns = []
     to_rollback = []
     try:
-        for c in connections:
-            txn = c.begin_twophase()
+        for conn in connections:
+            txn = conn.begin_twophase()
             txns.append(txn)
             to_rollback.append(txn)
         yield

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index b66ecec..db460a1 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -551,7 +551,7 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
             try:
                 App = ac.load()
             # If so, we don't want it listed
-            except KeyError as e:
+            except KeyError:
                 log.exception('AppConfig %s references invalid tool %s',
                               ac._id, ac.tool_name)
                 continue

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/Allura/allura/tests/test_commands.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_commands.py b/Allura/allura/tests/test_commands.py
index 1c298c5..f6800b7 100644
--- a/Allura/allura/tests/test_commands.py
+++ b/Allura/allura/tests/test_commands.py
@@ -193,11 +193,10 @@ class TestEnsureIndexCommand(object):
         cmd._update_indexes(collection, indexes)
 
         collection_call_order = {}
-        for i, call in enumerate(collection.mock_calls):
-            method_name = call[0]
+        for i, call_ in enumerate(collection.mock_calls):
+            method_name = call_[0]
             collection_call_order[method_name] = i
-        assert collection_call_order['ensure_index'] < collection_call_order[
-            'drop_index'], collection.mock_calls
+        assert collection_call_order['ensure_index'] < collection_call_order['drop_index'],
collection.mock_calls
 
     def test_update_indexes_unique_changes(self):
         collection = Mock(name='collection')

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/Allura/allura/tests/unit/test_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_repo.py b/Allura/allura/tests/unit/test_repo.py
index 7411db5..9008571 100644
--- a/Allura/allura/tests/unit/test_repo.py
+++ b/Allura/allura/tests/unit/test_repo.py
@@ -42,9 +42,9 @@ class TestCommitRunBuilder(unittest.TestCase):
             M.repository.CommitDoc.make(dict(
                 _id=str(i)))
             for i in range(10)]
-        for p, c in zip(commits, commits[1:]):
-            p.child_ids = [c._id]
-            c.parent_ids = [p._id]
+        for p, com in zip(commits, commits[1:]):
+            p.child_ids = [com._id]
+            com.parent_ids = [p._id]
         for ci in commits:
             ci.m.save()
         self.commits = commits

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 4594a2f..cd410e3 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -360,8 +360,7 @@ class SVNImplementation(M.RepositoryImplementation):
             if not oid.startswith(prefix):
                 break
             seen_oids.add(oid)
-        return [
-            oid for oid in oids if oid not in seen_oids]
+        return [o for o in oids if o not in seen_oids]
 
     def refresh_commit_info(self, oid, seen_object_ids, lazy=True):
         from allura.model.repository import CommitDoc

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/ForgeTracker/forgetracker/import_support.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/import_support.py b/ForgeTracker/forgetracker/import_support.py
index c1865e9..affe94b 100644
--- a/ForgeTracker/forgetracker/import_support.py
+++ b/ForgeTracker/forgetracker/import_support.py
@@ -282,8 +282,8 @@ class ImportSupport(object):
         for a in artifacts:
             users.add(a['submitter'])
             users.add(a['assigned_to'])
-            for c in a['comments']:
-                users.add(c['submitter'])
+            for com in a['comments']:
+                users.add(com['submitter'])
         return users
 
     def find_unknown_users(self, users):

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index b846f42..4f20d88 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -57,7 +57,7 @@ from allura.lib.widgets import form_fields as ffw
 from allura.lib.widgets.subscriptions import SubscribeForm
 from allura.lib.plugin import ImportIdConverter
 from allura.controllers import AppDiscussionController, AppDiscussionRestController
-from allura.controllers import attachments as ac
+from allura.controllers import attachments as att
 from allura.controllers import BaseController
 from allura.controllers.feed import FeedArgs, FeedController
 
@@ -1531,12 +1531,12 @@ class TicketController(BaseController, FeedController):
         }
 
 
-class AttachmentController(ac.AttachmentController):
+class AttachmentController(att.AttachmentController):
     AttachmentClass = TM.TicketAttachment
     edit_perm = 'update'
 
 
-class AttachmentsController(ac.AttachmentsController):
+class AttachmentsController(att.AttachmentsController):
     AttachmentControllerClass = AttachmentController
 
 NONALNUM_RE = re.compile(r'\W+')

http://git-wip-us.apache.org/repos/asf/allura/blob/567b1d41/requirements.txt
----------------------------------------------------------------------
diff --git a/requirements.txt b/requirements.txt
index 6de0f60..5664528 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -74,7 +74,7 @@ datadiff==1.1.5
 ipython==1.2.1
 mock==1.0.1
 nose==1.3.4
-pyflakes==0.5.0
+pyflakes==0.8.1
 WebTest==1.4.0
 testfixtures==3.0.0
 q==2.3


Mime
View raw message