From patchwork Mon Dec 5 23:41:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 5494 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 C4F7823E03 for ; Mon, 5 Dec 2011 23:41:15 +0000 (UTC) Received: from mail-lpp01m010-f52.google.com (mail-lpp01m010-f52.google.com [209.85.215.52]) by fiordland.canonical.com (Postfix) with ESMTP id AA1B0A185DE for ; Mon, 5 Dec 2011 23:41:15 +0000 (UTC) Received: by lagm6 with SMTP id m6so636581lag.11 for ; Mon, 05 Dec 2011 15:41:15 -0800 (PST) Received: by 10.152.106.115 with SMTP id gt19mr7487931lab.27.1323128475363; Mon, 05 Dec 2011 15:41:15 -0800 (PST) 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.41.198 with SMTP id h6cs290233lal; Mon, 5 Dec 2011 15:41:15 -0800 (PST) Received: by 10.180.5.234 with SMTP id v10mr15152807wiv.44.1323128473720; Mon, 05 Dec 2011 15:41:13 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id v44si10770012wec.96.2011.12.05.15.41.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Dec 2011 15:41:13 -0800 (PST) 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 1RXi9p-00063J-7M for ; Mon, 05 Dec 2011 23:41:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 2A8FFE002E for ; Mon, 5 Dec 2011 23:41:13 +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: 334 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 334: Make extensions aware of mount points Message-Id: <20111205234113.3082.43053.launchpad@ackee.canonical.com> Date: Mon, 05 Dec 2011 23:41:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14435"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 232bbcee41f0e58a4a5745637ca5b2ee35ca4aeb ------------------------------------------------------------ revno: 334 committer: Zygmunt Krynicki branch nick: trunk timestamp: Tue 2011-12-06 00:39:52 +0100 message: Make extensions aware of mount points modified: lava_server/extension.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_server/extension.py' --- lava_server/extension.py 2011-11-08 23:48:55 +0000 +++ lava_server/extension.py 2011-12-05 23:39:52 +0000 @@ -47,7 +47,7 @@ """ @abstractmethod - def contribute_to_urlpatterns(self, urlpatterns): + def contribute_to_urlpatterns(self, urlpatterns, mount_point): """ Add application specific URLs to root URL patterns of lava-server """ @@ -159,10 +159,10 @@ def contribute_to_settings_ex(self, settings_module, settings_object): pass - def contribute_to_urlpatterns(self, urlpatterns): + def contribute_to_urlpatterns(self, urlpatterns, mount_point): from django.conf.urls.defaults import url, include urlpatterns += [ - url(r'^{slug}/'.format(slug=self.slug), + url(r'^{mount_point}{slug}/'.format(mount_point=mount_point, slug=self.slug), include('{app_name}.urls'.format(app_name=self.app_name)))] def get_main_url(self): @@ -261,12 +261,12 @@ extension.contribute_to_settings_ex( settings_module, settings_object) - def contribute_to_urlpatterns(self, urlpatterns): + def contribute_to_urlpatterns(self, urlpatterns, mount_point): """ Contribute to lava-server URL patterns """ for extension in self.extensions: - extension.contribute_to_urlpatterns(urlpatterns) + extension.contribute_to_urlpatterns(urlpatterns, mount_point) def _find_extensions(self): return sorted( === modified file 'lava_server/urls.py' --- lava_server/urls.py 2011-12-05 23:14:55 +0000 +++ lava_server/urls.py 2011-12-05 23:39:52 +0000 @@ -76,4 +76,4 @@ # Load URLs for extensions -loader.contribute_to_urlpatterns(urlpatterns) +loader.contribute_to_urlpatterns(urlpatterns, settings.MOUNT_POINT)