@@ -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
@@ -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 = []
@@ -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
@@ -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):
@@ -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):
@@ -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):
@@ -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
@@ -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
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 <guilherme.salgado@linaro.org> --- 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(-)