incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [2/3] Pylint cleanup
Date Fri, 10 Jan 2014 23:17:16 GMT
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/model/test_filesystem.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_filesystem.py b/Allura/allura/tests/model/test_filesystem.py
index 312807f..1f4c1da 100644
--- a/Allura/allura/tests/model/test_filesystem.py
+++ b/Allura/allura/tests/model/test_filesystem.py
@@ -22,7 +22,7 @@ from unittest import TestCase
 from cStringIO import StringIO
 from io import BytesIO
 
-from pylons import tmpl_context as c, app_globals as g
+from pylons import tmpl_context as c
 from ming.orm import session, Mapper
 from nose.tools import assert_equal
 from mock import patch

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/model/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_neighborhood.py b/Allura/allura/tests/model/test_neighborhood.py
index afc53c6..e5188ff 100644
--- a/Allura/allura/tests/model/test_neighborhood.py
+++ b/Allura/allura/tests/model/test_neighborhood.py
@@ -21,11 +21,8 @@
 Model tests for neighborhood
 """
 from nose.tools import with_setup
-from pylons import tmpl_context as c
-from ming.orm.ormsession import ThreadLocalORMSession
 
 from allura import model as M
-from allura.lib import helpers as h
 from allura.tests import decorators as td
 from alluratest.controller import setup_basic_test, setup_global_objects
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/model/test_notification.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_notification.py b/Allura/allura/tests/model/test_notification.py
index d5f0a14..88bdf45 100644
--- a/Allura/allura/tests/model/test_notification.py
+++ b/Allura/allura/tests/model/test_notification.py
@@ -25,7 +25,7 @@ from ming.orm import ThreadLocalORMSession
 import mock
 import bson
 
-from alluratest.controller import setup_basic_test, setup_global_objects, REGISTRY
+from alluratest.controller import setup_basic_test, setup_global_objects
 from allura import model as M
 from allura.model.notification import MailFooter
 from allura.lib import helpers as h
@@ -190,7 +190,7 @@ class TestPostNotifications(unittest.TestCase):
 
     def test_post_user_notification(self):
         u = M.User.query.get(username='test-admin')
-        n = M.Notification.post_user(u, self.pg, 'metadata')
+        M.Notification.post_user(u, self.pg, 'metadata')
         ThreadLocalORMSession.flush_all()
         ThreadLocalORMSession.close_all()
         flash_msgs = list(h.pop_user_notifications(u))

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/model/test_project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_project.py b/Allura/allura/tests/model/test_project.py
index 855432a..b33596c 100644
--- a/Allura/allura/tests/model/test_project.py
+++ b/Allura/allura/tests/model/test_project.py
@@ -20,7 +20,7 @@
 """
 Model tests for project
 """
-from nose.tools import with_setup, assert_equals, assert_in
+from nose.tools import assert_equals, assert_in
 from pylons import tmpl_context as c
 from ming.orm.ormsession import ThreadLocalORMSession
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/model/test_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_repo.py b/Allura/allura/tests/model/test_repo.py
index 24ab25d..cd019ae 100644
--- a/Allura/allura/tests/model/test_repo.py
+++ b/Allura/allura/tests/model/test_repo.py
@@ -379,7 +379,7 @@ class TestLastCommit(unittest.TestCase):
         self.assertEqual(lcd.by_name['file4'], commit4._id)
 
     def test_missing_add_record(self):
-        commit1 = self._add_commit('Commit 1', ['file1'])
+        self._add_commit('Commit 1', ['file1'])
         commit2 = self._add_commit('Commit 2', ['file2'])
         commit2.changed_paths = []
         result = self.repo.last_commit_ids(commit2, ['file2'])

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/test_app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_app.py b/Allura/allura/tests/test_app.py
index 9389238..f5f5ac4 100644
--- a/Allura/allura/tests/test_app.py
+++ b/Allura/allura/tests/test_app.py
@@ -15,16 +15,12 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import re
-import unittest
-
 from pylons import tmpl_context as c, app_globals as g
 import mock
 from ming.base import Object
 
 from allura import app
 from allura.lib.app_globals import Globals
-from allura import model as M
 
 
 def setUp():

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/test_commands.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_commands.py b/Allura/allura/tests/test_commands.py
index 4dda1be..1ecfb39 100644
--- a/Allura/allura/tests/test_commands.py
+++ b/Allura/allura/tests/test_commands.py
@@ -26,7 +26,6 @@ from alluratest.controller import setup_basic_test, setup_global_objects
 from allura.command import base, script, set_neighborhood_features, \
     create_neighborhood, show_models, taskd_cleanup
 from allura import model as M
-from forgeblog import model as BM
 from allura.lib.exceptions import InvalidNBFeatureValueError
 from allura.tests import decorators as td
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index 6627e56..ea7313d 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -24,11 +24,10 @@ import allura
 import unittest
 import hashlib
 from mock import patch
-from urllib import quote
 
 from bson import ObjectId
 
-from nose.tools import with_setup, assert_equal, assert_in, assert_not_in
+from nose.tools import with_setup, assert_equal, assert_in
 from pylons import tmpl_context as c, app_globals as g
 
 from ming.orm import ThreadLocalORMSession
@@ -551,9 +550,8 @@ def test_hideawards_macro():
     project = M.Project.query.get(
         neighborhood_id=p_nbhd._id, shortname=u'test')
 
-    award_grant = M.AwardGrant(award=award,
-                               granted_by_neighborhood=p_nbhd,
-                               granted_to_project=project)
+    M.AwardGrant(award=award, granted_by_neighborhood=p_nbhd,
+            granted_to_project=project)
 
     ThreadLocalORMSession.flush_all()
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/test_helpers.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_helpers.py b/Allura/allura/tests/test_helpers.py
index 259ecba..48f4309 100644
--- a/Allura/allura/tests/test_helpers.py
+++ b/Allura/allura/tests/test_helpers.py
@@ -19,10 +19,10 @@
 
 from unittest import TestCase
 from os import path
-from datetime import datetime
+from datetime import datetime, timedelta
+import time
 
 from mock import Mock, patch
-import tg
 from pylons import tmpl_context as c
 from nose.tools import eq_, assert_equals
 from IPython.testing.decorators import skipif, module_not_available
@@ -187,8 +187,6 @@ def test_encode_keys():
 
 
 def test_ago():
-    from datetime import datetime, timedelta
-    import time
     assert_equals(h.ago(datetime.utcnow() - timedelta(days=2)), '2 days ago')
     assert_equals(h.ago_ts(time.time() - 60 * 60 * 2), '2 hours ago')
     d_str = (datetime.utcnow() - timedelta(hours=3)).isoformat()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/test_mail_util.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_mail_util.py b/Allura/allura/tests/test_mail_util.py
index 8473cec..0ae42a0 100644
--- a/Allura/allura/tests/test_mail_util.py
+++ b/Allura/allura/tests/test_mail_util.py
@@ -20,7 +20,6 @@
 import unittest
 from email.MIMEMultipart import MIMEMultipart
 from email.MIMEText import MIMEText
-from email import header
 
 import mock
 from nose.tools import raises, assert_equal, assert_false, assert_true

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/test_plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_plugin.py b/Allura/allura/tests/test_plugin.py
index 1c00f61..24a163a 100644
--- a/Allura/allura/tests/test_plugin.py
+++ b/Allura/allura/tests/test_plugin.py
@@ -15,10 +15,8 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from functools import partial
 from nose.tools import assert_equals, assert_raises, assert_is_none, assert_is
 from mock import Mock, MagicMock, patch
-from formencode import Invalid
 from datetime import timedelta
 
 from allura import model as M

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/test_security.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_security.py b/Allura/allura/tests/test_security.py
index 1445e91..44b2831 100644
--- a/Allura/allura/tests/test_security.py
+++ b/Allura/allura/tests/test_security.py
@@ -79,7 +79,6 @@ class TestSecurity(TestController):
     @td.with_wiki
     def test_all_allowed(self):
         wiki = c.project.app_instance('wiki')
-        page = WM.Page.query.get(app_config_id=wiki.config._id)
         admin_role = M.ProjectRole.by_name('Admin')
         dev_role = M.ProjectRole.by_name('Developer')
         member_role = M.ProjectRole.by_name('Member')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/test_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_tasks.py b/Allura/allura/tests/test_tasks.py
index 101ed8a..e948276 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -17,7 +17,6 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import os
 import operator
 import shutil
 import sys
@@ -33,7 +32,6 @@ from nose.tools import assert_in
 from ming.orm import FieldProperty, Mapper
 from ming.orm import ThreadLocalORMSession
 from testfixtures import LogCapture
-from IPython.testing.decorators import onlyif
 
 from alluratest.controller import setup_basic_test, setup_global_objects
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/test_utils.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_utils.py b/Allura/allura/tests/test_utils.py
index 4812cb7..232763a 100644
--- a/Allura/allura/tests/test_utils.py
+++ b/Allura/allura/tests/test_utils.py
@@ -58,10 +58,9 @@ class TestConfigProxy(unittest.TestCase):
 class TestChunkedIterator(unittest.TestCase):
 
     def setUp(self):
-        from allura import model as M
         setup_unit_test()
         for i in range(10):
-            p = M.User.upsert('sample-user-%d' % i)
+            M.User.upsert('sample-user-%d' % i)
 
     def test_can_iterate(self):
         chunks = list(utils.chunked_find(M.User, {}, 2))

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/tscript.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/tscript.py b/Allura/allura/tests/tscript.py
index 77e45a8..6691331 100644
--- a/Allura/allura/tests/tscript.py
+++ b/Allura/allura/tests/tscript.py
@@ -15,14 +15,9 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import sys
 import logging
 
-from tg import config
-from pylons import tmpl_context as c
-
 from allura import model as M
-from allura.lib import helpers as h
 
 log = logging.getLogger(__name__)
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/unit/test_app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_app.py b/Allura/allura/tests/unit/test_app.py
index adbfc40..e429407 100644
--- a/Allura/allura/tests/unit/test_app.py
+++ b/Allura/allura/tests/unit/test_app.py
@@ -15,7 +15,6 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import re
 from unittest import TestCase
 
 from allura.app import Application

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/unit/test_helpers/test_set_context.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_helpers/test_set_context.py b/Allura/allura/tests/unit/test_helpers/test_set_context.py
index 7784f74..8b56a0f 100644
--- a/Allura/allura/tests/unit/test_helpers/test_set_context.py
+++ b/Allura/allura/tests/unit/test_helpers/test_set_context.py
@@ -26,7 +26,6 @@ from allura.tests.unit import patches
 from allura.tests.unit.factories import (create_project,
                                          create_app_config,
                                          create_neighborhood)
-from allura.model.project import Neighborhood
 
 
 class TestWhenProjectIsFoundAndAppIsNot(WithDatabase):
@@ -102,7 +101,7 @@ class TestWhenProjectIsNotFound(WithDatabase):
                       neighborhood=nbhd)
 
     def test_proper_exception_when_id_lookup(self):
-        nbhd = create_neighborhood()
+        create_neighborhood()
         assert_raises(NoSuchProjectError,
                       set_context,
                       ObjectId(),

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/unit/test_package_path_loader.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/unit/test_package_path_loader.py b/Allura/allura/tests/unit/test_package_path_loader.py
index 61bd887..c0c1519 100644
--- a/Allura/allura/tests/unit/test_package_path_loader.py
+++ b/Allura/allura/tests/unit/test_package_path_loader.py
@@ -16,10 +16,9 @@
 #       under the License.
 
 from unittest import TestCase
-from collections import defaultdict
 
 import jinja2
-from nose.tools import assert_equal, assert_in, assert_raises
+from nose.tools import assert_equal, assert_raises
 import mock
 
 from allura.lib.package_path_loader import PackagePathLoader

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/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 567b6cc..eef8656 100644
--- a/Allura/allura/tests/unit/test_repo.py
+++ b/Allura/allura/tests/unit/test_repo.py
@@ -17,7 +17,7 @@
 
 import datetime
 import unittest
-from mock import patch, Mock, MagicMock, call
+from mock import patch, Mock, MagicMock
 from nose.tools import assert_equal
 
 from pylons import tmpl_context as c

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/websetup/bootstrap.py
----------------------------------------------------------------------
diff --git a/Allura/allura/websetup/bootstrap.py b/Allura/allura/websetup/bootstrap.py
index 252bfc9..abe8234 100644
--- a/Allura/allura/websetup/bootstrap.py
+++ b/Allura/allura/websetup/bootstrap.py
@@ -37,7 +37,6 @@ import allura
 from allura.lib import plugin
 from allura.lib import helpers as h
 from allura import model as M
-from allura.websetup import schema
 from allura.command import EnsureIndexCommand
 from allura.command import CreateTroveCategoriesCommand
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/docs/conf.py
----------------------------------------------------------------------
diff --git a/Allura/docs/conf.py b/Allura/docs/conf.py
index 9b8e40a..38e6c65 100644
--- a/Allura/docs/conf.py
+++ b/Allura/docs/conf.py
@@ -28,9 +28,6 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys
-import os
-
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/AlluraTest/alluratest/controller.py
----------------------------------------------------------------------
diff --git a/AlluraTest/alluratest/controller.py b/AlluraTest/alluratest/controller.py
index ca75ae5..8386d0b 100644
--- a/AlluraTest/alluratest/controller.py
+++ b/AlluraTest/alluratest/controller.py
@@ -26,10 +26,9 @@ from paste.deploy import loadapp
 from paste.deploy.converters import asbool
 from paste.script.appinstall import SetupCommand
 from pylons import tmpl_context as c, app_globals as g
-from pylons import url, request, response, session
+from pylons import url, response, session
 import tg
-from webtest import TestApp
-from webob import Request, Response
+from webob import Response
 import ew
 from ming.orm import ThreadLocalORMSession
 import ming.orm

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/AlluraTest/alluratest/test_syntax.py
----------------------------------------------------------------------
diff --git a/AlluraTest/alluratest/test_syntax.py b/AlluraTest/alluratest/test_syntax.py
index a4c03ee..c782aac 100644
--- a/AlluraTest/alluratest/test_syntax.py
+++ b/AlluraTest/alluratest/test_syntax.py
@@ -16,7 +16,6 @@
 #       under the License.
 
 import os.path
-from glob import glob
 from subprocess import Popen, PIPE
 import sys
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/AlluraTest/alluratest/validation.py
----------------------------------------------------------------------
diff --git a/AlluraTest/alluratest/validation.py b/AlluraTest/alluratest/validation.py
index 6742594..4af5012 100644
--- a/AlluraTest/alluratest/validation.py
+++ b/AlluraTest/alluratest/validation.py
@@ -20,7 +20,7 @@
 """
 Functions to syntax-validate output content
 """
-from os import path, environ, getcwd
+from os import path
 import os
 import sys
 import logging
@@ -30,17 +30,9 @@ import json
 import urllib2
 import re
 
-import tg
-import mock
-import beaker.session
-from paste.deploy import loadapp
-from paste.script.appinstall import SetupCommand
-from pylons import tmpl_context as c, app_globals as g
-from pylons import url, request, response, session
 import webtest
 from webtest import TestApp
-from webob import Request, Response
-from nose.tools import ok_, assert_true, assert_false
+from nose.tools import ok_
 from poster.encode import multipart_encode
 from poster.streaminghttp import register_openers
 from ming.utils import LazyProperty

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/AlluraTest/setup.py
----------------------------------------------------------------------
diff --git a/AlluraTest/setup.py b/AlluraTest/setup.py
index 9958a75..5a03015 100644
--- a/AlluraTest/setup.py
+++ b/AlluraTest/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 setup(name='AlluraTest',
       version='0.1',

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeActivity/forgeactivity/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeActivity/forgeactivity/tests/functional/test_root.py b/ForgeActivity/forgeactivity/tests/functional/test_root.py
index cafdfe4..c308112 100644
--- a/ForgeActivity/forgeactivity/tests/functional/test_root.py
+++ b/ForgeActivity/forgeactivity/tests/functional/test_root.py
@@ -45,7 +45,7 @@ class TestActivityController(TestController):
 
     def test_index_disabled(self):
         config['activitystream.enabled'] = 'false'
-        resp = self.app.get('/activity/', status=404)
+        self.app.get('/activity/', status=404)
 
     def test_index_override(self):
         config['activitystream.enabled'] = 'false'
@@ -130,7 +130,7 @@ class TestActivityController(TestController):
     @td.with_user_project('test-admin')
     @patch('forgeactivity.main.g.director')
     def test_viewing_own_user_project(self, director):
-        resp = self.app.get('/u/test-admin/activity/')
+        self.app.get('/u/test-admin/activity/')
         assert director.get_timeline.call_count == 1
         assert director.get_timeline.call_args[0][0].username == 'test-admin'
         assert director.get_timeline.call_args[1]['actor_only'] == False
@@ -139,7 +139,7 @@ class TestActivityController(TestController):
     @td.with_user_project('test-user-1')
     @patch('forgeactivity.main.g.director')
     def test_viewing_other_user_project(self, director):
-        resp = self.app.get('/u/test-user-1/activity/')
+        self.app.get('/u/test-user-1/activity/')
         assert director.get_timeline.call_count == 1
         assert director.get_timeline.call_args[0][0].username == 'test-user-1'
         assert director.get_timeline.call_args[1]['actor_only'] == True
@@ -147,7 +147,7 @@ class TestActivityController(TestController):
     @td.with_tool('test', 'activity')
     @patch('forgeactivity.main.g.director')
     def test_viewing_project_activity(self, director):
-        resp = self.app.get('/p/test/activity/')
+        self.app.get('/p/test/activity/')
         assert director.get_timeline.call_count == 1
         assert director.get_timeline.call_args[0][0].shortname == 'test'
         assert director.get_timeline.call_args[1]['actor_only'] == False

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeBlog/forgeblog/command/rssfeeds.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/command/rssfeeds.py b/ForgeBlog/forgeblog/command/rssfeeds.py
index ce02487..7771a5c 100644
--- a/ForgeBlog/forgeblog/command/rssfeeds.py
+++ b/ForgeBlog/forgeblog/command/rssfeeds.py
@@ -17,7 +17,6 @@
 
 import calendar
 from datetime import datetime
-import re
 
 import feedparser
 from bson import ObjectId
@@ -30,7 +29,6 @@ from pylons import tmpl_context as c
 
 from allura import model as M
 from forgeblog import model as BM
-from forgeblog import version
 from forgeblog.main import ForgeBlogApp
 from allura.lib import exceptions
 from allura.lib.helpers import exceptionless

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeBlog/forgeblog/main.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/main.py b/ForgeBlog/forgeblog/main.py
index 1bb4ced..9e70769 100644
--- a/ForgeBlog/forgeblog/main.py
+++ b/ForgeBlog/forgeblog/main.py
@@ -17,7 +17,6 @@
 
 #-*- python -*-
 import logging
-from datetime import datetime
 import urllib2
 import json
 
@@ -25,13 +24,12 @@ import json
 import pymongo
 from tg import config, expose, validate, redirect, flash, jsonify
 from tg.decorators import with_trailing_slash, without_trailing_slash
-from pylons import tmpl_context as c, app_globals as g
-from pylons import request, response
+from pylons import tmpl_context as c
+from pylons import request
 from paste.deploy.converters import asbool
 import formencode
 from formencode import validators
 from webob import exc
-from urllib import unquote
 
 from ming.orm import session
 
@@ -157,7 +155,6 @@ class ForgeBlogApp(Application):
         return links
 
     def admin_menu(self):
-        import sys
         admin_url = c.project.url() + 'admin/' + \
             self.config.options.mount_point + '/'
         # temporarily disabled until some bugs are fixed
@@ -256,7 +253,6 @@ class RootController(BaseController, FeedController):
     @without_trailing_slash
     def new(self, **kw):
         require_access(c.app, 'write')
-        now = datetime.utcnow()
         post = dict(
             state='published')
         c.form = W.new_post_form

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeBlog/forgeblog/tests/test_commands.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/forgeblog/tests/test_commands.py b/ForgeBlog/forgeblog/tests/test_commands.py
index a086519..7f2d0f7 100644
--- a/ForgeBlog/forgeblog/tests/test_commands.py
+++ b/ForgeBlog/forgeblog/tests/test_commands.py
@@ -16,7 +16,7 @@
 #       under the License.
 
 from datetime import datetime, timedelta
-from pylons import tmpl_context as c, app_globals as g
+from pylons import app_globals as g
 from datadiff.tools import assert_equal
 from IPython.testing.decorators import module_not_available, skipif
 import pkg_resources

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeBlog/setup.py
----------------------------------------------------------------------
diff --git a/ForgeBlog/setup.py b/ForgeBlog/setup.py
index 40befd6..7eda917 100644
--- a/ForgeBlog/setup.py
+++ b/ForgeBlog/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 from forgeblog.version import __version__
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeChat/forgechat/command.py
----------------------------------------------------------------------
diff --git a/ForgeChat/forgechat/command.py b/ForgeChat/forgechat/command.py
index e667843..16f730f 100644
--- a/ForgeChat/forgechat/command.py
+++ b/ForgeChat/forgechat/command.py
@@ -28,7 +28,7 @@ import tg
 from paste.script import command
 from paste.deploy.converters import asint
 
-from ming.orm import session, ThreadLocalORMSession
+from ming.orm import ThreadLocalORMSession
 
 import allura
 from allura.command import base

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeChat/forgechat/main.py
----------------------------------------------------------------------
diff --git a/ForgeChat/forgechat/main.py b/ForgeChat/forgechat/main.py
index c579ea5..39a6807 100644
--- a/ForgeChat/forgechat/main.py
+++ b/ForgeChat/forgechat/main.py
@@ -24,7 +24,7 @@ from datetime import date, time, datetime, timedelta
 # Non-stdlib imports
 from tg import expose, validate, redirect, flash
 from tg.decorators import with_trailing_slash
-from pylons import tmpl_context as c, app_globals as g
+from pylons import tmpl_context as c
 from formencode import validators
 
 # Pyforge-specific imports

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeChat/setup.py
----------------------------------------------------------------------
diff --git a/ForgeChat/setup.py b/ForgeChat/setup.py
index 6cb2c59..242841b 100644
--- a/ForgeChat/setup.py
+++ b/ForgeChat/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 from forgechat.version import __version__
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeDiscussion/forgediscussion/controllers/root.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/root.py b/ForgeDiscussion/forgediscussion/controllers/root.py
index 82f4187..b315dca 100644
--- a/ForgeDiscussion/forgediscussion/controllers/root.py
+++ b/ForgeDiscussion/forgediscussion/controllers/root.py
@@ -23,7 +23,7 @@ import calendar
 from collections import OrderedDict
 
 
-from tg import expose, validate, redirect, flash, response, jsonify
+from tg import expose, validate, redirect, flash
 from tg.decorators import with_trailing_slash, without_trailing_slash
 from pylons import tmpl_context as c, app_globals as g
 from pylons import request
@@ -131,7 +131,7 @@ class RootController(BaseController, DispatchIndex, FeedController):
         require_access(discussion, 'post')
         thd = discussion.get_discussion_thread(dict(
             headers=dict(Subject=subject)))[0]
-        post = thd.post(subject, text)
+        thd.post(subject, text)
         flash('Message posted')
         redirect(thd.url())
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeDiscussion/forgediscussion/forum_main.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/forum_main.py b/ForgeDiscussion/forgediscussion/forum_main.py
index b9f033c..d179a29 100644
--- a/ForgeDiscussion/forgediscussion/forum_main.py
+++ b/ForgeDiscussion/forgediscussion/forum_main.py
@@ -18,14 +18,12 @@
 #-*- python -*-
 import logging
 import urllib
-from itertools import islice
 import json
 
 # Non-stdlib imports
-import pymongo
 from pylons import tmpl_context as c, app_globals as g
 from pylons import request
-from tg import expose, redirect, flash, url, validate, jsonify
+from tg import expose, redirect, flash, validate, jsonify
 from tg.decorators import with_trailing_slash
 from bson import ObjectId
 from ming import schema

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
index e3b5682..e23f38a 100644
--- a/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_forum.py
@@ -25,9 +25,8 @@ from email.mime.image import MIMEImage
 from email.mime.multipart import MIMEMultipart
 
 import pkg_resources
-from pylons import tmpl_context as c, app_globals as g
+from pylons import tmpl_context as c
 from nose.tools import assert_equal, assert_in
-from ming.orm import ThreadLocalORMSession
 
 from allura import model as M
 from allura.tasks import mail_tasks
@@ -317,27 +316,26 @@ class TestForum(TestController):
         assert_equal(len(r.html.findAll('a', rel='nofollow')), 1)
 
     def test_forum_search(self):
-        r = self.app.get('/discussion/search')
-        r = self.app.get('/discussion/search', params=dict(q='foo'))
+        self.app.get('/discussion/search')
+        self.app.get('/discussion/search', params=dict(q='foo'))
 
     def test_render_markdown_syntax(self):
-        summary = 'test render markdown syntax'
         r = self.app.get('/discussion/markdown_syntax')
         assert 'Markdown Syntax' in r
 
     def test_forum_subscribe(self):
-        r = self.app.post('/discussion/subscribe', params={
+        self.app.post('/discussion/subscribe', params={
             'forum-0.shortname': 'testforum',
             'forum-0.subscribed': 'on',
         })
-        r = self.app.post('/discussion/subscribe', params={
+        self.app.post('/discussion/subscribe', params={
             'forum-0.shortname': 'testforum',
             'forum-0.subscribed': '',
         })
 
     def test_forum_index(self):
-        r = self.app.get('/discussion/testforum/')
-        r = self.app.get('/discussion/testforum/childforum/')
+        self.app.get('/discussion/testforum/')
+        self.app.get('/discussion/testforum/childforum/')
 
     def test_threads_with_zero_posts(self):
         # Make sure that threads with zero posts (b/c all posts have been
@@ -587,7 +585,6 @@ class TestForum(TestController):
                     'value') and field['value'] or ''
         self.app.post(str(subscribe_url), params=params)
         self.app.get('/discussion/general/subscribe_to_forum?subscribe=True')
-        url = thread.request.url
         f = thread.html.find(
             'div', {'class': 'row reply_post_form'}).find('form')
         rep_url = f.get('action')
@@ -598,7 +595,7 @@ class TestForum(TestController):
                 params[field['name']] = field.has_key(
                     'value') and field['value'] or ''
         params[f.find('textarea')['name']] = 'Reply 2'
-        thread_reply = self.app.post(str(rep_url), params=params)
+        self.app.post(str(rep_url), params=params)
         assert M.Notification.query.find(
             dict(subject='[test:discussion] Re: Post subject')).count() == 1
 
@@ -630,7 +627,6 @@ class TestForum(TestController):
         r = self.app.post('/discussion/save_new_topic', params=params).follow()
         url = r.request.url
         thread_id = url.rstrip('/').rsplit('/', 1)[-1]
-        thread = FM.ForumThread.query.get(_id=thread_id)
         r = self.app.post(url + 'moderate', params=dict(
             flags='Announcement',
             discussion='testforum'))
@@ -676,8 +672,6 @@ class TestForum(TestController):
         params[f.find('select')['name']] = 'testforum'
         params[f.find('input', {'style': 'width: 90%'})['name']] = 'topic2'
         r = self.app.post('/discussion/save_new_topic', params=params).follow()
-        url2 = r.request.url
-        tid2 = url2.rstrip('/').rsplit('/', 1)[-1]
 
         # Check that threads are ordered in reverse creation order
         r = self.app.get('/discussion/testforum/')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeDiscussion/forgediscussion/tests/functional/test_import.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/tests/functional/test_import.py b/ForgeDiscussion/forgediscussion/tests/functional/test_import.py
index b641b2d..deeb349 100644
--- a/ForgeDiscussion/forgediscussion/tests/functional/test_import.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_import.py
@@ -21,10 +21,10 @@ from datetime import datetime, timedelta
 from nose.tools import assert_equal
 
 import ming
-from pylons import tmpl_context as c, app_globals as g
+from pylons import tmpl_context as c
 
 from allura import model as M
-from alluratest.controller import TestController, TestRestApiBase
+from alluratest.controller import TestRestApiBase
 
 
 class TestImportController(TestRestApiBase):  # TestController):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeDiscussion/forgediscussion/widgets/admin.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/widgets/admin.py b/ForgeDiscussion/forgediscussion/widgets/admin.py
index bb954b1..cf2ff8f 100644
--- a/ForgeDiscussion/forgediscussion/widgets/admin.py
+++ b/ForgeDiscussion/forgediscussion/widgets/admin.py
@@ -15,13 +15,11 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from pylons import tmpl_context as c
 from formencode import validators as fev
 from formencode import All
 import formencode
 from bson import ObjectId
 
-import ew as ew_core
 import ew.jinja2_ew as ew
 
 from allura.lib.widgets import forms as ff

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeDiscussion/setup.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/setup.py b/ForgeDiscussion/setup.py
index c978edd..165ce4b 100644
--- a/ForgeDiscussion/setup.py
+++ b/ForgeDiscussion/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 from forgediscussion.version import __version__
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeGit/forgegit/git_main.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/git_main.py b/ForgeGit/forgegit/git_main.py
index fda6914..5a7dfd4 100644
--- a/ForgeGit/forgegit/git_main.py
+++ b/ForgeGit/forgegit/git_main.py
@@ -28,8 +28,6 @@ import git
 
 # Pyforge-specific imports
 import allura.tasks.repo_tasks
-from allura.lib import helpers as h
-from allura import model as M
 from allura.controllers.repository import RepoRootController, RefsController, CommitsController
 from allura.controllers.repository import MergeRequestsController, RepoRestController
 from allura.lib.repository import RepositoryApp
@@ -89,7 +87,7 @@ class ForgeGitApp(RepositoryApp):
     def install(self, project):
         '''Create repo object for this tool'''
         super(ForgeGitApp, self).install(project)
-        repo = GM.Repository(
+        GM.Repository(
             name=self.config.options.mount_point + '.git',
             tool='git',
             status='initializing',

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index e5dce43..09fca39 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -16,17 +16,10 @@
 #       under the License.
 
 import os
-import sys
 import shutil
 import string
 import logging
-import random
-import itertools
-from collections import namedtuple
 from datetime import datetime
-from glob import glob
-import gzip
-from time import time
 
 import tg
 import git
@@ -34,14 +27,13 @@ import gitdb
 from pylons import app_globals as g
 from pylons import tmpl_context as c
 from pymongo.errors import DuplicateKeyError
-from paste.deploy.converters import asbool, asint
+from paste.deploy.converters import asbool
 
 from ming.base import Object
-from ming.orm import Mapper, session, mapper
+from ming.orm import Mapper, session
 from ming.utils import LazyProperty
 
 from allura.lib import helpers as h
-from allura.lib import utils
 from allura.model.repository import topological_sort, prefix_paths_union
 from allura import model as M
 
@@ -489,7 +481,7 @@ class GitImplementation(M.RepositoryImplementation):
         try:
             node = ci.tree / path
             return node.type == 'blob'
-        except KeyError as e:
+        except KeyError:
             return False
 
     @LazyProperty

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeGit/forgegit/tests/functional/test_auth.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_auth.py b/ForgeGit/forgegit/tests/functional/test_auth.py
index 93a1af0..1a230d4 100644
--- a/ForgeGit/forgegit/tests/functional/test_auth.py
+++ b/ForgeGit/forgegit/tests/functional/test_auth.py
@@ -31,7 +31,7 @@ class TestGitUserPermissions(TestController):
     disallow = dict(allow_read=False, allow_write=False, allow_create=False)
 
     def test_unknown_project(self):
-        r = self._check_repo('/git/foo/bar', status=404)
+        self._check_repo('/git/foo/bar', status=404)
 
     def test_unknown_app(self):
         r = self._check_repo('/git/test/bar')
@@ -64,7 +64,7 @@ class TestGitUserPermissions(TestController):
         assert r == self.read, r
 
     def test_unknown_user(self):
-        r = self._check_repo(
+        self._check_repo(
             '/git/test.p/src-git.git',
             username='test-usera',
             status=404)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index 68d117e..5fd0805 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -26,7 +26,6 @@ import tg
 import pkg_resources
 from pylons import tmpl_context as c
 from ming.orm import ThreadLocalORMSession
-from datadiff.tools import assert_equal
 
 from allura import model as M
 from allura.lib import helpers as h
@@ -101,7 +100,7 @@ class TestRootController(_TestCase):
         self.app.get('/git/')
 
     def test_commit_browser(self):
-        resp = self.app.get('/src-git/commit_browser')
+        self.app.get('/src-git/commit_browser')
 
     def test_commit_browser_data(self):
         resp = self.app.get('/src-git/commit_browser_data')
@@ -158,7 +157,7 @@ class TestRootController(_TestCase):
         assert 'url_commit="/p/test/src-git/ci/1e146e67985dcd71c74de79613719bef7bddca4a/">' not in r
 
     def test_tags(self):
-        resp = self.app.get('/src-git/ref/master~/tags/')
+        self.app.get('/src-git/ref/master~/tags/')
 
     def _get_ci(self):
         r = self.app.get('/src-git/ref/master/')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeGit/forgegit/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/model/test_repository.py b/ForgeGit/forgegit/tests/model/test_repository.py
index eb68a1b..215ba0b 100644
--- a/ForgeGit/forgegit/tests/model/test_repository.py
+++ b/ForgeGit/forgegit/tests/model/test_repository.py
@@ -24,8 +24,6 @@ import unittest
 import pkg_resources
 import datetime
 
-import pymongo
-
 import mock
 from pylons import tmpl_context as c, app_globals as g
 import tg

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeGit/setup.py
----------------------------------------------------------------------
diff --git a/ForgeGit/setup.py b/ForgeGit/setup.py
index ee01f0b..e91068b 100644
--- a/ForgeGit/setup.py
+++ b/ForgeGit/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 from forgegit.version import __version__
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/docs/conf.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/docs/conf.py b/ForgeImporters/docs/conf.py
index b19661b..ea18df2 100644
--- a/ForgeImporters/docs/conf.py
+++ b/ForgeImporters/docs/conf.py
@@ -28,9 +28,6 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys
-import os
-
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/forge/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/forge/tracker.py b/ForgeImporters/forgeimporters/forge/tracker.py
index c06db73..5407743 100644
--- a/ForgeImporters/forgeimporters/forge/tracker.py
+++ b/ForgeImporters/forgeimporters/forge/tracker.py
@@ -183,7 +183,7 @@ class ForgeTrackerImporter(ToolImporter):
             app.globals.invalidate_bin_counts()
             ThreadLocalORMSession.flush_all()
             return app
-        except Exception as e:
+        except Exception:
             h.make_app_admin_only(app)
             raise
         finally:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/github/code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/code.py b/ForgeImporters/forgeimporters/github/code.py
index 83095ff..ede36b4 100644
--- a/ForgeImporters/forgeimporters/github/code.py
+++ b/ForgeImporters/forgeimporters/github/code.py
@@ -30,7 +30,6 @@ from tg.decorators import (
 )
 
 from allura.lib.decorators import require_post
-from allura.lib import helpers as h
 from allura.controllers import BaseController
 from allura import model as M
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/github/project.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/project.py b/ForgeImporters/forgeimporters/github/project.py
index 9c8e549..fc7247b 100644
--- a/ForgeImporters/forgeimporters/github/project.py
+++ b/ForgeImporters/forgeimporters/github/project.py
@@ -23,7 +23,6 @@ from tg import expose, validate
 from tg.decorators import with_trailing_slash
 
 from allura.lib.decorators import require_post
-from allura.lib import helpers as h
 
 from .. import base
 from . import tasks

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/github/tests/test_code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tests/test_code.py b/ForgeImporters/forgeimporters/github/tests/test_code.py
index 8a6f95b..8fa6a2f 100644
--- a/ForgeImporters/forgeimporters/github/tests/test_code.py
+++ b/ForgeImporters/forgeimporters/github/tests/test_code.py
@@ -119,6 +119,6 @@ class TestGitHubImportController(TestController, TestCase):
     @with_git
     @patch.object(GitHubOAuthMixin, 'oauth_begin')
     def test_oauth(self, oauth_begin):
-        r = self.app.get(
+        self.app.get(
             '/p/{}/admin/ext/import/github-repo/'.format(test_project_with_repo))
         oauth_begin.assert_called_once()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/github/tests/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tests/test_tracker.py b/ForgeImporters/forgeimporters/github/tests/test_tracker.py
index c494453..72e1148 100644
--- a/ForgeImporters/forgeimporters/github/tests/test_tracker.py
+++ b/ForgeImporters/forgeimporters/github/tests/test_tracker.py
@@ -81,5 +81,5 @@ class TestGitHubTrackerImportController(TestController, TestCase):
     @with_tracker
     @patch.object(GitHubOAuthMixin, 'oauth_begin')
     def test_oauth(self, oauth_begin):
-        r = self.app.get(self.url)
+        self.app.get(self.url)
         oauth_begin.assert_called_once()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/github/tests/test_wiki.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tests/test_wiki.py b/ForgeImporters/forgeimporters/github/tests/test_wiki.py
index 29e9757..1eb996a 100644
--- a/ForgeImporters/forgeimporters/github/tests/test_wiki.py
+++ b/ForgeImporters/forgeimporters/github/tests/test_wiki.py
@@ -18,7 +18,7 @@
 #       under the License.
 
 from unittest import TestCase
-from nose.tools import assert_equal, assert_not_in
+from nose.tools import assert_equal
 from mock import Mock, patch, call
 from ming.odm import ThreadLocalORMSession
 
@@ -589,5 +589,5 @@ class TestGitHubWikiImportController(TestController, TestCase):
     @with_wiki
     @patch.object(GitHubOAuthMixin, 'oauth_begin')
     def test_oauth(self, oauth_begin):
-        r = self.app.get(self.url)
+        self.app.get(self.url)
         oauth_begin.assert_called_once()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/github/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/wiki.py b/ForgeImporters/forgeimporters/github/wiki.py
index 74789d2..9c00048 100644
--- a/ForgeImporters/forgeimporters/github/wiki.py
+++ b/ForgeImporters/forgeimporters/github/wiki.py
@@ -178,7 +178,7 @@ class GitHubWikiImporter(ToolImporter):
                 url=self.app.url)
             g.post_event('project_updated')
             return self.app
-        except Exception as e:
+        except Exception:
             h.make_app_admin_only(self.app)
             raise
         finally:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/google/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/__init__.py b/ForgeImporters/forgeimporters/google/__init__.py
index e2ff4df..57ff4d1 100644
--- a/ForgeImporters/forgeimporters/google/__init__.py
+++ b/ForgeImporters/forgeimporters/google/__init__.py
@@ -20,10 +20,8 @@ import urllib
 from urllib2 import HTTPError
 from urlparse import urlparse, urljoin, parse_qs
 from collections import defaultdict
-from contextlib import closing
 import logging
 import os
-import re
 
 from BeautifulSoup import BeautifulSoup
 from formencode import validators as fev

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/google/project.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/project.py b/ForgeImporters/forgeimporters/google/project.py
index bb74c80..9ffade1 100644
--- a/ForgeImporters/forgeimporters/google/project.py
+++ b/ForgeImporters/forgeimporters/google/project.py
@@ -17,8 +17,6 @@
 
 import logging
 
-from formencode import validators as fev
-
 from tg import expose, validate
 from tg.decorators import with_trailing_slash
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/google/tests/test_code.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tests/test_code.py b/ForgeImporters/forgeimporters/google/tests/test_code.py
index e8f6e35..00c5328 100644
--- a/ForgeImporters/forgeimporters/google/tests/test_code.py
+++ b/ForgeImporters/forgeimporters/google/tests/test_code.py
@@ -16,11 +16,10 @@
 #       under the License.
 
 from unittest import TestCase
-from mock import Mock, patch, MagicMock
+from mock import Mock, patch
 from ming.odm import ThreadLocalORMSession
 
 from allura.tests import TestController
-from allura.tests.decorators import with_tool
 from allura import model as M
 
 
@@ -32,7 +31,6 @@ test_project_with_repo = 'test2'
 from forgeimporters.google.code import (
     get_repo_url,
     GoogleRepoImporter,
-    GoogleRepoImportController,
 )
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
index ab131a8..b3abc10 100644
--- a/ForgeImporters/forgeimporters/google/tracker.py
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -16,9 +16,6 @@
 #       under the License.
 
 from collections import defaultdict
-from datetime import datetime
-
-from formencode import validators as fev
 
 from pylons import tmpl_context as c
 from pylons import app_globals as g
@@ -152,7 +149,7 @@ class GoogleCodeTrackerImporter(ToolImporter):
             g.post_event('project_updated')
             app.globals.invalidate_bin_counts()
             return app
-        except Exception as e:
+        except Exception:
             h.make_app_admin_only(app)
             raise
         finally:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
index e689971..96d789d 100644
--- a/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/google/functional/test_tracker.py
@@ -17,12 +17,10 @@
 
 from unittest import TestCase
 import pkg_resources
-from functools import wraps
 from datetime import datetime
 
 from BeautifulSoup import BeautifulSoup
 import mock
-from ming.orm import ThreadLocalORMSession
 from pylons import tmpl_context as c
 from IPython.testing.decorators import module_not_available, skipif
 from datadiff.tools import assert_equal
@@ -30,11 +28,9 @@ from datadiff.tools import assert_equal
 from alluratest.controller import setup_basic_test
 from allura.tests.decorators import without_module
 from allura import model as M
-from allura.lib import helpers as h
 from forgetracker import model as TM
 from forgeimporters import base
 from forgeimporters import google
-from forgeimporters.google import tracker
 
 
 class TestGCTrackerImporter(TestCase):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/tests/google/test_extractor.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_extractor.py b/ForgeImporters/forgeimporters/tests/google/test_extractor.py
index 3635ac5..1eab6f6 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_extractor.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_extractor.py
@@ -139,7 +139,6 @@ class TestGoogleCodeProjectExtractor(TestCase):
             fullname='Other/Proprietary License')
 
     def _make_extractor(self, html):
-        from BeautifulSoup import BeautifulSoup
         with mock.patch.object(base.ProjectExtractor, 'urlopen'):
             extractor = google.GoogleCodeProjectExtractor(
                 'allura-google-importer')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/tests/test_base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/test_base.py b/ForgeImporters/forgeimporters/tests/test_base.py
index 91d9dff..2156471 100644
--- a/ForgeImporters/forgeimporters/tests/test_base.py
+++ b/ForgeImporters/forgeimporters/tests/test_base.py
@@ -21,7 +21,7 @@ import errno
 from formencode import Invalid
 import mock
 from tg import expose, config
-from nose.tools import assert_equal, assert_raises, assert_in, assert_not_in
+from nose.tools import assert_equal, assert_raises
 from webob.exc import HTTPUnauthorized
 
 from alluratest.controller import TestController

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
index 7ddb729..e9366f2 100644
--- a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
@@ -17,10 +17,9 @@
 
 import json
 import os
-from datetime import datetime
 
 from unittest import TestCase
-from mock import Mock, patch, MagicMock
+from mock import Mock, patch
 from ming.orm import ThreadLocalORMSession
 from pylons import tmpl_context as c
 from IPython.testing.decorators import module_not_available, skipif

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeLink/forgelink/link_main.py
----------------------------------------------------------------------
diff --git a/ForgeLink/forgelink/link_main.py b/ForgeLink/forgelink/link_main.py
index 0f2292a..bb55a3e 100644
--- a/ForgeLink/forgelink/link_main.py
+++ b/ForgeLink/forgelink/link_main.py
@@ -20,9 +20,8 @@ import logging
 import json
 
 # Non-stdlib imports
-import pkg_resources
-from tg import expose, validate, redirect, response, flash, jsonify
-from pylons import tmpl_context as c, app_globals as g
+from tg import expose, redirect, flash, jsonify
+from pylons import tmpl_context as c
 from pylons import request
 
 # Pyforge-specific imports

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeLink/setup.py
----------------------------------------------------------------------
diff --git a/ForgeLink/setup.py b/ForgeLink/setup.py
index 711d2c1..fc91792 100644
--- a/ForgeLink/setup.py
+++ b/ForgeLink/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 from forgelink.version import __version__
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeSVN/forgesvn/controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/controllers.py b/ForgeSVN/forgesvn/controllers.py
index f4461f0..35af8e7 100644
--- a/ForgeSVN/forgesvn/controllers.py
+++ b/ForgeSVN/forgesvn/controllers.py
@@ -20,7 +20,7 @@ from tg.decorators import with_trailing_slash
 from pylons import tmpl_context as c
 
 from allura.controllers import repository
-from allura.controllers.feed import FeedController, FeedArgs
+from allura.controllers.feed import FeedController
 
 
 class BranchBrowser(repository.BranchBrowser, FeedController):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 9823f1e..6aa5499 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -15,7 +15,6 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import sys
 import re
 import os
 import shutil
@@ -36,7 +35,7 @@ from pymongo.errors import DuplicateKeyError
 from pylons import tmpl_context as c, app_globals as g
 
 from ming.base import Object
-from ming.orm import Mapper, FieldProperty, session
+from ming.orm import Mapper, FieldProperty
 from ming.utils import LazyProperty
 
 from allura import model as M

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeSVN/forgesvn/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/functional/test_controllers.py b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
index ca02196..b3108eb 100644
--- a/ForgeSVN/forgesvn/tests/functional/test_controllers.py
+++ b/ForgeSVN/forgesvn/tests/functional/test_controllers.py
@@ -93,7 +93,7 @@ class TestRootController(SVNTestController):
         self.app.get('/svn/')
 
     def test_commit_browser(self):
-        resp = self.app.get('/src/commit_browser')
+        self.app.get('/src/commit_browser')
 
     def test_commit_browser_data(self):
         resp = self.app.get('/src/commit_browser_data')
@@ -156,7 +156,7 @@ class TestRootController(SVNTestController):
         assert 'var hash = window.location.hash.substring(1);' in resp
 
     def test_invalid_file(self):
-        resp = self.app.get('/src/1/tree/READMEz', status=404)
+        self.app.get('/src/1/tree/READMEz', status=404)
 
     def test_diff(self):
         resp = self.app.get('/src/3/tree/README?diff=2')
@@ -292,7 +292,7 @@ class TestImportController(SVNTestController):
 
     @patch('forgesvn.svn_main.allura.tasks.repo_tasks')
     def test_do_import(self, tasks):
-        r = self.app.post('/p/test/admin/src/importer/do_import',
+        self.app.post('/p/test/admin/src/importer/do_import',
                           {'checkout_url': 'http://fake.svn/'})
         assert not tasks.reclone.post.called
 
@@ -304,7 +304,7 @@ class TestImportController(SVNTestController):
     @patch('forgesvn.svn_main.allura.tasks.repo_tasks')
     @with_tool('test', 'SVN', 'empty', 'empty SVN')
     def test_do_import_empty_repo(self, tasks):
-        r = self.app.post('/p/test/admin/empty/importer/do_import',
+        self.app.post('/p/test/admin/empty/importer/do_import',
                           {'checkout_url': 'http://fake.svn/'})
         assert tasks.reclone.post.called
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index babafb3..7f0c7b9 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -33,13 +33,11 @@ from ming.base import Object
 from ming.orm import session, ThreadLocalORMSession
 from testfixtures import TempDirectory
 from IPython.testing.decorators import onlyif
-import pysvn
 
 from alluratest.controller import setup_basic_test, setup_global_objects
 from allura import model as M
 from allura.model.repo_refresh import send_notifications
 from allura.lib import helpers as h
-from allura.tests import decorators as td
 from allura.tests.model.test_repo import RepoImplTestBase
 
 from forgesvn import model as SM

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeSVN/forgesvn/tests/test_tasks.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/test_tasks.py b/ForgeSVN/forgesvn/tests/test_tasks.py
index fb48d56..35b426e 100644
--- a/ForgeSVN/forgesvn/tests/test_tasks.py
+++ b/ForgeSVN/forgesvn/tests/test_tasks.py
@@ -23,11 +23,10 @@ import os
 
 import tg
 import mock
-from pylons import tmpl_context as c, app_globals as g
-from ming.orm import ThreadLocalORMSession
+from pylons import tmpl_context as c
 from paste.deploy.converters import asbool
 
-from alluratest.controller import setup_basic_test, setup_global_objects
+from alluratest.controller import setup_basic_test
 
 from allura import model as M
 from allura.lib import helpers as h

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeSVN/setup.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/setup.py b/ForgeSVN/setup.py
index a14fdd3..40dcf73 100644
--- a/ForgeSVN/setup.py
+++ b/ForgeSVN/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 from forgesvn.version import __version__
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeShortUrl/forgeshorturl/main.py
----------------------------------------------------------------------
diff --git a/ForgeShortUrl/forgeshorturl/main.py b/ForgeShortUrl/forgeshorturl/main.py
index 72c7b1e..64ba3e1 100644
--- a/ForgeShortUrl/forgeshorturl/main.py
+++ b/ForgeShortUrl/forgeshorturl/main.py
@@ -15,7 +15,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from tg import expose, validate, redirect, flash, request, config
+from tg import expose, validate, redirect, flash, request
 from tg.decorators import without_trailing_slash
 
 from allura.app import Application, SitemapEntry, DefaultAdminController

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 5dfaec0..ecba850 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -69,7 +69,6 @@ from allura.lib import utils
 from allura.lib import helpers as h
 from allura.lib.plugin import ImportIdConverter
 from allura.tasks import mail_tasks
-from paste.deploy.converters import asbool
 
 
 log = logging.getLogger(__name__)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_rest.py b/ForgeTracker/forgetracker/tests/functional/test_rest.py
index b7f4101..455cff5 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_rest.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_rest.py
@@ -146,7 +146,7 @@ class TestRestIndex(TestTrackerApiBase):
     def test_move_ticket_redirect(self):
         p = M.Project.query.get(shortname='test')
         dummy_tracker = p.app_instance('dummy')
-        r = self.app.post(
+        self.app.post(
             '/p/test/bugs/1/move',
             params={'tracker': str(dummy_tracker.config._id)}).follow()
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/tests/unit/test_globals_model.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_globals_model.py b/ForgeTracker/forgetracker/tests/unit/test_globals_model.py
index ac0c2a9..e3945dc 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_globals_model.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_globals_model.py
@@ -21,7 +21,6 @@ import mock
 from nose.tools import assert_equal
 from pylons import tmpl_context as c
 from ming.orm.ormsession import ThreadLocalORMSession
-from bson import ObjectId
 
 import forgetracker
 from forgetracker.model import Globals

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/tests/unit/test_milestone_controller.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_milestone_controller.py b/ForgeTracker/forgetracker/tests/unit/test_milestone_controller.py
index e35d9ec..b77cf74 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_milestone_controller.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_milestone_controller.py
@@ -18,15 +18,11 @@
 #       under the License.
 
 
-from mock import Mock, patch, MagicMock
-from ming.orm.ormsession import session
+from mock import Mock
 from nose.tools import assert_equal
 
 from allura.lib import helpers as h
-from allura.model import User
 from pylons import tmpl_context as c
-from forgetracker.tests.unit import TrackerTestWithModel
-from forgetracker.model import Ticket, Globals
 from forgetracker.tracker_main import MilestoneController
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/tests/unit/test_root_controller.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_root_controller.py b/ForgeTracker/forgetracker/tests/unit/test_root_controller.py
index cbe926c..256ba86 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_root_controller.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_root_controller.py
@@ -22,7 +22,7 @@ from allura.lib import helpers as h
 from allura.model import User
 from pylons import tmpl_context as c
 from forgetracker.tests.unit import TrackerTestWithModel
-from forgetracker.model import Ticket, Globals
+from forgetracker.model import Ticket
 from forgetracker import tracker_main
 import unittest
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/tests/unit/test_ticket_custom_fields_form.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_ticket_custom_fields_form.py b/ForgeTracker/forgetracker/tests/unit/test_ticket_custom_fields_form.py
index 7e393b6..3c8ea70 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_custom_fields_form.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_custom_fields_form.py
@@ -22,7 +22,6 @@ from pylons import tmpl_context as c
 
 from forgetracker.tests.unit import TrackerTestWithModel
 from forgetracker.widgets import ticket_form
-from forgetracker.model import Globals
 
 
 class TestTicketCustomFields(TrackerTestWithModel):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/tests/unit/test_ticket_form.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_ticket_form.py b/ForgeTracker/forgetracker/tests/unit/test_ticket_form.py
index bc5bbf2..a0743eb 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_form.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_form.py
@@ -15,14 +15,12 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from mock import patch
 from ming.orm.ormsession import ThreadLocalORMSession
 
 from pylons import tmpl_context as c
 
 from forgetracker.tests.unit import TrackerTestWithModel
 from forgetracker.widgets import ticket_form
-from forgetracker.model import Globals
 
 
 class TestTicketForm(TrackerTestWithModel):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
index 2dd2515..f9f4bcb 100644
--- a/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
+++ b/ForgeTracker/forgetracker/tests/unit/test_ticket_model.py
@@ -22,7 +22,7 @@ import urllib2
 from ming.orm.ormsession import ThreadLocalORMSession
 from ming.orm import session
 from ming import schema
-from nose.tools import raises, assert_raises, assert_equal, assert_in
+from nose.tools import raises, assert_equal, assert_in
 
 from forgetracker.model import Ticket, TicketAttachment
 from forgetracker.tests.unit import TrackerTestWithModel
@@ -87,9 +87,8 @@ class TestTicketModel(TrackerTestWithModel):
         assert_equal(t.activity_extras['summary'], t.summary)
 
     def test_private_ticket(self):
-        from pylons import tmpl_context as c
-        from allura.model import ProjectRole, User
-        from allura.model import ACE, ALL_PERMISSIONS, DENY_ALL
+        from allura.model import ProjectRole
+        from allura.model import ACE, DENY_ALL
         from allura.lib.security import Credentials, has_access
         from allura.websetup import bootstrap
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 1ad73de..cb8db76 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -20,15 +20,12 @@ import logging
 import re
 from datetime import datetime, timedelta
 from urllib import urlencode, unquote
-from urllib2 import urlopen
 from webob import exc
 import json
-from itertools import ifilter, imap
-import jinja2
 
 # Non-stdlib imports
 import pkg_resources
-from tg import expose, validate, redirect, flash, url, config, jsonify
+from tg import expose, validate, redirect, flash, url, jsonify
 from tg.decorators import with_trailing_slash, without_trailing_slash
 from paste.deploy.converters import aslist
 from pylons import tmpl_context as c, app_globals as g
@@ -38,7 +35,6 @@ from bson import ObjectId
 from bson.son import SON
 from bson.errors import InvalidId
 from webhelpers import feedgenerator as FG
-from paste.deploy.converters import asbool
 
 from ming import schema
 from ming.orm.ormsession import ThreadLocalORMSession
@@ -62,7 +58,6 @@ from allura.controllers import AppDiscussionController, AppDiscussionRestControl
 from allura.controllers import attachments as ac
 from allura.controllers import BaseController
 from allura.controllers.feed import FeedArgs, FeedController
-from allura.tasks import mail_tasks
 
 # Local imports
 from forgetracker import model as TM

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/widgets/admin_custom_fields.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/admin_custom_fields.py b/ForgeTracker/forgetracker/widgets/admin_custom_fields.py
index 2938685..19b55ec 100644
--- a/ForgeTracker/forgetracker/widgets/admin_custom_fields.py
+++ b/ForgeTracker/forgetracker/widgets/admin_custom_fields.py
@@ -21,10 +21,6 @@ import ew.jinja2_ew as ew
 from allura.lib.widgets import form_fields as ffw
 from allura.lib.widgets import forms as f
 
-from pylons import tmpl_context as c
-from forgetracker import model
-from formencode import validators as fev
-
 
 class MilestonesAdmin(ffw.SortableTable):
     defaults = dict(

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/forgetracker/widgets/ticket_search.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/widgets/ticket_search.py b/ForgeTracker/forgetracker/widgets/ticket_search.py
index 453ed68..96888c7 100644
--- a/ForgeTracker/forgetracker/widgets/ticket_search.py
+++ b/ForgeTracker/forgetracker/widgets/ticket_search.py
@@ -15,10 +15,6 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import tg
-
-from pylons import tmpl_context as c
-
 import ew as ew_core
 import ew.jinja2_ew as ew
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeTracker/setup.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/setup.py b/ForgeTracker/setup.py
index 71b069c..d3e00cc 100644
--- a/ForgeTracker/setup.py
+++ b/ForgeTracker/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 from forgetracker.version import __version__
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeUserStats/forgeuserstats/controllers/userstats.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/forgeuserstats/controllers/userstats.py b/ForgeUserStats/forgeuserstats/controllers/userstats.py
index c0ecfc3..6194257 100644
--- a/ForgeUserStats/forgeuserstats/controllers/userstats.py
+++ b/ForgeUserStats/forgeuserstats/controllers/userstats.py
@@ -25,7 +25,6 @@ from pylons import tmpl_context as c
 from allura.lib.security import require_access
 from forgeuserstats.widgets.forms import StatsPreferencesForm
 from allura.lib.decorators import require_post
-from allura.lib import validators as V
 
 stats_preferences_form = StatsPreferencesForm()
 
@@ -200,7 +199,6 @@ class ForgeUserStatsController(BaseController):
 def _getDataForCategory(category, stats):
     totcommits = stats.getCommits(category)
     tottickets = stats.getTickets(category)
-    averagetime = tottickets.get('averagesolvingtime')
     artifacts_by_type = stats.getArtifactsByType(category)
     totartifacts = artifacts_by_type.get(None)
     if totartifacts:
@@ -212,8 +210,6 @@ def _getDataForCategory(category, stats):
     lm_totartifacts = stats.getLastMonthArtifacts(category)
     lm_tickets = stats.getLastMonthTickets(category)
 
-    averagetime = lm_tickets.get('averagesolvingtime')
-
     days = (datetime.utcnow() - stats.start_date).days
     if days >= 30:
         pmartifacts = dict(

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeUserStats/forgeuserstats/main.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/forgeuserstats/main.py b/ForgeUserStats/forgeuserstats/main.py
index 44e606b..eb25140 100644
--- a/ForgeUserStats/forgeuserstats/main.py
+++ b/ForgeUserStats/forgeuserstats/main.py
@@ -18,21 +18,16 @@
 #-*- python -*-
 import logging
 from pylons import tmpl_context as c
-import formencode
-from formencode import validators
-from webob import exc
 from datetime import datetime
 
 from allura.app import Application, SitemapEntry
 from allura.lib import helpers as h
-from allura.lib.security import has_access
 from allura import model as M
 from allura.eventslistener import EventsListener
 from model.stats import UserStats
 from controllers.userstats import ForgeUserStatsController
 
 from forgeuserstats import version
-from forgeuserstats.controllers.userstats import ForgeUserStatsController
 
 from ming.orm import session
 
@@ -55,7 +50,7 @@ class UserStatsListener(EventsListener):
         stats.addModifiedArtifact(art_type, art_datetime, project)
 
     def newUser(self, user):
-        stats = UserStats.create(user)
+        UserStats.create(user)
 
     def ticketEvent(self, event_type, ticket, project, user):
         if user is None:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeUserStats/forgeuserstats/model/stats.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/forgeuserstats/model/stats.py b/ForgeUserStats/forgeuserstats/model/stats.py
index 03d6e83..2da4618 100644
--- a/ForgeUserStats/forgeuserstats/model/stats.py
+++ b/ForgeUserStats/forgeuserstats/model/stats.py
@@ -18,7 +18,7 @@
 from ming.orm import FieldProperty
 from ming import schema as S
 from datetime import datetime, timedelta
-from ming.orm import session, Mapper
+from ming.orm import Mapper
 from pylons import request
 
 from allura.lib import plugin

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeUserStats/forgeuserstats/tests/test_model.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/forgeuserstats/tests/test_model.py b/ForgeUserStats/forgeuserstats/tests/test_model.py
index aef4db7..08a38d0 100644
--- a/ForgeUserStats/forgeuserstats/tests/test_model.py
+++ b/ForgeUserStats/forgeuserstats/tests/test_model.py
@@ -41,8 +41,6 @@ with_git = td.with_tool(test_project_with_repo, 'Git',
 class TestUserStats(unittest.TestCase):
 
     def setUp(self):
-        from allura.model import User
-
         setup_basic_test()
         setup_global_objects()
         self.user = User.by_username('test-user-2')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeUserStats/forgeuserstats/tests/test_stats.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/forgeuserstats/tests/test_stats.py b/ForgeUserStats/forgeuserstats/tests/test_stats.py
index 20fbc3b..01b2ae2 100644
--- a/ForgeUserStats/forgeuserstats/tests/test_stats.py
+++ b/ForgeUserStats/forgeuserstats/tests/test_stats.py
@@ -18,7 +18,6 @@
 import pkg_resources
 import unittest
 
-from pylons import app_globals as g
 from pylons import tmpl_context as c
 
 from alluratest.controller import TestController, setup_basic_test, setup_global_objects
@@ -27,7 +26,6 @@ from allura.lib import helpers as h
 from allura.model import User
 from allura import model as M
 
-from forgewiki import model as WM
 from forgetracker import model as TM
 
 
@@ -48,7 +46,7 @@ class TestStats(TestController):
     def test_login(self):
         user = User.by_username('test-user')
         init_logins = user.stats.tot_logins_count
-        r = self.app.post('/auth/do_login', params=dict(
+        self.app.post('/auth/do_login', params=dict(
             username=user.username, password='foo'))
 
         assert user.stats.tot_logins_count == 1 + init_logins
@@ -102,7 +100,7 @@ class TestStats(TestController):
         initial_tickets_artifacts = c.user.stats.getArtifacts(
             art_type="Ticket")
 
-        r = self.app.post('/tickets/save_ticket',
+        self.app.post('/tickets/save_ticket',
                           params={'ticket_form.summary': 'test',
                                   'ticket_form.assigned_to': str(c.user.username)},
                           extra_environ=dict(username=str(c.user.username)))
@@ -120,7 +118,7 @@ class TestStats(TestController):
         assert tickets_artifacts[
             'modified'] == initial_tickets_artifacts['modified']
 
-        r = self.app.post('/tickets/%s/update_ticket_from_widget' % ticketnum,
+        self.app.post('/tickets/%s/update_ticket_from_widget' % ticketnum,
                           params={'ticket_form.ticket_num': ticketnum,
                                   'ticket_form.summary': 'footext3',
                                   'ticket_form.status': 'closed'},
@@ -137,7 +135,7 @@ class TestStats(TestController):
         assert tickets_artifacts[
             'modified'] == initial_tickets_artifacts['modified'] + 1
 
-        r = self.app.post('/tickets/save_ticket',
+        self.app.post('/tickets/save_ticket',
                           params={'ticket_form.summary': 'test2'},
                           extra_environ=dict(username=str(c.user.username)))
 
@@ -154,7 +152,7 @@ class TestStats(TestController):
         assert tickets_artifacts[
             'modified'] == initial_tickets_artifacts['modified'] + 1
 
-        r = self.app.post('/tickets/%s/update_ticket_from_widget' % ticketnum,
+        self.app.post('/tickets/%s/update_ticket_from_widget' % ticketnum,
                           params={'ticket_form.ticket_num': ticketnum,
                                   'ticket_form.summary': 'test2',
                                   'ticket_form.assigned_to': str(c.user.username)},
@@ -171,7 +169,7 @@ class TestStats(TestController):
         assert tickets_artifacts[
             'modified'] == initial_tickets_artifacts['modified'] + 2
 
-        r = self.app.post('/tickets/%s/update_ticket_from_widget' % ticketnum,
+        self.app.post('/tickets/%s/update_ticket_from_widget' % ticketnum,
                           params={'ticket_form.ticket_num': ticketnum,
                                   'ticket_form.summary': 'test2',
                                   'ticket_form.assigned_to': 'test-user'},
@@ -197,7 +195,7 @@ class TestGitCommit(TestController, unittest.TestCase):
 
         user = User.by_username('test-admin')
         user.set_password('testpassword')
-        addr = M.EmailAddress.upsert('rcopeland@geek.net')
+        M.EmailAddress.upsert('rcopeland@geek.net')
         user.claim_address('rcopeland@geek.net')
         self.setup_with_tools()
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeUserStats/forgeuserstats/widgets/forms.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/forgeuserstats/widgets/forms.py b/ForgeUserStats/forgeuserstats/widgets/forms.py
index c7b987f..a807e8c 100644
--- a/ForgeUserStats/forgeuserstats/widgets/forms.py
+++ b/ForgeUserStats/forgeuserstats/widgets/forms.py
@@ -15,11 +15,8 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from allura.lib import validators as V
 from allura.lib.widgets.forms import ForgeForm
 
-from formencode import validators as fev
-
 import ew as ew_core
 import ew.jinja2_ew as ew
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeUserStats/setup.py
----------------------------------------------------------------------
diff --git a/ForgeUserStats/setup.py b/ForgeUserStats/setup.py
index ab57945..1ad5c3a 100644
--- a/ForgeUserStats/setup.py
+++ b/ForgeUserStats/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 from forgeuserstats.version import __version__
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeWiki/forgewiki/scripts/wiki_from_trac/loaders.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/scripts/wiki_from_trac/loaders.py b/ForgeWiki/forgewiki/scripts/wiki_from_trac/loaders.py
index 45d056c..58701a3 100644
--- a/ForgeWiki/forgewiki/scripts/wiki_from_trac/loaders.py
+++ b/ForgeWiki/forgewiki/scripts/wiki_from_trac/loaders.py
@@ -16,7 +16,6 @@
 #       under the License.
 
 import json
-from optparse import OptionParser
 
 from allura.lib.import_api import AlluraImportApiClient
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeWiki/forgewiki/scripts/wiki_from_trac/wiki_from_trac.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/scripts/wiki_from_trac/wiki_from_trac.py b/ForgeWiki/forgewiki/scripts/wiki_from_trac/wiki_from_trac.py
index afc6f41..0897f00 100644
--- a/ForgeWiki/forgewiki/scripts/wiki_from_trac/wiki_from_trac.py
+++ b/ForgeWiki/forgewiki/scripts/wiki_from_trac/wiki_from_trac.py
@@ -18,7 +18,6 @@
 import argparse
 import logging
 from tempfile import NamedTemporaryFile
-from tg.decorators import cached_property
 
 from forgewiki.scripts.wiki_from_trac.extractors import WikiExporter
 from forgewiki.scripts.wiki_from_trac.loaders import load_data

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeWiki/forgewiki/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index 5b05aad..0222e5a 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -20,7 +20,6 @@
 import os
 import StringIO
 import allura
-import json
 
 import PIL
 from nose.tools import assert_true, assert_equal, assert_in

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index 0244f73..7a90a3b 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -20,12 +20,10 @@ import json
 import logging
 from pprint import pformat
 from urllib import unquote
-from datetime import datetime
 
 # Non-stdlib imports
-from tg import expose, validate, redirect, response, flash, jsonify
+from tg import expose, validate, redirect, flash, jsonify
 from tg.decorators import with_trailing_slash, without_trailing_slash
-from tg.controllers import RestController
 from pylons import tmpl_context as c, app_globals as g
 from pylons import request
 from formencode import validators

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/ForgeWiki/setup.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/setup.py b/ForgeWiki/setup.py
index 6bc7944..041eadc 100644
--- a/ForgeWiki/setup.py
+++ b/ForgeWiki/setup.py
@@ -16,8 +16,6 @@
 #       under the License.
 
 from setuptools import setup, find_packages
-import sys
-import os
 
 from forgewiki.version import __version__
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/scripts/create-allura-sitemap.py
----------------------------------------------------------------------
diff --git a/scripts/create-allura-sitemap.py b/scripts/create-allura-sitemap.py
index 5357df7..e3f08bc 100644
--- a/scripts/create-allura-sitemap.py
+++ b/scripts/create-allura-sitemap.py
@@ -39,7 +39,7 @@ from pylons import tmpl_context as c
 
 from allura import model as M
 from allura.lib import security, utils
-from ming.orm import session, ThreadLocalORMSession
+from ming.orm import ThreadLocalORMSession
 
 MAX_SITEMAP_URLS = 50000
 BASE_URL = 'http://sourceforge.net'

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/scripts/migrations/000-fix-tracker-fields.py
----------------------------------------------------------------------
diff --git a/scripts/migrations/000-fix-tracker-fields.py b/scripts/migrations/000-fix-tracker-fields.py
index fc9d77a..5d2b6b1 100644
--- a/scripts/migrations/000-fix-tracker-fields.py
+++ b/scripts/migrations/000-fix-tracker-fields.py
@@ -16,12 +16,11 @@
 #       under the License.
 
 import sys
-import json
 import logging
 
 from pylons import tmpl_context as c
 
-from ming.orm import session, MappedClass
+from ming.orm import session
 
 from allura import model as M
 from forgetracker import model as TM

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/scripts/migrations/008-remove-forumpost-subject.py
----------------------------------------------------------------------
diff --git a/scripts/migrations/008-remove-forumpost-subject.py b/scripts/migrations/008-remove-forumpost-subject.py
index 892eb61..af344d5 100644
--- a/scripts/migrations/008-remove-forumpost-subject.py
+++ b/scripts/migrations/008-remove-forumpost-subject.py
@@ -22,10 +22,7 @@ Remove the subject FieldProperty from all ForumPost objects. [#2071]
 import logging
 import sys
 
-from ming.orm import state
-
 from allura import model as M
-from forgediscussion import model as DM
 
 log = logging.getLogger(__name__)
 


Mime
View raw message