From patchwork Tue Oct 11 10:35:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 4619 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id A08C323DEF for ; Tue, 11 Oct 2011 10:35:17 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 96E00A18324 for ; Tue, 11 Oct 2011 10:35:17 +0000 (UTC) Received: by mail-ey0-f180.google.com with SMTP id 5so1953429eyg.11 for ; Tue, 11 Oct 2011 03:35:17 -0700 (PDT) Received: by 10.223.92.144 with SMTP id r16mr38785098fam.23.1318329317439; Tue, 11 Oct 2011 03:35:17 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.24.41 with SMTP id r9cs152879laf; Tue, 11 Oct 2011 03:35:17 -0700 (PDT) Received: by 10.227.12.15 with SMTP id v15mr7628986wbv.77.1318329314984; Tue, 11 Oct 2011 03:35:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id gd5si15815998wbb.26.2011.10.11.03.35.14 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Oct 2011 03:35:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RDZg2-0008SX-F4 for ; Tue, 11 Oct 2011 10:35:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 6841CE03DF for ; Tue, 11 Oct 2011 10:35:14 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-server X-Launchpad-Branch: ~linaro-validation/lava-server/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 258 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 258: Fix pyflakes issues Message-Id: <20111011103514.21793.45109.launchpad@ackee.canonical.com> Date: Tue, 11 Oct 2011 10:35:14 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14124"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 85561270f24c41542452bcef5d28c85728a6ee4b ------------------------------------------------------------ revno: 258 committer: Zygmunt Krynicki branch nick: trunk timestamp: Tue 2011-10-11 11:58:00 +0200 message: Fix pyflakes issues modified: lava_projects/models.py lava_projects/views.py lava_server/extension.py lava_server/settings/development.py lava_server/urls.py --- lp:lava-server https://code.launchpad.net/~linaro-validation/lava-server/trunk You are subscribed to branch lp:lava-server. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription === modified file 'lava_projects/models.py' --- lava_projects/models.py 2011-10-11 09:20:14 +0000 +++ lava_projects/models.py 2011-10-11 09:58:00 +0000 @@ -17,7 +17,6 @@ # along with LAVA Server. If not, see . from django.contrib.auth.models import User -from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models.query import QuerySet from django.utils.translation import ugettext as _ @@ -42,9 +41,8 @@ return self.get(identifier=identifier) except Project.DoesNotExist as no_such_project: try: - p_f_ir = ProjectFormerIdentifier.objects.get( - former_identifier=identifier) - return p_f_i.project + return ProjectFormerIdentifier.objects.get( + former_identifier=identifier).project except ProjectFormerIdentifier.DoesNotExist: raise no_such_project === modified file 'lava_projects/views.py' --- lava_projects/views.py 2011-10-11 09:20:14 +0000 +++ lava_projects/views.py 2011-10-11 09:58:00 +0000 @@ -18,11 +18,15 @@ from django.contrib.auth.decorators import login_required from django.http import ( - HttpResponse, HttpResponseRedirect, HttpResponseForbidden) -from django.shortcuts import render_to_response, get_object_or_404 + Http404, + HttpResponse, + HttpResponseForbidden, + HttpResponseRedirect, +) +from django.shortcuts import get_object_or_404 from django.template import RequestContext, loader from django.utils.translation import ugettext as _ -from django.views.generic.list_detail import object_list, object_detail +from django.views.generic.list_detail import object_list from lava_server.bread_crumbs import ( BreadCrumb, @@ -184,7 +188,7 @@ form = ProjectRenameForm(project, request.POST) if form.is_valid(): # Remove old entry if we are reusing our older identifier - pfi = ProjectFormerIdentifier.objects.filter( + ProjectFormerIdentifier.objects.filter( former_identifier=form.cleaned_data['identifier'], project=project.pk).delete() # Record the change taking place === modified file 'lava_server/extension.py' --- lava_server/extension.py 2011-10-11 09:20:14 +0000 +++ lava_server/extension.py 2011-10-11 09:58:00 +0000 @@ -264,7 +264,7 @@ """ try: extension_cls = entrypoint.load() - except ImportError as ex: + except ImportError: logging.exception( "Unable to load extension entry point: %r", entrypoint) raise ExtensionLoadError( === modified file 'lava_server/settings/development.py' --- lava_server/settings/development.py 2011-10-11 09:20:14 +0000 +++ lava_server/settings/development.py 2011-10-11 09:58:00 +0000 @@ -18,8 +18,6 @@ import os -from django.core.exceptions import ImproperlyConfigured - from lava_server.extension import loader from lava_server.settings.common import * === modified file 'lava_server/urls.py' --- lava_server/urls.py 2011-10-11 09:20:14 +0000 +++ lava_server/urls.py 2011-10-11 09:58:00 +0000 @@ -20,7 +20,6 @@ from django.conf.urls.defaults import ( handler404, handler500, include, patterns, url) from django.contrib import admin -from django.views.generic.simple import direct_to_template from staticfiles.urls import staticfiles_urlpatterns from linaro_django_xmlrpc import urls as api_urls