From patchwork Wed Mar 9 11:15:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guilherme Salgado X-Patchwork-Id: 86099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id AB9D01007D7 for ; Wed, 9 Mar 2011 22:15:14 +1100 (EST) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by ozlabs.org (Postfix) with ESMTP id 0DC3C1007D2 for ; Wed, 9 Mar 2011 22:15:13 +1100 (EST) Received: from youngberry.canonical.com ([91.189.89.112]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1PxHME-0004ll-PI; Wed, 09 Mar 2011 11:15:10 +0000 Received: from [187.126.154.250] (helo=feioso) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1PxHME-0008PV-5B; Wed, 09 Mar 2011 11:15:10 +0000 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by feioso (Postfix) with ESMTP id 49685420A8; Wed, 9 Mar 2011 08:15:06 -0300 (BRT) Subject: [PATCH] Remove unused imports. To: patchwork@lists.ozlabs.org From: Guilherme Salgado Date: Wed, 09 Mar 2011 08:15:06 -0300 Message-ID: <20110309111506.23862.19183.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 Cc: patches@linaro.org X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org This is so that we can use static analysis tools like pyflakes to find undefined names (and other common mistakes we often make) without being swamped with unused imports warnings. Signed-off-by: Guilherme Salgado --- apps/patchwork/models.py | 4 +--- apps/patchwork/utils.py | 5 ++--- apps/patchwork/views/base.py | 5 ----- apps/patchwork/views/bundle.py | 1 - apps/patchwork/views/patch.py | 14 +++----------- apps/patchwork/views/project.py | 3 +-- apps/patchwork/views/user.py | 13 ++++--------- apps/patchwork/views/xmlrpc.py | 5 +---- 8 files changed, 12 insertions(+), 38 deletions(-) diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py index 6842622..010e3b5 100644 --- a/apps/patchwork/models.py +++ b/apps/patchwork/models.py @@ -21,12 +21,10 @@ from django.db import models from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.contrib.sites.models import Site -from django.conf import settings from patchwork.parser import hash_patch import re import datetime, time -import string import random try: @@ -322,7 +320,7 @@ class Bundle(models.Model): return self.patches.all().count() def ordered_patches(self): - return self.patches.order_by('bundlepatch__order'); + return self.patches.order_by('bundlepatch__order') def append_patch(self, patch): # todo: use the aggregate queries in django 1.1 diff --git a/apps/patchwork/utils.py b/apps/patchwork/utils.py index fa26aef..3f2b433 100644 --- a/apps/patchwork/utils.py +++ b/apps/patchwork/utils.py @@ -19,9 +19,8 @@ from patchwork.forms import MultiplePatchForm -from patchwork.models import Bundle, Project, BundlePatch, State, UserProfile -from django.conf import settings -from django.shortcuts import render_to_response, get_object_or_404 +from patchwork.models import Bundle, Project, BundlePatch, UserProfile +from django.shortcuts import get_object_or_404 def get_patch_ids(d, prefix = 'patch_id'): ids = [] diff --git a/apps/patchwork/views/base.py b/apps/patchwork/views/base.py index bb78fa4..2f6b602 100644 --- a/apps/patchwork/views/base.py +++ b/apps/patchwork/views/base.py @@ -19,13 +19,8 @@ from patchwork.models import Patch, Project, Person -from patchwork.filters import Filters -from patchwork.forms import LoginForm, PatchForm from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect, Http404 -from django.db import transaction -from django.contrib.auth.models import User -from django.contrib.auth.decorators import login_required from patchwork.requestcontext import PatchworkRequestContext from django.core import serializers, urlresolvers from django.template.loader import render_to_string diff --git a/apps/patchwork/views/bundle.py b/apps/patchwork/views/bundle.py index 18beb08..fffa9ca 100644 --- a/apps/patchwork/views/bundle.py +++ b/apps/patchwork/views/bundle.py @@ -28,7 +28,6 @@ from patchwork.utils import get_patch_ids from patchwork.forms import BundleForm, DeleteBundleForm from patchwork.views import generic_list from patchwork.filters import DelegateFilter -from patchwork.paginator import Paginator @login_required def setbundle(request): diff --git a/apps/patchwork/views/patch.py b/apps/patchwork/views/patch.py index 3dac149..1411cc4 100644 --- a/apps/patchwork/views/patch.py +++ b/apps/patchwork/views/patch.py @@ -18,19 +18,11 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from patchwork.models import Patch, Project, Person, Bundle -from patchwork.filters import Filters -from patchwork.forms import PatchForm, MultiplePatchForm, CreateBundleForm -from patchwork.utils import get_patch_ids, set_patches, Order +from patchwork.models import Patch, Project, Bundle +from patchwork.forms import PatchForm, CreateBundleForm from patchwork.requestcontext import PatchworkRequestContext from django.shortcuts import render_to_response, get_object_or_404 -from django.http import HttpResponse, HttpResponseRedirect, \ - HttpResponseForbidden -from django.contrib.auth.models import User -from django.contrib.auth.decorators import login_required -from django.contrib.auth import authenticate, login -import django.core.urlresolvers -from patchwork.paginator import Paginator +from django.http import HttpResponse, HttpResponseForbidden from patchwork.views import generic_list def patch(request, patch_id): diff --git a/apps/patchwork/views/project.py b/apps/patchwork/views/project.py index 798e8a7..05f0912 100644 --- a/apps/patchwork/views/project.py +++ b/apps/patchwork/views/project.py @@ -18,10 +18,9 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from patchwork.models import Patch, Project, Person +from patchwork.models import Patch, Project from django.shortcuts import render_to_response, get_object_or_404 from django.contrib.auth.models import User -from django.contrib.auth.decorators import login_required from patchwork.requestcontext import PatchworkRequestContext def project(request, project_id): diff --git a/apps/patchwork/views/user.py b/apps/patchwork/views/user.py index 8358cbd..a16fd86 100644 --- a/apps/patchwork/views/user.py +++ b/apps/patchwork/views/user.py @@ -21,18 +21,13 @@ from django.contrib.auth.decorators import login_required from patchwork.requestcontext import PatchworkRequestContext from django.shortcuts import render_to_response, get_object_or_404 -from django.contrib import auth -from django.http import HttpResponse, HttpResponseRedirect -from patchwork.models import Project, Patch, Bundle, Person, UserProfile, \ - UserPersonConfirmation, State -from patchwork.forms import MultiplePatchForm, UserProfileForm, \ - UserPersonLinkForm -from patchwork.utils import Order, get_patch_ids +from django.http import HttpResponseRedirect +from patchwork.models import ( + Project, Bundle, Person, UserPersonConfirmation, State) +from patchwork.forms import UserProfileForm, UserPersonLinkForm from patchwork.filters import DelegateFilter -from patchwork.paginator import Paginator from patchwork.views import generic_list from django.template.loader import render_to_string -from django.template import Context from django.conf import settings from django.core.mail import send_mail import django.core.urlresolvers diff --git a/apps/patchwork/views/xmlrpc.py b/apps/patchwork/views/xmlrpc.py index 0d3321f..37b8eb4 100644 --- a/apps/patchwork/views/xmlrpc.py +++ b/apps/patchwork/views/xmlrpc.py @@ -20,15 +20,12 @@ # Patchwork XMLRPC interface # -from django.core.exceptions import ImproperlyConfigured from SimpleXMLRPCServer import SimpleXMLRPCDispatcher from django.http import HttpResponse, HttpResponseRedirect, \ HttpResponseServerError -from django.conf import settings from django.core import urlresolvers -from django.shortcuts import render_to_response from django.contrib.auth import authenticate -from patchwork.models import Patch, Project, Person, Bundle, State +from patchwork.models import Patch, Project, Person, State from django.views.decorators.csrf import csrf_exempt import sys