allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [3/3] git commit: Pylint cleanup
Date Fri, 10 Jan 2014 23:17:17 GMT
Pylint cleanup

Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>


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

Branch: refs/heads/master
Commit: 0ca218aba03f58a871c639dfb596963312e7b88a
Parents: c93733a
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Fri Jan 10 23:16:59 2014 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Fri Jan 10 23:16:59 2014 +0000

----------------------------------------------------------------------
 Allura/allura/app.py                            |  6 +-
 Allura/allura/command/base.py                   |  2 -
 Allura/allura/command/reclone_repo.py           |  1 -
 .../allura/command/set_neighborhood_features.py |  2 +-
 Allura/allura/controllers/attachments.py        |  4 +-
 Allura/allura/controllers/auth.py               |  2 -
 .../allura/controllers/basetest_project_root.py | 13 +---
 Allura/allura/controllers/discuss.py            |  7 +-
 Allura/allura/controllers/project.py            |  6 +-
 Allura/allura/controllers/repository.py         |  7 +-
 Allura/allura/controllers/rest.py               |  2 +-
 Allura/allura/controllers/root.py               | 20 ++----
 Allura/allura/controllers/search.py             |  2 +-
 Allura/allura/controllers/site_admin.py         | 12 ++--
 Allura/allura/controllers/static.py             |  2 +-
 Allura/allura/controllers/trovecategories.py    | 12 +---
 Allura/allura/ext/admin/admin_main.py           |  4 +-
 Allura/allura/ext/admin/widgets.py              |  3 +-
 Allura/allura/ext/project_home/project_main.py  |  1 -
 Allura/allura/ext/user_profile/user_main.py     |  9 +--
 Allura/allura/lib/AsciiDammit.py                |  1 -
 Allura/allura/lib/base.py                       |  2 +-
 Allura/allura/lib/custom_middleware.py          |  1 -
 Allura/allura/lib/macro.py                      |  2 +-
 Allura/allura/lib/package_path_loader.py        |  2 -
 Allura/allura/lib/plugin.py                     |  1 -
 Allura/allura/lib/repository.py                 |  3 +-
 Allura/allura/lib/spam/akismetfilter.py         |  1 -
 Allura/allura/lib/widgets/auth_widgets.py       |  2 +-
 Allura/allura/lib/widgets/discuss.py            |  2 -
 Allura/allura/lib/widgets/form_fields.py        |  2 +-
 Allura/allura/lib/widgets/forms.py              |  1 -
 Allura/allura/lib/widgets/oauth_widgets.py      |  3 -
 Allura/allura/lib/widgets/project_list.py       |  2 +-
 Allura/allura/lib/widgets/repo.py               |  2 -
 Allura/allura/lib/widgets/subscriptions.py      |  2 -
 Allura/allura/model/artifact.py                 |  8 +--
 Allura/allura/model/auth.py                     |  1 -
 Allura/allura/model/filesystem.py               |  2 -
 Allura/allura/model/neighborhood.py             |  2 +-
 Allura/allura/model/notification.py             |  2 +-
 Allura/allura/model/oauth.py                    |  3 +-
 Allura/allura/model/openid_model.py             |  3 +-
 Allura/allura/model/project.py                  |  5 +-
 Allura/allura/model/repo.py                     | 11 ++-
 Allura/allura/model/repo_refresh.py             |  2 +-
 Allura/allura/model/repository.py               | 13 +---
 Allura/allura/model/session.py                  |  1 -
 Allura/allura/model/stats.py                    | 12 +---
 Allura/allura/scripts/refresh_last_commits.py   |  4 --
 Allura/allura/scripts/refreshrepo.py            |  1 -
 Allura/allura/scripts/trac_export.py            |  1 -
 Allura/allura/tasks/export_tasks.py             |  4 +-
 Allura/allura/tasks/repo_tasks.py               |  4 +-
 Allura/allura/tests/functional/test_admin.py    |  5 --
 Allura/allura/tests/functional/test_auth.py     | 70 +++++++++-----------
 Allura/allura/tests/functional/test_discuss.py  |  2 +-
 Allura/allura/tests/functional/test_home.py     |  5 +-
 .../tests/functional/test_neighborhood.py       |  4 +-
 Allura/allura/tests/functional/test_rest.py     |  1 -
 Allura/allura/tests/functional/test_root.py     | 10 ++-
 Allura/allura/tests/functional/test_search.py   |  8 +--
 .../allura/tests/functional/test_site_admin.py  |  4 +-
 .../tests/functional/test_user_profile.py       |  5 +-
 Allura/allura/tests/model/test_auth.py          |  1 -
 Allura/allura/tests/model/test_discussion.py    | 25 +++----
 Allura/allura/tests/model/test_filesystem.py    |  2 +-
 Allura/allura/tests/model/test_neighborhood.py  |  3 -
 Allura/allura/tests/model/test_notification.py  |  4 +-
 Allura/allura/tests/model/test_project.py       |  2 +-
 Allura/allura/tests/model/test_repo.py          |  2 +-
 Allura/allura/tests/test_app.py                 |  4 --
 Allura/allura/tests/test_commands.py            |  1 -
 Allura/allura/tests/test_globals.py             |  8 +--
 Allura/allura/tests/test_helpers.py             |  6 +-
 Allura/allura/tests/test_mail_util.py           |  1 -
 Allura/allura/tests/test_plugin.py              |  2 -
 Allura/allura/tests/test_security.py            |  1 -
 Allura/allura/tests/test_tasks.py               |  2 -
 Allura/allura/tests/test_utils.py               |  3 +-
 Allura/allura/tests/tscript.py                  |  5 --
 Allura/allura/tests/unit/test_app.py            |  1 -
 .../tests/unit/test_helpers/test_set_context.py |  3 +-
 .../tests/unit/test_package_path_loader.py      |  3 +-
 Allura/allura/tests/unit/test_repo.py           |  2 +-
 Allura/allura/websetup/bootstrap.py             |  1 -
 Allura/docs/conf.py                             |  3 -
 AlluraTest/alluratest/controller.py             |  5 +-
 AlluraTest/alluratest/test_syntax.py            |  1 -
 AlluraTest/alluratest/validation.py             | 12 +---
 AlluraTest/setup.py                             |  2 -
 .../forgeactivity/tests/functional/test_root.py |  8 +--
 ForgeBlog/forgeblog/command/rssfeeds.py         |  2 -
 ForgeBlog/forgeblog/main.py                     |  8 +--
 ForgeBlog/forgeblog/tests/test_commands.py      |  2 +-
 ForgeBlog/setup.py                              |  2 -
 ForgeChat/forgechat/command.py                  |  2 +-
 ForgeChat/forgechat/main.py                     |  2 +-
 ForgeChat/setup.py                              |  2 -
 .../forgediscussion/controllers/root.py         |  4 +-
 ForgeDiscussion/forgediscussion/forum_main.py   |  4 +-
 .../tests/functional/test_forum.py              | 22 +++---
 .../tests/functional/test_import.py             |  4 +-
 .../forgediscussion/widgets/admin.py            |  2 -
 ForgeDiscussion/setup.py                        |  2 -
 ForgeGit/forgegit/git_main.py                   |  4 +-
 ForgeGit/forgegit/model/git_repo.py             | 14 +---
 ForgeGit/forgegit/tests/functional/test_auth.py |  4 +-
 .../tests/functional/test_controllers.py        |  5 +-
 .../forgegit/tests/model/test_repository.py     |  2 -
 ForgeGit/setup.py                               |  2 -
 ForgeImporters/docs/conf.py                     |  3 -
 ForgeImporters/forgeimporters/forge/tracker.py  |  2 +-
 ForgeImporters/forgeimporters/github/code.py    |  1 -
 ForgeImporters/forgeimporters/github/project.py |  1 -
 .../forgeimporters/github/tests/test_code.py    |  2 +-
 .../forgeimporters/github/tests/test_tracker.py |  2 +-
 .../forgeimporters/github/tests/test_wiki.py    |  4 +-
 ForgeImporters/forgeimporters/github/wiki.py    |  2 +-
 .../forgeimporters/google/__init__.py           |  2 -
 ForgeImporters/forgeimporters/google/project.py |  2 -
 .../forgeimporters/google/tests/test_code.py    |  4 +-
 ForgeImporters/forgeimporters/google/tracker.py |  5 +-
 .../tests/google/functional/test_tracker.py     |  4 --
 .../tests/google/test_extractor.py              |  1 -
 .../forgeimporters/tests/test_base.py           |  2 +-
 .../forgeimporters/trac/tests/test_tickets.py   |  3 +-
 ForgeLink/forgelink/link_main.py                |  5 +-
 ForgeLink/setup.py                              |  2 -
 ForgeSVN/forgesvn/controllers.py                |  2 +-
 ForgeSVN/forgesvn/model/svn.py                  |  3 +-
 .../tests/functional/test_controllers.py        |  8 +--
 .../forgesvn/tests/model/test_repository.py     |  2 -
 ForgeSVN/forgesvn/tests/test_tasks.py           |  5 +-
 ForgeSVN/setup.py                               |  2 -
 ForgeShortUrl/forgeshorturl/main.py             |  2 +-
 ForgeTracker/forgetracker/model/ticket.py       |  1 -
 .../forgetracker/tests/functional/test_rest.py  |  2 +-
 .../tests/unit/test_globals_model.py            |  1 -
 .../tests/unit/test_milestone_controller.py     |  6 +-
 .../tests/unit/test_root_controller.py          |  2 +-
 .../unit/test_ticket_custom_fields_form.py      |  1 -
 .../forgetracker/tests/unit/test_ticket_form.py |  2 -
 .../tests/unit/test_ticket_model.py             |  7 +-
 ForgeTracker/forgetracker/tracker_main.py       |  7 +-
 .../forgetracker/widgets/admin_custom_fields.py |  4 --
 .../forgetracker/widgets/ticket_search.py       |  4 --
 ForgeTracker/setup.py                           |  2 -
 .../forgeuserstats/controllers/userstats.py     |  4 --
 ForgeUserStats/forgeuserstats/main.py           |  7 +-
 ForgeUserStats/forgeuserstats/model/stats.py    |  2 +-
 .../forgeuserstats/tests/test_model.py          |  2 -
 .../forgeuserstats/tests/test_stats.py          | 16 ++---
 ForgeUserStats/forgeuserstats/widgets/forms.py  |  3 -
 ForgeUserStats/setup.py                         |  2 -
 .../forgewiki/scripts/wiki_from_trac/loaders.py |  1 -
 .../scripts/wiki_from_trac/wiki_from_trac.py    |  1 -
 .../forgewiki/tests/functional/test_root.py     |  1 -
 ForgeWiki/forgewiki/wiki_main.py                |  4 +-
 ForgeWiki/setup.py                              |  2 -
 scripts/create-allura-sitemap.py                |  2 +-
 scripts/migrations/000-fix-tracker-fields.py    |  3 +-
 .../migrations/008-remove-forumpost-subject.py  |  3 -
 .../015-add-neighborhood_id-to-blog-posts.py    |  2 -
 .../024-migrate-custom-profile-text.py          |  1 -
 scripts/migrations/025-add-is-nbhd-project.py   |  5 --
 .../027-change-ticket-write-permissions.py      |  6 --
 scripts/perf/call_count.py                      |  1 -
 scripts/perf/md_perf.py                         |  4 --
 scripts/rethumb.py                              |  7 +-
 scripts/wiki-export.py                          |  2 -
 scripts/wiki-post.py                            |  5 +-
 172 files changed, 208 insertions(+), 529 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 29acf12..abefd3c 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -30,14 +30,14 @@ from bson import ObjectId
 from bson.errors import InvalidId
 from formencode import validators as V
 
-from ming.orm import session, state
+from ming.orm import session
 from ming.utils import LazyProperty
 
 from allura.lib import helpers as h
-from allura.lib.security import require, has_access, require_access
+from allura.lib.security import has_access, require_access
 from allura import model
 from allura.controllers import BaseController
-from allura.lib.decorators import require_post, event_handler, memoize
+from allura.lib.decorators import require_post, memoize
 from allura.lib.utils import permanent_redirect, ConfigProxy
 
 log = logging.getLogger(__name__)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/command/base.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/base.py b/Allura/allura/command/base.py
index 427362c..7fa566a 100644
--- a/Allura/allura/command/base.py
+++ b/Allura/allura/command/base.py
@@ -16,10 +16,8 @@
 #       under the License.
 
 import os
-import sys
 import logging
 import shlex
-from multiprocessing import Process
 
 import pylons
 from paste.script import command

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/command/reclone_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/reclone_repo.py b/Allura/allura/command/reclone_repo.py
index 7cc06a5..d401b0b 100644
--- a/Allura/allura/command/reclone_repo.py
+++ b/Allura/allura/command/reclone_repo.py
@@ -20,7 +20,6 @@ import warnings
 from pylons import tmpl_context as c
 
 from allura import model as M
-from allura.tasks import repo_tasks
 
 from . import base
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/command/set_neighborhood_features.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/set_neighborhood_features.py b/Allura/allura/command/set_neighborhood_features.py
index c4de43c..36ba22b 100644
--- a/Allura/allura/command/set_neighborhood_features.py
+++ b/Allura/allura/command/set_neighborhood_features.py
@@ -21,7 +21,7 @@ from allura.command import base
 
 from bson import ObjectId
 from allura import model as M
-from allura.lib import plugin, exceptions
+from allura.lib import exceptions
 from ming.orm import session
 
 # Example usage:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/attachments.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/attachments.py b/Allura/allura/controllers/attachments.py
index fc0fbbc..4ab3b92 100644
--- a/Allura/allura/controllers/attachments.py
+++ b/Allura/allura/controllers/attachments.py
@@ -18,10 +18,10 @@
 from urllib import unquote
 from webob import exc
 
-from tg import expose, request, response, redirect
+from tg import expose, request, redirect
 from ming.utils import LazyProperty
 
-from allura.lib.security import require, has_access, require_access
+from allura.lib.security import require_access
 from .base import BaseController
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 587d151..8e08e13 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -30,7 +30,6 @@ from webob import exc as wexc
 
 import allura.tasks.repo_tasks
 from allura import model as M
-from allura.model.project import TroveCategory
 from allura.lib import validators as V
 from allura.lib.oid_helper import verify_oid, process_oid
 from allura.lib.security import require_authenticated, has_access
@@ -45,7 +44,6 @@ from allura.lib.widgets import (
     LoginForm,
     ForgottenPasswordForm)
 from allura.lib.widgets import forms
-from allura.lib import exceptions as exc
 from allura.controllers import BaseController
 
 log = logging.getLogger(__name__)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/basetest_project_root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/basetest_project_root.py b/Allura/allura/controllers/basetest_project_root.py
index 91cf690..638d28d 100644
--- a/Allura/allura/controllers/basetest_project_root.py
+++ b/Allura/allura/controllers/basetest_project_root.py
@@ -18,20 +18,14 @@
 #       under the License.
 
 """Main Controller"""
-import os
 import logging
 from urllib import unquote
 
-import pkg_resources
 from pylons import tmpl_context as c
-from pylons import request, response
+from pylons import request
 from webob import exc
 from tg import expose
-from tg.decorators import without_trailing_slash
 
-import ming.orm.ormsession
-
-import allura
 from allura.lib.base import WsgiDispatchController
 from allura.lib.security import require, require_authenticated, require_access, has_access
 from allura.lib import helpers as h
@@ -39,10 +33,6 @@ from allura.lib import plugin
 from allura import model as M
 from .root import RootController
 from .project import ProjectController
-from .auth import AuthController
-from .static import NewForgeController
-from .search import SearchController
-from .error import ErrorController
 from .rest import RestController
 
 __all__ = ['RootController']
@@ -91,7 +81,6 @@ class BasetestProjectRootController(WsgiDispatchController, ProjectController):
         c.memoize_cache = {}
         count = 20
         while c.project is None:
-            import sys
             import time
             time.sleep(0.5)
             log.warning('Project "test" not found, retrying...')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/discuss.py b/Allura/allura/controllers/discuss.py
index 2eef299..88ec552 100644
--- a/Allura/allura/controllers/discuss.py
+++ b/Allura/allura/controllers/discuss.py
@@ -19,10 +19,8 @@ from urllib import unquote
 from datetime import datetime
 import logging
 
-from tg import expose, redirect, validate, request, response, flash
-from tg.decorators import before_validate, with_trailing_slash, without_trailing_slash
+from tg import expose, redirect, validate, request, flash
 from pylons import tmpl_context as c, app_globals as g
-from formencode import validators
 from webob import exc
 
 from ming.base import Object
@@ -33,8 +31,7 @@ from base import BaseController
 from allura.lib import utils
 from allura.lib import helpers as h
 from allura.lib.decorators import require_post
-from allura.lib.security import require, has_access, require_access
-from allura.lib.helpers import DateTimeConverter
+from allura.lib.security import require_access
 
 from allura.lib.widgets import discuss as DW
 from .attachments import AttachmentsController, AttachmentController

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index cdbba4c..b231205 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -19,16 +19,14 @@ import re
 import logging
 from datetime import datetime, timedelta
 from urllib import unquote
-from itertools import chain, islice
 
 from bson import ObjectId
-from tg import expose, flash, redirect, validate, request, response, config
-from tg.decorators import with_trailing_slash, without_trailing_slash, override_template
+from tg import expose, flash, redirect, validate, request, config
+from tg.decorators import with_trailing_slash, without_trailing_slash
 from pylons import tmpl_context as c, app_globals as g
 from paste.deploy.converters import asbool
 from webob import exc
 import pymongo
-from formencode import validators
 from formencode.api import Invalid
 
 from ming.utils import LazyProperty

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index 05e7202..e571734 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -16,11 +16,9 @@
 #       under the License.
 
 import os
-import json
 import logging
-import re
 import difflib
-from urllib import quote, unquote, quote_plus
+from urllib import quote, unquote
 from collections import defaultdict
 from itertools import islice
 
@@ -28,7 +26,7 @@ from pylons import tmpl_context as c, app_globals as g
 from pylons import request, response
 from webob import exc
 import tg
-from tg import redirect, expose, flash, url, validate
+from tg import redirect, expose, flash, validate
 from tg.decorators import with_trailing_slash, without_trailing_slash
 from tg import session as web_session
 from formencode import validators
@@ -53,7 +51,6 @@ from allura.controllers.base import DispatchIndex
 from allura.controllers.feed import FeedController, FeedArgs
 from allura.lib.diff import HtmlSideBySideDiff
 from paste.deploy.converters import asbool
-from allura.app import SitemapEntry
 from .base import BaseController
 
 log = logging.getLogger(__name__)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/rest.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/rest.py b/Allura/allura/controllers/rest.py
index cab7084..6eb12a8 100644
--- a/Allura/allura/controllers/rest.py
+++ b/Allura/allura/controllers/rest.py
@@ -264,7 +264,7 @@ class NeighborhoodRestController(object):
         try:
             provider.shortname_validator.to_python(
                 name, check_allowed=False, neighborhood=self._neighborhood)
-        except Invalid as e:
+        except Invalid:
             raise exc.HTTPNotFound, name
         name = self._neighborhood.shortname_prefix + name
         project = M.Project.query.get(

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/root.py b/Allura/allura/controllers/root.py
index 0d7f96b..198493c 100644
--- a/Allura/allura/controllers/root.py
+++ b/Allura/allura/controllers/root.py
@@ -19,25 +19,14 @@
 
 """Main Controller"""
 import logging
-import string
-import os
-from datetime import datetime
-from collections import defaultdict
-
-import pkg_resources
-from tg import expose, flash, redirect, session, config, response, request, config
-from tg.decorators import with_trailing_slash, without_trailing_slash
-from tg.flash import TGFlash
-from pylons import tmpl_context as c, app_globals as g
-from pylons import cache
 
-import ew
-import ming
+from tg import expose, request, config
+from tg.decorators import with_trailing_slash
+from tg.flash import TGFlash
+from pylons import tmpl_context as c
 
-import allura
 from allura.app import SitemapEntry
 from allura.lib.base import WsgiDispatchController
-from allura.lib import helpers as h
 from allura.lib import plugin
 from allura.controllers.error import ErrorController
 from allura import model as M
@@ -47,7 +36,6 @@ from .trovecategories import TroveCategoryController
 from .search import SearchController, ProjectBrowseController
 from .static import NewForgeController
 from .site_admin import SiteAdminController
-from .project import NeighborhoodController, HostNeighborhoodController
 from .rest import RestController
 
 __all__ = ['RootController']

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/search.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/search.py b/Allura/allura/controllers/search.py
index 7afeb4d..eaf8446 100644
--- a/Allura/allura/controllers/search.py
+++ b/Allura/allura/controllers/search.py
@@ -15,7 +15,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from tg import expose, redirect, flash, config, validate, request
+from tg import expose, validate, request
 from tg.decorators import with_trailing_slash, without_trailing_slash
 from formencode import validators as V
 from pylons import tmpl_context as c

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index b61da6c..e6e374c 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -16,10 +16,8 @@
 #       under the License.
 
 import re
-import json
 import logging
 from datetime import datetime, timedelta
-from collections import defaultdict
 
 from tg import expose, validate, flash, config, redirect
 from tg.decorators import with_trailing_slash, without_trailing_slash
@@ -27,7 +25,7 @@ from ming.orm import session
 import pymongo
 import bson
 import tg
-from pylons import tmpl_context as c, app_globals as g
+from pylons import tmpl_context as c
 from pylons import request
 from formencode import validators, Invalid
 from webob.exc import HTTPNotFound
@@ -284,11 +282,11 @@ class TaskManagerController(object):
         now = datetime.utcnow()
         try:
             page_num = int(page_num)
-        except ValueError as e:
+        except ValueError:
             page_num = 1
         try:
             minutes = int(minutes)
-        except ValueError as e:
+        except ValueError:
             minutes = 1
         start_dt = now - timedelta(minutes=(page_num - 1) * minutes)
         end_dt = now - timedelta(minutes=page_num * minutes)
@@ -327,7 +325,7 @@ class TaskManagerController(object):
     def view(self, task_id):
         try:
             task = M.monq_model.MonQTask.query.get(_id=bson.ObjectId(task_id))
-        except bson.errors.InvalidId as e:
+        except bson.errors.InvalidId:
             task = None
         if task:
             task.project = M.Project.query.get(_id=task.context.project_id)
@@ -364,7 +362,7 @@ class TaskManagerController(object):
     def resubmit(self, task_id):
         try:
             task = M.monq_model.MonQTask.query.get(_id=bson.ObjectId(task_id))
-        except bson.errors.InvalidId as e:
+        except bson.errors.InvalidId:
             task = None
         if task is None:
             raise HTTPNotFound()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/static.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/static.py b/Allura/allura/controllers/static.py
index 100b3a5..60d77c1 100644
--- a/Allura/allura/controllers/static.py
+++ b/Allura/allura/controllers/static.py
@@ -21,7 +21,7 @@ from tg import expose
 from tg.decorators import without_trailing_slash
 from webob import exc
 
-from pylons import tmpl_context as c, app_globals as g
+from pylons import app_globals as g
 from allura.lib import helpers as h
 from allura.lib import utils
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/controllers/trovecategories.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/trovecategories.py b/Allura/allura/controllers/trovecategories.py
index 21601db..6c57f33 100644
--- a/Allura/allura/controllers/trovecategories.py
+++ b/Allura/allura/controllers/trovecategories.py
@@ -15,16 +15,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import logging
-import string
-import os
-from urllib import urlencode
-
-import bson
-from tg import expose, session, flash, redirect, validate, config
-from tg.decorators import with_trailing_slash
-from pylons import tmpl_context as c, app_globals as g
-from pylons import request, response
+from tg import expose, flash, redirect, validate
 from string import digits, lowercase
 
 from allura.lib.security import require_authenticated
@@ -32,7 +23,6 @@ from allura import model as M
 from allura.lib.decorators import require_post
 from allura.controllers import BaseController
 from allura.lib.widgets import forms
-from allura.model import TroveCategory
 
 
 class F(object):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index 607c151..34641b9 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -16,11 +16,9 @@
 #       under the License.
 
 import logging
-from collections import defaultdict
 from datetime import datetime
 from urlparse import urlparse
 import json
-import os
 from operator import itemgetter
 
 import pkg_resources
@@ -286,7 +284,7 @@ class ProjectAdminController(BaseController):
                 raise ValueError('Invalid threshold')
             c.project.set_tool_data(
                 'allura', grouping_threshold=grouping_threshold)
-        except ValueError as e:
+        except ValueError:
             flash('Invalid threshold', 'error')
         redirect('tools')
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/ext/admin/widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/widgets.py b/Allura/allura/ext/admin/widgets.py
index 7457d28..805fa41 100644
--- a/Allura/allura/ext/admin/widgets.py
+++ b/Allura/allura/ext/admin/widgets.py
@@ -15,7 +15,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from pylons import tmpl_context as c, app_globals as g
+from pylons import tmpl_context as c
 
 import ew as ew_core
 from ew import jinja2_ew as ew
@@ -24,7 +24,6 @@ from formencode import validators as fev
 
 from allura import model as M
 from allura.lib import validators as V
-from allura.lib import security
 from allura.lib.widgets import forms as ff
 from allura.lib.widgets import form_fields as ffw
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/ext/project_home/project_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/project_home/project_main.py b/Allura/allura/ext/project_home/project_main.py
index 378ca0a..a02b807 100644
--- a/Allura/allura/ext/project_home/project_main.py
+++ b/Allura/allura/ext/project_home/project_main.py
@@ -64,7 +64,6 @@ class ProjectHomeApp(Application):
     @property
     @h.exceptionless([], log)
     def sitemap(self):
-        menu_id = 'Home'
         return [
             SitemapEntry('Home', '..')]
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/ext/user_profile/user_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/user_main.py b/Allura/allura/ext/user_profile/user_main.py
index a9ab929..9198696 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -16,23 +16,20 @@
 #       under the License.
 
 import logging
-from pprint import pformat
 
 import pkg_resources
-from pylons import tmpl_context as c, app_globals as g
+from pylons import tmpl_context as c
 from pylons import request
 from formencode import validators
-from tg import expose, redirect, validate, response, config, flash
+from tg import expose, redirect, validate, flash
 from webob import exc
-from datetime import timedelta, datetime
 
 from allura import version
 from allura.app import Application, SitemapEntry
 from allura.lib import helpers as h
-from allura.lib.helpers import DateTimeConverter
 from allura.lib.security import require_access
 from allura.lib.plugin import AuthenticationProvider
-from allura.model import User, Feed, ACE, ProjectRole
+from allura.model import User, ACE, ProjectRole
 from allura.controllers import BaseController
 from allura.controllers.feed import FeedArgs, FeedController
 from allura.lib.decorators import require_post

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/AsciiDammit.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/AsciiDammit.py b/Allura/allura/lib/AsciiDammit.py
index e4ea156..d86c26d 100644
--- a/Allura/allura/lib/AsciiDammit.py
+++ b/Allura/allura/lib/AsciiDammit.py
@@ -23,7 +23,6 @@ __date__ = "$Date: 2009/04/28 10:45:03 $"
 __license__ = "Public domain"
 
 import re
-import string
 import types
 
 CHARS = {'\x80': ('EUR', 'euro'),

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/base.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/base.py b/Allura/allura/lib/base.py
index bac6a2b..b0c9050 100644
--- a/Allura/allura/lib/base.py
+++ b/Allura/allura/lib/base.py
@@ -20,7 +20,7 @@
 """The base Controller API."""
 from webob import exc
 import pylons
-from tg import TGController, config
+from tg import TGController
 
 __all__ = ['WsgiDispatchController']
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/custom_middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index 9cb20da..3f65e6c 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -18,7 +18,6 @@
 import os
 import re
 import logging
-from contextlib import contextmanager
 
 import tg
 import pkg_resources

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/macro.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/macro.py b/Allura/allura/lib/macro.py
index 3f827ed..d22b431 100644
--- a/Allura/allura/lib/macro.py
+++ b/Allura/allura/lib/macro.py
@@ -415,5 +415,5 @@ def embed(url=None):
     consumer.addEndpoint(endpoint)
     try:
         return jinja2.Markup('<div class="grid-20">%s</div>' % consumer.embed(url)['html'])
-    except oembed.OEmbedNoEndpoint as e:
+    except oembed.OEmbedNoEndpoint:
         return '[[embed url=%s]]' % url

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/package_path_loader.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/package_path_loader.py b/Allura/allura/lib/package_path_loader.py
index 9e6548a..fa5f71b 100644
--- a/Allura/allura/lib/package_path_loader.py
+++ b/Allura/allura/lib/package_path_loader.py
@@ -262,8 +262,6 @@ class PackagePathLoader(jinja2.BaseLoader):
         - path/to/template.html
         - module:path/to/template.html
         '''
-        src = None
-
         # look in all of the customized search locations...
         try:
             parts = [self.override_root] + template.split(':')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 809d895..4617303 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -50,7 +50,6 @@ from ming.orm import ThreadLocalORMSession
 from allura.lib import helpers as h
 from allura.lib import security
 from allura.lib import exceptions as forge_exc
-from paste.deploy.converters import asbool
 
 log = logging.getLogger(__name__)
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index 6e5ef42..6e073d9 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -16,12 +16,11 @@
 #       under the License.
 
 import logging
-import shutil
 from urllib import quote
 
 from pylons import tmpl_context as c, app_globals as g
 from pylons import request
-from tg import expose, redirect, url
+from tg import expose, redirect
 from tg.decorators import with_trailing_slash, without_trailing_slash
 from bson import ObjectId
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/spam/akismetfilter.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/spam/akismetfilter.py b/Allura/allura/lib/spam/akismetfilter.py
index 48f24cc..775aecc 100644
--- a/Allura/allura/lib/spam/akismetfilter.py
+++ b/Allura/allura/lib/spam/akismetfilter.py
@@ -61,7 +61,6 @@ class AkismetSpamFilter(SpamFilter):
         kw['comment_type'] = content_type
         if artifact:
             kw['permalink'] = artifact.url()
-            log_msg = artifact.url()
         user = user or c.user
         if user:
             kw['comment_author'] = user.display_name or user.username

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/widgets/auth_widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/auth_widgets.py b/Allura/allura/lib/widgets/auth_widgets.py
index f6c1a28..f97c976 100644
--- a/Allura/allura/lib/widgets/auth_widgets.py
+++ b/Allura/allura/lib/widgets/auth_widgets.py
@@ -20,7 +20,7 @@ import ew.jinja2_ew as ew
 from ew.core import validator
 
 from pylons import request
-from formencode import Invalid, validators
+from formencode import Invalid
 from webob import exc
 
 from .forms import ForgeForm

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/widgets/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/discuss.py b/Allura/allura/lib/widgets/discuss.py
index 30dc128..70a1d15 100644
--- a/Allura/allura/lib/widgets/discuss.py
+++ b/Allura/allura/lib/widgets/discuss.py
@@ -15,14 +15,12 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from pylons import tmpl_context as c, app_globals as g
 from formencode import validators as fev
 
 import ew as ew_core
 import ew.jinja2_ew as ew
 
 from allura.lib import validators as V
-from allura.lib import helpers as h
 from allura.lib.widgets import form_fields as ffw
 from allura.lib.widgets import forms as ff
 from allura import model as M

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/widgets/form_fields.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/form_fields.py b/Allura/allura/lib/widgets/form_fields.py
index e8d9a27..2249372 100644
--- a/Allura/allura/lib/widgets/form_fields.py
+++ b/Allura/allura/lib/widgets/form_fields.py
@@ -15,7 +15,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from pylons import tmpl_context as c, app_globals as g
+from pylons import tmpl_context as c
 from tg import request, url
 import json
 import logging

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/widgets/forms.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/forms.py b/Allura/allura/lib/widgets/forms.py
index de87746..66b176a 100644
--- a/Allura/allura/lib/widgets/forms.py
+++ b/Allura/allura/lib/widgets/forms.py
@@ -32,7 +32,6 @@ from allura.lib import helpers as h
 from allura.lib import plugin
 from allura.lib.widgets import form_fields as ffw
 from allura.lib import exceptions as forge_exc
-from allura.lib.utils import LazyProperty
 from allura import model as M
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/widgets/oauth_widgets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/oauth_widgets.py b/Allura/allura/lib/widgets/oauth_widgets.py
index 6426beb..f04fed8 100644
--- a/Allura/allura/lib/widgets/oauth_widgets.py
+++ b/Allura/allura/lib/widgets/oauth_widgets.py
@@ -15,13 +15,10 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from pylons import tmpl_context as c
-
 import ew as ew_core
 import ew.jinja2_ew as ew
 
 from allura.lib import validators as V
-from allura import model as M
 
 from .form_fields import AutoResizeTextarea
 from .forms import ForgeForm

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/widgets/project_list.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/project_list.py b/Allura/allura/lib/widgets/project_list.py
index 343c1ba..af209cb 100644
--- a/Allura/allura/lib/widgets/project_list.py
+++ b/Allura/allura/lib/widgets/project_list.py
@@ -18,7 +18,7 @@
 import ew as ew_core
 import ew.jinja2_ew as ew
 
-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 allura.lib.security import Credentials

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/widgets/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/repo.py b/Allura/allura/lib/widgets/repo.py
index cda4ebf..4017952 100644
--- a/Allura/allura/lib/widgets/repo.py
+++ b/Allura/allura/lib/widgets/repo.py
@@ -15,8 +15,6 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import pylons
-
 import ew as ew_core
 import ew.jinja2_ew as ew
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/lib/widgets/subscriptions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/subscriptions.py b/Allura/allura/lib/widgets/subscriptions.py
index 687178a..dec1274 100644
--- a/Allura/allura/lib/widgets/subscriptions.py
+++ b/Allura/allura/lib/widgets/subscriptions.py
@@ -15,8 +15,6 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-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/Allura/allura/model/artifact.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/artifact.py b/Allura/allura/model/artifact.py
index faeb1cb..8a01c42 100644
--- a/Allura/allura/model/artifact.py
+++ b/Allura/allura/model/artifact.py
@@ -16,11 +16,9 @@
 #       under the License.
 
 import logging
-import cPickle as pickle
 from collections import defaultdict
 from datetime import datetime
 
-import bson
 import pymongo
 from pylons import tmpl_context as c, app_globals as g
 from pylons import request
@@ -33,11 +31,11 @@ from webhelpers import feedgenerator as FG
 
 from allura.lib import helpers as h
 from allura.lib import security
-from .session import main_doc_session, main_orm_session
-from .session import project_doc_session, project_orm_session
+from .session import main_orm_session
+from .session import project_orm_session
 from .session import artifact_orm_session
 from .index import ArtifactReference
-from .types import ACL, ACE, MarkdownCache
+from .types import ACL, MarkdownCache
 from .project import AppConfig
 from .notification import MailFooter
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index c2e9097..bac0568 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -531,7 +531,6 @@ class User(MappedClass, ActivityNode, ActivityObject):
             convtime2 = loctime2.astimezone(chosentimezone)
 
             dif_days_start = convtime1.weekday() - today.weekday()
-            dif_days_end = convtime2.weekday() - today.weekday()
             index = (week_day.index(t['week_day']) + dif_days_start) % 7
             week_day_start = week_day[index]
             week_day_end = week_day[index]

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/filesystem.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/filesystem.py b/Allura/allura/model/filesystem.py
index 54b7a18..af1dea1 100644
--- a/Allura/allura/model/filesystem.py
+++ b/Allura/allura/model/filesystem.py
@@ -19,10 +19,8 @@ import os
 from cStringIO import StringIO
 import logging
 
-import pylons
 import PIL
 from gridfs import GridFS
-from tg import config
 
 from ming import schema
 from ming.orm import session, FieldProperty

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/neighborhood.py b/Allura/allura/model/neighborhood.py
index e2137e2..7b526d2 100644
--- a/Allura/allura/model/neighborhood.py
+++ b/Allura/allura/model/neighborhood.py
@@ -21,7 +21,7 @@ import logging
 from collections import OrderedDict
 
 from ming import schema as S
-from ming.orm import FieldProperty, RelationProperty, ForeignIdProperty
+from ming.orm import FieldProperty, RelationProperty
 from ming.orm.declarative import MappedClass
 from ming.utils import LazyProperty
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/notification.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/notification.py b/Allura/allura/model/notification.py
index 10689f1..3bb81fc 100644
--- a/Allura/allura/model/notification.py
+++ b/Allura/allura/model/notification.py
@@ -52,7 +52,7 @@ from allura.lib import security
 from allura.lib.utils import take_while_true
 import allura.tasks.mail_tasks
 
-from .session import main_orm_session, project_orm_session
+from .session import main_orm_session
 from .auth import User
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/oauth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/oauth.py b/Allura/allura/model/oauth.py
index 670847a..fe21cc1 100644
--- a/Allura/allura/model/oauth.py
+++ b/Allura/allura/model/oauth.py
@@ -25,8 +25,7 @@ from ming.orm import FieldProperty, RelationProperty, ForeignIdProperty
 from ming.orm.declarative import MappedClass
 
 from allura.lib import helpers as h
-from .session import main_doc_session, main_orm_session
-from .session import project_doc_session, project_orm_session
+from .session import main_orm_session
 from .types import MarkdownCache
 
 log = logging.getLogger(__name__)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/openid_model.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/openid_model.py b/Allura/allura/model/openid_model.py
index adcf179..3a51954 100644
--- a/Allura/allura/model/openid_model.py
+++ b/Allura/allura/model/openid_model.py
@@ -24,8 +24,7 @@ from openid.association import Association
 
 from ming.orm import FieldProperty
 from ming.orm.declarative import MappedClass
-from .session import main_doc_session, main_orm_session
-from .session import project_doc_session, project_orm_session
+from .session import main_orm_session
 
 
 class OpenIdAssociation(MappedClass):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 1a52092..6d40cd8 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -15,7 +15,6 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import os
 import logging
 from collections import Counter, OrderedDict
 from datetime import datetime
@@ -45,7 +44,7 @@ from allura.lib.security import has_access
 from allura.model.types import MarkdownCache
 
 from .session import main_orm_session
-from .session import project_orm_session, project_doc_session
+from .session import project_orm_session
 from .neighborhood import Neighborhood
 from .auth import ProjectRole, User
 from .timeline import ActivityNode, ActivityObject
@@ -688,7 +687,7 @@ class Project(MappedClass, ActivityNode, ActivityObject):
         try:
             provider.shortname_validator.to_python(
                 name, check_allowed=False, neighborhood=self.neighborhood)
-        except exceptions.Invalid as e:
+        except exceptions.Invalid:
             raise exceptions.ToolError, 'Mount point "%s" is invalid' % name
         return provider.register_subproject(self, name, user or c.user, install_apps, project_name=project_name)
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 9396151..a137e7a 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -17,7 +17,6 @@
 
 import os
 import re
-import sys
 import logging
 from hashlib import sha1
 from itertools import chain
@@ -40,8 +39,8 @@ from allura.lib import helpers as h
 from allura.lib.security import has_access
 
 from .auth import User
-from .project import AppConfig, Project
-from .session import main_doc_session, project_doc_session
+from .project import AppConfig
+from .session import main_doc_session
 from .session import repository_orm_session
 from .timeline import ActivityObject
 
@@ -255,7 +254,7 @@ class Commit(RepoObject, ActivityObject):
                 return None
             ci.set_context(self.repo)
             return ci
-        except IndexError as e:
+        except IndexError:
             return None
 
     def climb_commit_tree(self, predicate=None):
@@ -716,12 +715,12 @@ class Blob(object):
         if prev is not None:
             try:
                 prev = prev.get_path(path, create=False)
-            except KeyError as e:
+            except KeyError:
                 prev = None
         if next is not None:
             try:
                 next = next.get_path(path, create=False)
-            except KeyError as e:
+            except KeyError:
                 next = None
         return dict(
             prev=prev,

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 732d6a5..c34739a 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -32,7 +32,7 @@ from ming.orm import mapper, session, ThreadLocalORMSession
 from allura.lib import utils
 from allura.lib import helpers as h
 from allura.model.repo import CommitDoc, TreeDoc, TreesDoc, DiffInfoDoc
-from allura.model.repo import LastCommitDoc, CommitRunDoc
+from allura.model.repo import CommitRunDoc
 from allura.model.repo import Commit, Tree, LastCommit, ModelCache
 from allura.model.index import ArtifactReferenceDoc, ShortlinkDoc
 from allura.model.auth import User

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index aaa97cc..a328b3e 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -15,28 +15,23 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import sys
 import os
 import stat
-import errno
 import mimetypes
 import logging
 import string
 import re
 from subprocess import Popen, PIPE
-from difflib import SequenceMatcher
 from hashlib import sha1
 from datetime import datetime
 from time import time
 from collections import defaultdict
-from itertools import izip
 from urlparse import urljoin
-from urllib import quote
 from threading import Thread
 from Queue import Queue
 
 import tg
-from paste.deploy.converters import asbool, asint
+from paste.deploy.converters import asint
 from pylons import tmpl_context as c
 from pylons import app_globals as g
 import pymongo
@@ -45,17 +40,13 @@ import pymongo.errors
 from ming import schema as S
 from ming.utils import LazyProperty
 from ming.orm import FieldProperty, session, Mapper
-from ming.orm.declarative import MappedClass
 
 from allura.lib import helpers as h
 from allura.lib import utils
 
-from .artifact import Artifact, VersionedArtifact, Feed
+from .artifact import Artifact, VersionedArtifact
 from .auth import User
-from .session import repository_orm_session, project_orm_session
-from .notification import Notification
 from .repo_refresh import refresh_repo, unknown_commit_ids as unknown_commit_ids_repo
-from .repo import CommitRunDoc, QSIZE
 from .timeline import ActivityObject
 from .monq_model import MonQTask
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/session.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/session.py b/Allura/allura/model/session.py
index 92f339d..cdd3500 100644
--- a/Allura/allura/model/session.py
+++ b/Allura/allura/model/session.py
@@ -83,7 +83,6 @@ class ArtifactSessionExtension(SessionExtension):
 
     def update_index(self, objects_deleted, arefs):
         # Post delete and add indexing operations
-        from allura.tasks import index_tasks
         if objects_deleted:
             index_tasks.del_artifacts.post(
                 [obj.index_id() for obj in objects_deleted])

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/model/stats.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/stats.py b/Allura/allura/model/stats.py
index 03423e5..cbb71dd 100644
--- a/Allura/allura/model/stats.py
+++ b/Allura/allura/model/stats.py
@@ -16,23 +16,17 @@
 #       under the License.
 
 from datetime import datetime
-import pymongo
-from pylons import tmpl_context as c, app_globals as g
-from pylons import request
 from tg import config
 from paste.deploy.converters import asbool
 
-import bson
 from ming import schema as S
-from ming import Field, Index, collection
-from ming.orm import session, state, Mapper
+from ming.orm import Mapper
 from ming.orm import FieldProperty
 from ming.orm.declarative import MappedClass
-from datetime import datetime, timedelta
+from datetime import timedelta
 import difflib
 
 from allura.model.session import main_orm_session
-from allura.lib import helpers as h
 
 
 class Stats(MappedClass):
@@ -194,8 +188,6 @@ class Stats(MappedClass):
     # to which programming language should be credited a line of code modified
     # within a project including two or more languages.
     def getCommitsByLanguage(self):
-        langlist = []
-        by_lang = {}
         i = getElementIndex(self.general, category=None)
         if i is None:
             return dict(number=0, lines=0)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/scripts/refresh_last_commits.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/refresh_last_commits.py b/Allura/allura/scripts/refresh_last_commits.py
index b5cda5c..720af10 100644
--- a/Allura/allura/scripts/refresh_last_commits.py
+++ b/Allura/allura/scripts/refresh_last_commits.py
@@ -15,11 +15,8 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-import sys
 import argparse
 import logging
-import re
-from math import pow, log10
 from datetime import datetime
 from contextlib import contextmanager
 
@@ -28,7 +25,6 @@ from pylons import tmpl_context as c
 from ming.orm import ThreadLocalORMSession, session
 
 from allura import model as M
-from allura.lib import helpers as h
 from allura.lib.utils import chunked_find
 from allura.tasks.repo_tasks import refresh
 from allura.scripts import ScriptTask

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/scripts/refreshrepo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/refreshrepo.py b/Allura/allura/scripts/refreshrepo.py
index 1e0c3ee..c7ac08d 100644
--- a/Allura/allura/scripts/refreshrepo.py
+++ b/Allura/allura/scripts/refreshrepo.py
@@ -17,7 +17,6 @@
 
 import argparse
 import logging
-import re
 
 import faulthandler
 from pylons import tmpl_context as c

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/scripts/trac_export.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/trac_export.py b/Allura/allura/scripts/trac_export.py
index f5cd7c3..5f2f8d4 100644
--- a/Allura/allura/scripts/trac_export.py
+++ b/Allura/allura/scripts/trac_export.py
@@ -28,7 +28,6 @@ import re
 from optparse import OptionParser
 from itertools import islice
 
-import feedparser
 from BeautifulSoup import BeautifulSoup, NavigableString
 import dateutil.parser
 import pytz

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tasks/export_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/export_tasks.py b/Allura/allura/tasks/export_tasks.py
index cafb288..b146a00 100644
--- a/Allura/allura/tasks/export_tasks.py
+++ b/Allura/allura/tasks/export_tasks.py
@@ -19,12 +19,10 @@ import os
 import os.path
 import logging
 import shutil
-from tempfile import mkstemp
 
 import tg
 from pylons import app_globals as g, tmpl_context as c
 
-from allura import model as M
 from allura.tasks import mail_tasks
 from allura.lib.decorators import task
 from allura.lib import helpers as h
@@ -113,7 +111,7 @@ class BulkExport(object):
         try:
             with open(json_file, 'w') as f:
                 app.bulk_export(f)
-        except Exception as e:
+        except Exception:
             log.error('Error exporting: %s on %s', tool,
                       app.project.shortname, exc_info=True)
             return None

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tasks/repo_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/repo_tasks.py b/Allura/allura/tasks/repo_tasks.py
index df84337..fe476eb 100644
--- a/Allura/allura/tasks/repo_tasks.py
+++ b/Allura/allura/tasks/repo_tasks.py
@@ -47,7 +47,7 @@ def clone(cloned_from_path, cloned_from_name, cloned_from_url):
             c.user, c.app.repo, 'created',
             text='Repository %s/%s created' % (
                 c.project.shortname, c.app.config.options.mount_point))
-    except Exception, e:
+    except Exception:
         g.post_event('repo_clone_task_failed', cloned_from_url,
                      cloned_from_path, traceback.format_exc())
 
@@ -126,7 +126,7 @@ def reclone_repo(*args, **kwargs):
             c.user, c.app.repo, 'created',
             text='Repository %s/%s created' % (
                 c.project.shortname, c.app.config.options.mount_point))
-    except Exception, e:
+    except Exception:
         g.post_event('repo_clone_task_failed', source_url,
                      source_path, traceback.format_exc())
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index a7fb5bf..78cdbcb 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -18,7 +18,6 @@
 import re
 import os
 import allura
-import shutil
 import pkg_resources
 import StringIO
 from contextlib import contextmanager
@@ -30,8 +29,6 @@ from ming.orm.ormsession import ThreadLocalORMSession
 from tg import expose
 from pylons import tmpl_context as c, app_globals as g
 import mock
-from BeautifulSoup import BeautifulSoup
-from webtest.app import AppError
 
 
 try:
@@ -46,10 +43,8 @@ from allura import model as M
 from allura.app import SitemapEntry
 from allura.lib.plugin import AdminExtension
 from allura.ext.admin.admin_main import AdminApp
-from allura.lib.security import has_access
 
 from forgetracker.tracker_main import ForgeTrackerApp
-from forgewiki.model import Page
 from forgewiki.wiki_main import ForgeWikiApp
 
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_auth.py b/Allura/allura/tests/functional/test_auth.py
index d9362d4..c892f87 100644
--- a/Allura/allura/tests/functional/test_auth.py
+++ b/Allura/allura/tests/functional/test_auth.py
@@ -15,6 +15,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
+from datetime import datetime, time, timedelta
 import re
 import json
 from bson import ObjectId
@@ -35,12 +36,9 @@ from allura.tests import decorators as td
 from allura import model as M
 from ming.orm.ormsession import ThreadLocalORMSession, session
 from allura.lib import oid_helper
-from allura.lib.helpers import push_config
 from tg import config
 from mock import patch
-import datetime
 from allura.lib import plugin
-from pylons import request
 
 
 def unentity(s):
@@ -50,7 +48,7 @@ def unentity(s):
 class TestAuth(TestController):
 
     def test_login(self):
-        result = self.app.get('/auth/')
+        self.app.get('/auth/')
         r = self.app.post('/auth/send_verification_link',
                           params=dict(a='test@example.com'))
         email = M.User.query.get(username='test-admin').email_addresses[0]
@@ -210,7 +208,7 @@ class TestAuth(TestController):
     @mock.patch('allura.controllers.auth.verify_oid')
     def test_login_verify_oid_with_provider(self, verify_oid):
         verify_oid.return_value = dict()
-        result = self.app.get('/auth/login_verify_oid', params=dict(
+        self.app.get('/auth/login_verify_oid', params=dict(
             provider='http://www.google.com/accounts/o8/id', username='rick446@usa.net'),
             status=200)
         verify_oid.assert_called_with('http://www.google.com/accounts/o8/id',
@@ -222,7 +220,7 @@ class TestAuth(TestController):
     @mock.patch('allura.controllers.auth.verify_oid')
     def test_login_verify_oid_without_provider(self, verify_oid):
         verify_oid.return_value = dict()
-        result = self.app.get('/auth/login_verify_oid', params=dict(
+        self.app.get('/auth/login_verify_oid', params=dict(
             provider='', username='rick446@usa.net'),
             status=200)
         verify_oid.assert_called_with('rick446@usa.net',
@@ -275,7 +273,7 @@ class TestAuth(TestController):
     @mock.patch('allura.controllers.auth.verify_oid')
     def test_claim_verify_oid_with_provider(self, verify_oid):
         verify_oid.return_value = dict()
-        result = self.app.get('/auth/claim_verify_oid', params=dict(
+        self.app.get('/auth/claim_verify_oid', params=dict(
             provider='http://www.google.com/accounts/o8/id', username='rick446@usa.net'),
             status=200)
         verify_oid.assert_called_with('http://www.google.com/accounts/o8/id',
@@ -287,7 +285,7 @@ class TestAuth(TestController):
     @mock.patch('allura.controllers.auth.verify_oid')
     def test_claim_verify_oid_without_provider(self, verify_oid):
         verify_oid.return_value = dict()
-        result = self.app.get('/auth/claim_verify_oid', params=dict(
+        self.app.get('/auth/claim_verify_oid', params=dict(
             provider='', username='rick446@usa.net'),
             status=200)
         verify_oid.assert_called_with('rick446@usa.net',
@@ -404,7 +402,7 @@ class TestAuth(TestController):
         user = M.User.query.get(username='aaa')
         assert M.ProjectRole.query.find(
             dict(user_id=user._id, project_id=p._id)).count() == 0
-        r = self.app.get('/p/test/admin/permissions',
+        self.app.get('/p/test/admin/permissions',
                          extra_environ=dict(username='aaa'), status=403)
         assert M.ProjectRole.query.find(
             dict(user_id=user._id, project_id=p._id)).count() <= 1
@@ -439,7 +437,7 @@ class TestPreferences(TestController):
         from pytz import country_names
         setsex, setbirthdate, setcountry, setcity, settimezone = \
             ('Male', '19/08/1988', 'IT', 'Milan', 'Europe/Rome')
-        result = self.app.get('/auth/user_info/')
+        self.app.get('/auth/user_info/')
 
         # Check if personal data is properly set
         r = self.app.post('/auth/user_info/change_personal_data',
@@ -492,8 +490,8 @@ class TestPreferences(TestController):
     def test_contacts(self):
         # Add skype account
         testvalue = 'testaccount'
-        result = self.app.get('/auth/user_info/contacts/')
-        r = self.app.post('/auth/user_info/contacts/skype_account',
+        self.app.get('/auth/user_info/contacts/')
+        self.app.post('/auth/user_info/contacts/skype_account',
                           params=dict(skypeaccount=testvalue))
         user = M.User.query.get(username='test-admin')
         assert user.skypeaccount == testvalue
@@ -501,7 +499,7 @@ class TestPreferences(TestController):
         # Add social network account
         socialnetwork = 'Facebook'
         accounturl = 'http://www.facebook.com/test'
-        r = self.app.post('/auth/user_info/contacts/add_social_network',
+        self.app.post('/auth/user_info/contacts/add_social_network',
                           params=dict(socialnetwork=socialnetwork,
                                       accounturl=accounturl))
         user = M.User.query.get(username='test-admin')
@@ -512,7 +510,7 @@ class TestPreferences(TestController):
         # Add second social network account
         socialnetwork2 = 'Twitter'
         accounturl2 = 'http://twitter.com/test'
-        r = self.app.post('/auth/user_info/contacts/add_social_network',
+        self.app.post('/auth/user_info/contacts/add_social_network',
                           params=dict(socialnetwork=socialnetwork2,
                                       accounturl='@test'))
         user = M.User.query.get(username='test-admin')
@@ -521,7 +519,7 @@ class TestPreferences(TestController):
              {'socialnetwork': socialnetwork2, 'accounturl': accounturl2} in user.socialnetworks)
 
         # Remove first social network account
-        r = self.app.post('/auth/user_info/contacts/remove_social_network',
+        self.app.post('/auth/user_info/contacts/remove_social_network',
                           params=dict(socialnetwork=socialnetwork,
                                       account=accounturl))
         user = M.User.query.get(username='test-admin')
@@ -530,7 +528,7 @@ class TestPreferences(TestController):
              accounturl2} in user.socialnetworks
 
         # Add empty social network account
-        r = self.app.post('/auth/user_info/contacts/add_social_network',
+        self.app.post('/auth/user_info/contacts/add_social_network',
                           params=dict(accounturl=accounturl, socialnetwork=''))
         user = M.User.query.get(username='test-admin')
         assert len(user.socialnetworks) == 1 and \
@@ -538,7 +536,7 @@ class TestPreferences(TestController):
              accounturl2} in user.socialnetworks
 
         # Add invalid social network account
-        r = self.app.post('/auth/user_info/contacts/add_social_network',
+        self.app.post('/auth/user_info/contacts/add_social_network',
                           params=dict(accounturl=accounturl, socialnetwork='invalid'))
         user = M.User.query.get(username='test-admin')
         assert len(user.socialnetworks) == 1 and \
@@ -547,7 +545,7 @@ class TestPreferences(TestController):
 
         # Add telephone number
         telnumber = '+3902123456'
-        r = self.app.post('/auth/user_info/contacts/add_telnumber',
+        self.app.post('/auth/user_info/contacts/add_telnumber',
                           params=dict(newnumber=telnumber))
         user = M.User.query.get(username='test-admin')
         assert (len(user.telnumbers)
@@ -555,49 +553,47 @@ class TestPreferences(TestController):
 
         # Add second telephone number
         telnumber2 = '+3902654321'
-        r = self.app.post('/auth/user_info/contacts/add_telnumber',
+        self.app.post('/auth/user_info/contacts/add_telnumber',
                           params=dict(newnumber=telnumber2))
         user = M.User.query.get(username='test-admin')
         assert (len(user.telnumbers)
                 == 2 and telnumber in user.telnumbers and telnumber2 in user.telnumbers)
 
         # Remove first telephone number
-        r = self.app.post('/auth/user_info/contacts/remove_telnumber',
+        self.app.post('/auth/user_info/contacts/remove_telnumber',
                           params=dict(oldvalue=telnumber))
         user = M.User.query.get(username='test-admin')
         assert (len(user.telnumbers) == 1 and telnumber2 in user.telnumbers)
 
         # Add website
         website = 'http://www.testurl.com'
-        r = self.app.post('/auth/user_info/contacts/add_webpage',
+        self.app.post('/auth/user_info/contacts/add_webpage',
                           params=dict(newwebsite=website))
         user = M.User.query.get(username='test-admin')
         assert (len(user.webpages) == 1 and (website in user.webpages))
 
         # Add second website
         website2 = 'http://www.testurl2.com'
-        r = self.app.post('/auth/user_info/contacts/add_webpage',
+        self.app.post('/auth/user_info/contacts/add_webpage',
                           params=dict(newwebsite=website2))
         user = M.User.query.get(username='test-admin')
         assert (len(user.webpages)
                 == 2 and website in user.webpages and website2 in user.webpages)
 
         # Remove first website
-        r = self.app.post('/auth/user_info/contacts/remove_webpage',
+        self.app.post('/auth/user_info/contacts/remove_webpage',
                           params=dict(oldvalue=website))
         user = M.User.query.get(username='test-admin')
         assert (len(user.webpages) == 1 and website2 in user.webpages)
 
     @td.with_user_project('test-admin')
     def test_availability(self):
-        from datetime import time
-
         # Add availability timeslot
         weekday = 'Monday'
         starttime = time(9, 0, 0)
         endtime = time(12, 0, 0)
 
-        result = self.app.get('/auth/user_info/availability/')
+        self.app.get('/auth/user_info/availability/')
         r = self.app.post('/auth/user_info/availability/add_timeslot',
                           params=dict(
                               weekday=weekday,
@@ -650,14 +646,12 @@ class TestPreferences(TestController):
 
     @td.with_user_project('test-admin')
     def test_inactivity(self):
-        from datetime import datetime, timedelta
-
         # Add inactivity period
         now = datetime.utcnow().date()
         now = datetime(now.year, now.month, now.day)
         startdate = now + timedelta(days=1)
         enddate = now + timedelta(days=7)
-        result = self.app.get('/auth/user_info/availability/')
+        self.app.get('/auth/user_info/availability/')
         r = self.app.post('/auth/user_info/availability/add_inactive_period',
                           params=dict(
                               startdate=startdate.strftime('%d/%m/%Y'),
@@ -701,8 +695,6 @@ class TestPreferences(TestController):
 
     @td.with_user_project('test-admin')
     def test_skills(self):
-        from datetime import datetime
-
         # Add a skill
         skill_cat = M.TroveCategory.query.get(show_as_skill=True)
         level = 'low'
@@ -745,8 +737,8 @@ class TestPreferences(TestController):
         assert len(user.skills) == 1 and skilldict in user.skills
 
         # Remove a skill
-        result = self.app.get('/auth/user_info/skills/')
-        r = self.app.post('/auth/user_info/skills/remove_skill',
+        self.app.get('/auth/user_info/skills/')
+        self.app.post('/auth/user_info/skills/remove_skill',
                           params=dict(
                               categoryid=str(skill_cat.trove_cat_id)))
         user = M.User.query.get(username='test-admin')
@@ -775,7 +767,7 @@ class TestPasswordReset(TestController):
             {'claimed_by_user_id': user._id}).first()
         email.confirmed = False
         ThreadLocalORMSession.flush_all()
-        r = self.app.post('/auth/password_recovery_hash', {'email': email._id})
+        self.app.post('/auth/password_recovery_hash', {'email': email._id})
         hash = user.get_tool_data('AuthPasswordReset', 'hash')
         assert hash is None
 
@@ -787,7 +779,7 @@ class TestPasswordReset(TestController):
             {'claimed_by_user_id': user._id}).first()
         user.disabled = True
         ThreadLocalORMSession.flush_all()
-        r = self.app.post('/auth/password_recovery_hash', {'email': email._id})
+        self.app.post('/auth/password_recovery_hash', {'email': email._id})
         hash = user.get_tool_data('AuthPasswordReset', 'hash')
         assert hash is None
 
@@ -849,7 +841,7 @@ To reset your password on %s, please visit the following URL:
         user = M.User.by_username('test-admin')
         hash = user.get_tool_data('AuthPasswordReset', 'hash')
         user.set_tool_data('AuthPasswordReset',
-                           hash_expiry=datetime.datetime(2000, 10, 10))
+                           hash_expiry=datetime(2000, 10, 10))
         r = self.app.get('/auth/forgotten_password/%s' % hash.encode('utf-8'))
         assert_in('Unable to process reset, please try again', r.follow().body)
         r = self.app.post('/auth/set_new_password/%s' %
@@ -981,7 +973,7 @@ class TestOAuth(TestController):
         ThreadLocalORMSession.flush_all()
         req = Request.from_request.return_value = {
             'oauth_consumer_key': 'api_key'}
-        r = self.app.post('/rest/oauth/request_token',
+        self.app.post('/rest/oauth/request_token',
                           params={'key': 'value'}, status=403)
 
     def test_authorize_ok(self):
@@ -1004,7 +996,7 @@ class TestOAuth(TestController):
         assert_in('api_key', r.body)
 
     def test_authorize_invalid(self):
-        r = self.app.post('/rest/oauth/authorize',
+        self.app.post('/rest/oauth/authorize',
                           params={'oauth_token': 'api_key'}, status=403)
 
     def test_do_authorize_no(self):
@@ -1021,7 +1013,7 @@ class TestOAuth(TestController):
             user_id=user._id,
         )
         ThreadLocalORMSession.flush_all()
-        r = self.app.post('/rest/oauth/do_authorize',
+        self.app.post('/rest/oauth/do_authorize',
                           params={'no': '1', 'oauth_token': 'api_key'})
         assert_is_none(M.OAuthRequestToken.query.get(api_key='api_key'))
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_discuss.py b/Allura/allura/tests/functional/test_discuss.py
index 816b3d5..ca3fcbd 100644
--- a/Allura/allura/tests/functional/test_discuss.py
+++ b/Allura/allura/tests/functional/test_discuss.py
@@ -177,7 +177,7 @@ class TestDiscuss(TestController):
         thread_link = [a for a in home.html.findAll('a')
                        if 'thread' in a['href']][0]['href']
         # just make sure it doesn't 500
-        r = self.app.get('%s?limit=50&page=0' % thread_link)
+        self.app.get('%s?limit=50&page=0' % thread_link)
 
     @patch('allura.controllers.discuss.g.director.create_activity')
     def test_edit_post(self, create_activity):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_home.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_home.py b/Allura/allura/tests/functional/test_home.py
index f350b29..54c34b7 100644
--- a/Allura/allura/tests/functional/test_home.py
+++ b/Allura/allura/tests/functional/test_home.py
@@ -83,7 +83,6 @@ class TestProjectHome(TestController):
     def test_user_subproject_home_not_profile(self):
         u_proj = M.Project.query.get(shortname='u/test-admin')
         u_proj.new_subproject('sub1')
-        from ming.orm.ormsession import ThreadLocalORMSession
         ThreadLocalORMSession.flush_all()
 
         r = self.app.get('/u/test-admin/sub1/')
@@ -104,10 +103,10 @@ class TestProjectHome(TestController):
         assert j == {'users': []}
 
     def test_user_search_noparam(self):
-        r = self.app.get('/p/test/user_search', status=400)
+        self.app.get('/p/test/user_search', status=400)
 
     def test_user_search_shortparam(self):
-        r = self.app.get('/p/test/user_search?term=ad', status=400)
+        self.app.get('/p/test/user_search?term=ad', status=400)
 
     def test_users(self):
         r = self.app.get('/p/test/users', status=200)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_neighborhood.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_neighborhood.py b/Allura/allura/tests/functional/test_neighborhood.py
index 3d71949..21b8e37 100644
--- a/Allura/allura/tests/functional/test_neighborhood.py
+++ b/Allura/allura/tests/functional/test_neighborhood.py
@@ -474,7 +474,7 @@ class TestNeighborhood(TestController):
         assert 'adobe-1 evicted to Projects' in r
 
     def test_home(self):
-        r = self.app.get('/adobe/')
+        self.app.get('/adobe/')
 
     def test_register(self):
         r = self.app.get('/adobe/register', status=405)
@@ -912,7 +912,7 @@ class TestNeighborhood(TestController):
         self.app.get('/u/donald-duck/')
 
     def test_disabled_user_has_no_user_project(self):
-        user = M.User.register(dict(username='donald-duck'))
+        M.User.register(dict(username='donald-duck'))
         self.app.get('/u/donald-duck/')  # assert it's there
         M.User.query.update(dict(username='donald-duck'),
                             {'$set': {'disabled': True}})

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_rest.py b/Allura/allura/tests/functional/test_rest.py
index 328e117..03e8316 100644
--- a/Allura/allura/tests/functional/test_rest.py
+++ b/Allura/allura/tests/functional/test_rest.py
@@ -18,7 +18,6 @@
 #       under the License.
 
 from datetime import datetime, timedelta
-import json
 
 from pylons import app_globals as g
 import mock

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_root.py b/Allura/allura/tests/functional/test_root.py
index 8c7441e..0db57df 100644
--- a/Allura/allura/tests/functional/test_root.py
+++ b/Allura/allura/tests/functional/test_root.py
@@ -28,7 +28,6 @@ functional tests exercise the whole application and its WSGI stack.
 Please read http://pythonpaste.org/webtest/ for more information.
 
 """
-from tg import config
 from pylons import tmpl_context as c
 from nose.tools import assert_equal
 from ming.orm.ormsession import ThreadLocalORMSession
@@ -49,7 +48,7 @@ class TestRootController(TestController):
         assert n_adobe
         u_admin = M.User.query.get(username='test-admin')
         assert u_admin
-        p_adobe2 = n_adobe.register_project('adobe-2', u_admin)
+        n_adobe.register_project('adobe-2', u_admin)
 
     def test_index(self):
         response = self.app.get('/')
@@ -85,7 +84,6 @@ class TestRootController(TestController):
     def test_project_browse(self):
         com_cat = M.ProjectCategory.query.find(
             dict(label='Communications')).first()
-        fax_cat = M.ProjectCategory.query.find(dict(label='Fax')).first()
         M.Project.query.find(dict(shortname='adobe-1')
                              ).first().category_id = com_cat._id
         response = self.app.get('/browse')
@@ -152,8 +150,8 @@ class TestRootController(TestController):
         assert '<p><em>aaa</em>bb<a class="alink" href="/p/test/wiki/Home/">[wiki:Home]</a></p>' in r, r
 
     def test_slash_redirect(self):
-        r = self.app.get('/p', status=301)
-        r = self.app.get('/p/', status=302)
+        self.app.get('/p', status=301)
+        self.app.get('/p/', status=302)
 
     @skipif(module_not_available('newrelic'))
     def test_newrelic_set_transaction_name(self):
@@ -161,7 +159,7 @@ class TestRootController(TestController):
         with mock.patch('newrelic.agent.callable_name') as callable_name,\
                 mock.patch('newrelic.agent.set_transaction_name') as set_transaction_name:
             callable_name.return_value = 'foo'
-            r = self.app.get('/p/')
+            self.app.get('/p/')
             arg = callable_name.call_args[0][0]
             assert_equal(arg.undecorated,
                          NeighborhoodController.index.undecorated)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_search.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_search.py b/Allura/allura/tests/functional/test_search.py
index 1081f25..374d5f3 100644
--- a/Allura/allura/tests/functional/test_search.py
+++ b/Allura/allura/tests/functional/test_search.py
@@ -23,11 +23,11 @@ class TestSearch(TestController):
 
     @patch('allura.lib.search.search')
     def test_global_search_controller(self, search):
-        r = self.app.get('/gsearch/')
+        self.app.get('/gsearch/')
         assert not search.called, search.called
-        r = self.app.get('/gsearch/', params=dict(q='Root'))
+        self.app.get('/gsearch/', params=dict(q='Root'))
         assert search.called, search.called
 
     def test_project_search_controller(self):
-        r = self.app.get('/search/')
-        r = self.app.get('/search/', params=dict(q='Root'))
+        self.app.get('/search/')
+        self.app.get('/search/', params=dict(q='Root'))

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_site_admin.py b/Allura/allura/tests/functional/test_site_admin.py
index b6da963..0bbff58 100644
--- a/Allura/allura/tests/functional/test_site_admin.py
+++ b/Allura/allura/tests/functional/test_site_admin.py
@@ -46,7 +46,7 @@ class TestSiteAdmin(TestController):
         assert cells[0].contents[0] == 'Adobe', cells[0].contents[0]
 
     def test_tickets_access(self):
-        r = self.app.get('/nf/admin/api_tickets', extra_environ=dict(
+        self.app.get('/nf/admin/api_tickets', extra_environ=dict(
             username='test-user'), status=403)
 
     def test_new_projects_access(self):
@@ -110,7 +110,7 @@ class TestSiteAdmin(TestController):
         r = self.app.get('/nf/admin/task_manager',
                          extra_environ=dict(username='*anonymous'), status=302)
         import math
-        task = M.MonQTask.post(math.ceil, (12.5,))
+        M.MonQTask.post(math.ceil, (12.5,))
         r = self.app.get('/nf/admin/task_manager?page_num=1')
         assert 'math.ceil' in r, r
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/functional/test_user_profile.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_user_profile.py b/Allura/allura/tests/functional/test_user_profile.py
index 2706776..3beb105 100644
--- a/Allura/allura/tests/functional/test_user_profile.py
+++ b/Allura/allura/tests/functional/test_user_profile.py
@@ -15,10 +15,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from formencode.variabledecode import variable_encode
-
 import mock
-from nose.tools import assert_equal
 
 from allura.model import Project, User
 from allura.tests import decorators as td
@@ -34,7 +31,7 @@ class TestUserProfile(TestController):
         assert 'OpenIDs' in response
 
     def test_wrong_profile(self):
-        response = self.app.get('/u/no-such-user/profile/', status=404)
+        self.app.get('/u/no-such-user/profile/', status=404)
 
     @td.with_user_project('test-admin')
     @td.with_user_project('test-user')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/model/test_auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_auth.py b/Allura/allura/tests/model/test_auth.py
index 5dadb07..237d2ab 100644
--- a/Allura/allura/tests/model/test_auth.py
+++ b/Allura/allura/tests/model/test_auth.py
@@ -26,7 +26,6 @@ from webob import Request
 from mock import patch
 from datetime import datetime, timedelta
 
-from mock import patch
 from pymongo.errors import DuplicateKeyError
 from ming.orm.ormsession import ThreadLocalORMSession
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0ca218ab/Allura/allura/tests/model/test_discussion.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_discussion.py b/Allura/allura/tests/model/test_discussion.py
index 6a7878f..f814fad 100644
--- a/Allura/allura/tests/model/test_discussion.py
+++ b/Allura/allura/tests/model/test_discussion.py
@@ -25,18 +25,16 @@ import time
 from datetime import datetime, timedelta
 from cgi import FieldStorage
 
-from pylons import tmpl_context as c, app_globals as g
-from pylons import request, response
-from nose.tools import assert_raises, assert_equals, with_setup
+from pylons import tmpl_context as c
+from nose.tools import assert_equals, with_setup
 import mock
 from mock import patch
 from nose.tools import assert_equal
 
 from ming.orm import session, ThreadLocalORMSession
-from webob import Request, Response, exc
+from webob import exc
 
 from allura import model as M
-from allura.lib.app_globals import Globals
 from allura.lib import helpers as h
 from allura.tests import TestController
 from alluratest.controller import setup_global_objects
@@ -88,7 +86,7 @@ def test_thread_methods():
     p0 = t.post('This is a post')
     p1 = t.post('This is another post')
     time.sleep(0.25)
-    p2 = t.post('This is a reply', parent_id=p0._id)
+    t.post('This is a reply', parent_id=p0._id)
     ThreadLocalORMSession.flush_all()
     ThreadLocalORMSession.close_all()
     d = M.Discussion.query.get(shortname='test')
@@ -283,7 +281,7 @@ def test_discussion_delete():
              discussion_id=d._id,
              thread_id=t._id,
              post_id=p._id)
-    r = M.ArtifactReference.from_artifact(d)
+    M.ArtifactReference.from_artifact(d)
     rid = d.index_id()
     ThreadLocalORMSession.flush_all()
     d.delete()
@@ -323,11 +321,11 @@ def test_post_permission_check():
     t = M.Thread.new(discussion_id=d._id, subject='Test Thread')
     c.user = M.User.anonymous()
     try:
-        p1 = t.post('This post will fail the check.')
+        t.post('This post will fail the check.')
         assert False, "Expected an anonymous post to fail."
     except exc.HTTPUnauthorized:
         pass
-    p2 = t.post('This post will pass the check.', ignore_security=True)
+    t.post('This post will pass the check.', ignore_security=True)
 
 
 @with_setup(setUp, tearDown)
@@ -493,8 +491,7 @@ def test_thread_subject_not_included_in_text_checked(spam_checker):
     spam_checker.check.return_value = False
     d = M.Discussion(shortname='test', name='test')
     t = M.Thread(discussion_id=d._id, subject='Test Thread')
-    admin = M.User.by_username('test-admin')
-    post = t.post('Hello')
+    t.post('Hello')
     spam_checker.check.assert_called_once()
     assert_equal(spam_checker.check.call_args[0][0], 'Hello')
 
@@ -502,9 +499,9 @@ def test_thread_subject_not_included_in_text_checked(spam_checker):
 def test_post_count():
     d = M.Discussion(shortname='test', name='test')
     t = M.Thread(discussion_id=d._id, subject='Test Thread')
-    p1 = M.Post(discussion_id=d._id, thread_id=t._id, status='spam')
-    p2 = M.Post(discussion_id=d._id, thread_id=t._id, status='ok')
-    p3 = M.Post(discussion_id=d._id, thread_id=t._id, status='pending')
+    M.Post(discussion_id=d._id, thread_id=t._id, status='spam')
+    M.Post(discussion_id=d._id, thread_id=t._id, status='ok')
+    M.Post(discussion_id=d._id, thread_id=t._id, status='pending')
     ThreadLocalORMSession.flush_all()
     assert_equal(t.post_count, 2)
 


Mime
View raw message