From patchwork Tue Jul 5 10:45:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 2451 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 2A32023F58 for ; Tue, 5 Jul 2011 10:45:42 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id D42B7A18661 for ; Tue, 5 Jul 2011 10:45:41 +0000 (UTC) Received: by qwb8 with SMTP id 8so4004856qwb.11 for ; Tue, 05 Jul 2011 03:45:41 -0700 (PDT) Received: by 10.229.62.194 with SMTP id y2mr5455729qch.4.1309862741333; Tue, 05 Jul 2011 03:45:41 -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.229.48.135 with SMTP id r7cs48500qcf; Tue, 5 Jul 2011 03:45:40 -0700 (PDT) Received: by 10.216.58.210 with SMTP id q60mr4550159wec.58.1309862739941; Tue, 05 Jul 2011 03:45:39 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id 16si14018812wem.93.2011.07.05.03.45.39; Tue, 05 Jul 2011 03:45:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Qe38N-00087z-BN for ; Tue, 05 Jul 2011 10:45:39 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 4939A2E8043 for ; Tue, 5 Jul 2011 10:45:39 +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: 189 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 189: Merge a bunch of late fixes for issues discovered when actually trying to deploy everything Message-Id: <20110705104539.30905.99429.launchpad@loganberry.canonical.com> Date: Tue, 05 Jul 2011 10:45:39 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13333"; Instance="initZopeless config overlay" X-Launchpad-Hash: 301fde384a71038a01cf965672d2ef7749eab694 Merge authors: Zygmunt Krynicki (zkrynicki) Related merge proposals: https://code.launchpad.net/~zkrynicki/lava-server/fix-production-settings/+merge/66582 proposed by: Zygmunt Krynicki (zkrynicki) review: Approve - Paul Larson (pwlars) https://code.launchpad.net/~zkrynicki/lava-server/contribute-to-settings-ex/+merge/66575 proposed by: Zygmunt Krynicki (zkrynicki) review: Approve - Paul Larson (pwlars) ------------------------------------------------------------ revno: 189 [merge] committer: Zygmunt Krynicki branch nick: trunk timestamp: Tue 2011-07-05 12:43:10 +0200 message: Merge a bunch of late fixes for issues discovered when actually trying to deploy everything modified: lava_server/__init__.py lava_server/extension.py lava_server/htdocs/css/default.css lava_server/settings/common.py lava_server/settings/debian.py lava_server/settings/development.py lava_server/settings/production.py setup.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/__init__.py' --- lava_server/__init__.py 2011-06-23 18:50:08 +0000 +++ lava_server/__init__.py 2011-07-01 11:10:24 +0000 @@ -17,4 +17,4 @@ # along with LAVA Server. If not, see . -__version__ = (0, 2, 0, "final", 0) +__version__ = (0, 2, 1, "final", 0) === modified file 'lava_server/extension.py' --- lava_server/extension.py 2011-06-08 03:47:04 +0000 +++ lava_server/extension.py 2011-07-01 10:11:07 +0000 @@ -31,13 +31,22 @@ __metaclass__ = ABCMeta @abstractmethod - def contribute_to_settings(self, settings): + def contribute_to_settings(self, settings_module): """ Add elements required to initialize this extension into the project settings module. """ @abstractmethod + def contribute_to_settings_ex(self, settings_module, settings_object): + """ + This method is similar to contribute_to_settings() but allows + implementation to access a settings object from django-debian. This + allows extensions to read settings provided by local system + administrator. + """ + + @abstractmethod def contribute_to_urlpatterns(self, urlpatterns): """ Add application specific URLs to root URL patterns of lava-server @@ -103,9 +112,12 @@ """ return None - def contribute_to_settings(self, settings): - settings['INSTALLED_APPS'].append(self.app_name) - settings['PREPEND_LABEL_APPS'].append(self.app_name) + def contribute_to_settings(self, settings_module): + settings_module['INSTALLED_APPS'].append(self.app_name) + settings_module['PREPEND_LABEL_APPS'].append(self.app_name) + + def contribute_to_settings_ex(self, settings_module, settings_object): + pass def contribute_to_urlpatterns(self, urlpatterns): from django.conf.urls.defaults import url, include @@ -171,14 +183,18 @@ self._extensions.append(extension) return self._extensions - def contribute_to_settings(self, settings): + def contribute_to_settings(self, settings_module, settings_object=None): """ Contribute to lava-server settings module. - The settings argument is a magic dictionary returned by locals() + The settings_object is optional (it may be None) and allows extensions + to look at the django-debian settings object. The settings_module + argument is a magic dictionary returned by locals() """ for extension in self.extensions: - extension.contribute_to_settings(settings) + extension.contribute_to_settings(settings_module) + if settings_object is not None: + extension.contribute_to_settings_ex(settings_module, settings_object) def contribute_to_urlpatterns(self, urlpatterns): """ === modified file 'lava_server/htdocs/css/default.css' --- lava_server/htdocs/css/default.css 2011-06-29 14:02:57 +0000 +++ lava_server/htdocs/css/default.css 2011-07-01 11:09:44 +0000 @@ -221,7 +221,7 @@ #content { color: #202020; - padding: 0 1px 0 0; + padding: 5pt; width: 78%; background-color: #F5F4E1; === modified file 'lava_server/settings/common.py' --- lava_server/settings/common.py 2011-06-02 05:02:02 +0000 +++ lava_server/settings/common.py 2011-07-01 10:50:43 +0000 @@ -17,9 +17,6 @@ # along with LAVA Server. If not, see . -from lava_server.extension import loader - - # Administrator contact, used for sending # emergency email when something breaks ADMINS = ( @@ -94,6 +91,7 @@ # 'django.contrib.admindocs', # Admin docs disabled due to: https://code.djangoproject.com/ticket/6681 'linaro_django_xmlrpc', + 'south', ] TEMPLATE_CONTEXT_PROCESSORS = [ @@ -128,6 +126,3 @@ # This is fixed in south 0.7.1, if we upgrade past that it's safe to # remove this line. SKIP_SOUTH_TESTS = True - -# Load extensions -loader.contribute_to_settings(locals()) === modified file 'lava_server/settings/debian.py' --- lava_server/settings/debian.py 2011-05-24 13:28:57 +0000 +++ lava_server/settings/debian.py 2011-07-01 11:09:58 +0000 @@ -1,10 +1,12 @@ # Django settings for django_hello project used on Debian systems. from django_debian.settings import Settings + +from lava_server.extension import loader from lava_server.settings.production import * # Load application settings from django-debian integration package -debian_settings = Settings("lava") +debian_settings = Settings("lava-server") # Load default database from Debian integration DATABASES = { @@ -49,7 +51,7 @@ # TODO: Debianize this STATICFILES_DIRS = [ - ('', "/usr/share/lava/htdocs"), + ('lava', "/usr/share/lava-server/htdocs"), ] # A tuple that lists people who get code error notifications. When DEBUG=False @@ -68,3 +70,6 @@ # See also IGNORABLE_404_STARTS, IGNORABLE_404_ENDS and Error reporting via # e-mail. SEND_BROKEN_LINK_EMAILS=debian_settings.SEND_BROKEN_LINK_EMAILS + +# Load extensions +loader.contribute_to_settings(locals(), debian_settings) === modified file 'lava_server/settings/development.py' --- lava_server/settings/development.py 2011-06-29 14:10:50 +0000 +++ lava_server/settings/development.py 2011-07-05 10:43:10 +0000 @@ -18,6 +18,7 @@ import os +from lava_server.extension import loader from lava_server.settings.common import * @@ -127,3 +128,6 @@ # Any emails that would normally be sent are redirected to stdout. # This setting is only used for django 1.2 and newer. EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' + +# Load extensions +loader.contribute_to_settings(locals()) === modified file 'lava_server/settings/production.py' --- lava_server/settings/production.py 2011-05-24 00:24:53 +0000 +++ lava_server/settings/production.py 2011-07-01 11:09:58 +0000 @@ -39,7 +39,7 @@ # this is done externally to django URL resolver. APP_URL_PREFIX = r"" # Data is served by external web server in "django-hello/" -DATA_URL_PREFIX = r"lava/" +DATA_URL_PREFIX = r"" # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash if there is a path component (optional in other cases). === modified file 'setup.py' --- setup.py 2011-07-05 10:18:29 +0000 +++ setup.py 2011-07-05 10:43:10 +0000 @@ -54,9 +54,10 @@ "django-staticfiles == 0.3.4", 'django < 1.3', 'django-openid-auth >= 0.2', + 'linaro-django-xmlrpc >= 0.3.2', 'python-openid >= 2.2.4', # this should be a part of django-openid-auth deps + 'south >= 0.7.3', 'versiontools >= 1.3.1', - 'linaro-django-xmlrpc >= 0.3.2', ], setup_requires=[ 'versiontools >= 1.3.1',