From patchwork Tue Mar 7 19:46:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 736351 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vd6cq3sS9z9sND for ; Wed, 8 Mar 2017 06:47:23 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="jkOE0g4M"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vd6cq2NHZzDqYY for ; Wed, 8 Mar 2017 06:47:23 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="jkOE0g4M"; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from relay1001.mymailcheap.com (relay1001.mymailcheap.com [176.31.80.71]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vd6c42WnhzDqXy for ; Wed, 8 Mar 2017 06:46:44 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="jkOE0g4M"; dkim-atps=neutral Received: from filter1001.mymailcheap.com (filter1001.mymailcheap.com [158.69.67.251]) by relay1001.mymailcheap.com (Postfix) with ESMTPS id 9E40A1E0B7 for ; Tue, 7 Mar 2017 20:46:39 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by filter1001.mymailcheap.com (Postfix) with ESMTP id A0CCA2004A for ; Tue, 7 Mar 2017 19:46:39 +0000 (UTC) Authentication-Results: filter1001.mymailcheap.com; dkim=permerror reason="key not found" header.d=that.guru header.i=@that.guru header.b=jkOE0g4M; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at filter1001.mymailcheap.com Received: from filter1001.mymailcheap.com ([127.0.0.1]) by localhost (filter1001.mymailcheap.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RVZ-Y4cYE3qL for ; Tue, 7 Mar 2017 19:46:38 +0000 (UTC) Received: from one.mxroute.com (one-outgoing.mxroute.com [23.92.70.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by filter1001.mymailcheap.com (Postfix) with ESMTPS for ; Tue, 7 Mar 2017 19:46:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1z1hhdbPFHbAQzqpyx3P1/tVTDjeTl36Qon4p7wbW+g=; b=jkOE0g4MQ42d6ly2ppAd8xpYKK hiaxsVLmWQ9jkRXXpF+uTRaK4OqyIQHhcYYgEpcZPB9YOg5VkbGMcvIj95X1HJ1wFGmT0STIRUUNt FT44Rh6rj5RYGXsSxyUPncCeBssBEZPwzmZSWDJKiDukBRLNiOMkZGMc1/byjmdxuq2K6BfM590uC TkV/tkB0UV8Z54mxdVlzLuOtLrNDBJPlGwx3mXYuqV8SZe2L4IKeItj0YlfgdgNIK3MF1CCv+UTOo dC4mVQZBSNOiMQ+bwBReG/73GI7P8nDfkzl11YKWo8ER8dz3olM1/RJqquSyppEMAlKEHZnWcHQXL 9M0ChL7w==; From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH v3 4/9] trivial: Cleanup imports in views Date: Tue, 7 Mar 2017 19:46:19 +0000 Message-Id: <20170307194624.21582-5-stephen@that.guru> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170307194624.21582-1-stephen@that.guru> References: <20170307194624.21582-1-stephen@that.guru> X-OutGoing-Spam-Status: No, score=-1.0 X-AuthUser: stephen@that.guru X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Break each import onto its own line and remove 'absolute_import' imports, which aren't necessary for Python >= 2.7. Signed-off-by: Stephen Finucane Reviewed-by: Daniel Axtens --- patchwork/views/api.py | 3 ++- patchwork/views/bundle.py | 23 +++++++++++++---------- patchwork/views/comment.py | 2 -- patchwork/views/cover.py | 8 ++++---- patchwork/views/patch.py | 15 +++++++++------ patchwork/views/project.py | 5 ++--- patchwork/views/pwclient.py | 5 ++--- patchwork/views/user.py | 3 ++- 8 files changed, 34 insertions(+), 30 deletions(-) diff --git a/patchwork/views/api.py b/patchwork/views/api.py index 4d79f93..bdd2a69 100644 --- a/patchwork/views/api.py +++ b/patchwork/views/api.py @@ -22,7 +22,8 @@ import json from django.db.models import Q from django.http import HttpResponse -from patchwork.models import Person, User +from patchwork.models import Person +from patchwork.models import User MINIMUM_CHARACTERS = 3 diff --git a/patchwork/views/bundle.py b/patchwork/views/bundle.py index b6959e9..53e1b21 100644 --- a/patchwork/views/bundle.py +++ b/patchwork/views/bundle.py @@ -17,17 +17,20 @@ # along with Patchwork; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import absolute_import - from django.contrib.auth.decorators import login_required -import django.core.urlresolvers -from django.http import (HttpResponse, HttpResponseRedirect, - HttpResponseNotFound) -from django.shortcuts import render, get_object_or_404 +from django.core import urlresolvers +from django.http import HttpResponse +from django.http import HttpResponseRedirect +from django.http import HttpResponseNotFound +from django.shortcuts import get_object_or_404 +from django.shortcuts import render from patchwork.filters import DelegateFilter -from patchwork.forms import BundleForm, DeleteBundleForm -from patchwork.models import Bundle, BundlePatch, Project +from patchwork.forms import BundleForm +from patchwork.forms import DeleteBundleForm +from patchwork.models import Bundle +from patchwork.models import BundlePatch +from patchwork.models import Project from patchwork.views import generic_list from patchwork.views.utils import patch_to_mbox @@ -80,7 +83,7 @@ def bundle_detail(request, username, bundlename): if action == 'delete': bundle.delete() return HttpResponseRedirect( - django.core.urlresolvers.reverse('user-profile') + urlresolvers.reverse('user-profile') ) elif action == 'update': form = BundleForm(request.POST, instance=bundle) @@ -152,7 +155,7 @@ def bundle_detail_redir(request, bundle_id): @login_required def bundle_mbox_redir(request, bundle_id): bundle = get_object_or_404(Bundle, id=bundle_id, owner=request.user) - return HttpResponseRedirect(django.core.urlresolvers.reverse( + return HttpResponseRedirect(urlresolvers.reverse( 'bundle-mbox', kwargs={ 'username': request.user.username, 'bundlename': bundle.name, diff --git a/patchwork/views/comment.py b/patchwork/views/comment.py index 7175105..e4f4f89 100644 --- a/patchwork/views/comment.py +++ b/patchwork/views/comment.py @@ -17,8 +17,6 @@ # along with Patchwork; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import absolute_import - from django.core import urlresolvers from django import http from django import shortcuts diff --git a/patchwork/views/cover.py b/patchwork/views/cover.py index fe3eaf2..af1b2f2 100644 --- a/patchwork/views/cover.py +++ b/patchwork/views/cover.py @@ -17,14 +17,14 @@ # along with Patchwork; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import absolute_import - from django.core import urlresolvers from django.http import Http404 from django.http import HttpResponseRedirect -from django.shortcuts import render_to_response, get_object_or_404 +from django.shortcuts import get_object_or_404 +from django.shortcuts import render_to_response -from patchwork.models import CoverLetter, Submission +from patchwork.models import CoverLetter +from patchwork.models import Submission def cover_detail(request, cover_id): diff --git a/patchwork/views/patch.py b/patchwork/views/patch.py index d1e81d1..a4cea2f 100644 --- a/patchwork/views/patch.py +++ b/patchwork/views/patch.py @@ -17,18 +17,21 @@ # along with Patchwork; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import absolute_import - from django.contrib import messages from django.core import urlresolvers from django.http import Http404 from django.http import HttpResponse from django.http import HttpResponseForbidden from django.http import HttpResponseRedirect -from django.shortcuts import render, get_object_or_404 - -from patchwork.forms import PatchForm, CreateBundleForm -from patchwork.models import Patch, Project, Bundle, Submission +from django.shortcuts import get_object_or_404 +from django.shortcuts import render + +from patchwork.forms import CreateBundleForm +from patchwork.forms import PatchForm +from patchwork.models import Bundle +from patchwork.models import Patch +from patchwork.models import Project +from patchwork.models import Submission from patchwork.views import generic_list from patchwork.views.utils import patch_to_mbox diff --git a/patchwork/views/project.py b/patchwork/views/project.py index de0c67d..6184805 100644 --- a/patchwork/views/project.py +++ b/patchwork/views/project.py @@ -17,13 +17,12 @@ # along with Patchwork; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import absolute_import - from django.conf import settings from django.contrib.auth.models import User from django.core import urlresolvers from django.http import HttpResponseRedirect -from django.shortcuts import get_object_or_404, render +from django.shortcuts import get_object_or_404 +from django.shortcuts import render from patchwork.models import Patch from patchwork.models import Project diff --git a/patchwork/views/pwclient.py b/patchwork/views/pwclient.py index 64fb044..c5dc806 100644 --- a/patchwork/views/pwclient.py +++ b/patchwork/views/pwclient.py @@ -17,10 +17,9 @@ # along with Patchwork; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -from __future__ import absolute_import - from django.conf import settings -from django.shortcuts import get_object_or_404, render +from django.shortcuts import get_object_or_404 +from django.shortcuts import render from patchwork.models import Project diff --git a/patchwork/views/user.py b/patchwork/views/user.py index c182aa3..7c29087 100644 --- a/patchwork/views/user.py +++ b/patchwork/views/user.py @@ -26,7 +26,8 @@ from django.conf import settings from django.core.mail import send_mail from django.core import urlresolvers from django.http import HttpResponseRedirect -from django.shortcuts import render, get_object_or_404 +from django.shortcuts import get_object_or_404 +from django.shortcuts import render from patchwork.compat import render_to_string from patchwork.filters import DelegateFilter