[PATCH] Remove unused imports.
Guilherme Salgado
guilherme.salgado at linaro.org
Wed Feb 23 01:05:03 EST 2011
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.
---
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 +----
6 files changed, 9 insertions(+), 32 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
More information about the Patchwork
mailing list