From patchwork Tue Jun 30 08:52:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 489595 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 AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BBD61402C4 for ; Tue, 30 Jun 2015 18:53:33 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 31F501A1DAD for ; Tue, 30 Jun 2015 18:53:33 +1000 (AEST) X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lists.ozlabs.org (Postfix) with ESMTP id A4F6F1A1F43 for ; Tue, 30 Jun 2015 18:52:16 +1000 (AEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 30 Jun 2015 01:52:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,376,1432623600"; d="scan'208";a="720168024" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 30 Jun 2015 01:52:14 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t5U8qDmG030626; Tue, 30 Jun 2015 09:52:13 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t5U8qDac020346; Tue, 30 Jun 2015 09:52:13 +0100 Received: (from sfinucan@localhost) by sivswdev01.ir.intel.com with id t5U8qDPD020341; Tue, 30 Jun 2015 09:52:13 +0100 From: Stephen Finucane To: patchwork@lists.ozlabs.org Subject: [PATCH 05/11] trivial: Remove additional dead code Date: Tue, 30 Jun 2015 09:52:03 +0100 Message-Id: <1435654329-19960-6-git-send-email-stephen.finucane@intel.com> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1435654329-19960-1-git-send-email-stephen.finucane@intel.com> References: <1435654329-19960-1-git-send-email-stephen.finucane@intel.com> X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephen Finucane MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Remove dead files and functions as highlighted by coverage and manual inspection. Signed-off-by: Stephen Finucane --- patchwork/context_processors.py | 32 ---------------------------- patchwork/requestcontext.py | 46 +++++++++++++++++++---------------------- 2 files changed, 21 insertions(+), 57 deletions(-) delete mode 100644 patchwork/context_processors.py diff --git a/patchwork/context_processors.py b/patchwork/context_processors.py deleted file mode 100644 index f4ab5a9..0000000 --- a/patchwork/context_processors.py +++ /dev/null @@ -1,32 +0,0 @@ -# Patchwork - automated patch tracking system -# Copyright (C) 2008 Jeremy Kerr -# -# This file is part of the Patchwork package. -# -# Patchwork is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Patchwork is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Patchwork; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -from patchwork.models import Bundle -from patchwork.utils import order_map, get_order - -def bundle(request): - user = request.user - if not user.is_authenticated(): - return {} - return {'bundles': Bundle.objects.filter(owner = user)} - - -def patchlists(request): - diff --git a/patchwork/requestcontext.py b/patchwork/requestcontext.py index 342d380..8ad6049 100644 --- a/patchwork/requestcontext.py +++ b/patchwork/requestcontext.py @@ -24,35 +24,31 @@ from django.conf import settings from patchwork.filters import Filters from patchwork.models import Bundle, Project + def bundle(request): user = request.user if not user.is_authenticated(): return {} - return {'bundles': Bundle.objects.filter(owner = user)} - -def _params_as_qs(params): - return '&'.join([ '%s=%s' % (escape(k), escape(v)) for k, v in params ]) + return {'bundles': Bundle.objects.filter(owner=user)} -def _params_as_hidden_fields(params): - return '\n'.join([ '' % \ - (escape(k), escape(v)) for k, v in params ]) class PatchworkRequestContext(RequestContext): - def __init__(self, request, project = None, - dict = None, processors = None, - list_view = None, list_view_params = {}): + + def __init__(self, request, project=None, + dict=None, processors=None, + list_view=None, list_view_params={}): self._project = project self.filters = Filters(request) if processors is None: processors = [] processors.append(bundle) - super(PatchworkRequestContext, self). \ - __init__(request, dict, processors); + super(PatchworkRequestContext, self).__init__( + request, dict, processors) self.update({ - 'filters': self.filters, - 'messages': [], - }) + 'filters': self.filters, + 'messages': [], + }) if list_view: params = self.filters.params() for param in ['order', 'page']: @@ -64,22 +60,22 @@ class PatchworkRequestContext(RequestContext): value = data.get(param, None) if value: - params.append((param, value)) + params.append((param, value)) self.update({ 'list_view': { - 'view': list_view, - 'view_params': list_view_params, - 'params': params - }}) + 'view': list_view, + 'view_params': list_view_params, + 'params': params + }}) self.projects = Project.objects.all() self.update({ - 'project': self.project, - 'site': Site.objects.get_current(), - 'settings': settings, - 'other_projects': len(self.projects) > 1 - }) + 'project': self.project, + 'site': Site.objects.get_current(), + 'settings': settings, + 'other_projects': len(self.projects) > 1 + }) def _set_project(self, project): self._project = project