From patchwork Wed Jul 13 13:22:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zygmunt Krynicki X-Patchwork-Id: 2677 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 EFB8824259 for ; Wed, 13 Jul 2011 13:22:18 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8C1C4A1874E for ; Wed, 13 Jul 2011 13:22:18 +0000 (UTC) Received: by qyk30 with SMTP id 30so4051663qyk.11 for ; Wed, 13 Jul 2011 06:22:18 -0700 (PDT) Received: by 10.229.68.200 with SMTP id w8mr1019613qci.114.1310563335619; Wed, 13 Jul 2011 06:22:15 -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.217.78 with SMTP id hl14cs21428qcb; Wed, 13 Jul 2011 06:22:14 -0700 (PDT) Received: by 10.227.10.210 with SMTP id q18mr1022490wbq.44.1310563333528; Wed, 13 Jul 2011 06:22:13 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id o17si30171822wbh.14.2011.07.13.06.22.13; Wed, 13 Jul 2011 06:22:13 -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 1QgzOG-0001Fj-O0 for ; Wed, 13 Jul 2011 13:22:12 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id B18E72E889B for ; Wed, 13 Jul 2011 13:22:12 +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: 207 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 207: Merge 0.3b3 changes Message-Id: <20110713132212.896.79500.launchpad@loganberry.canonical.com> Date: Wed, 13 Jul 2011 13:22:12 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13405"; Instance="initZopeless config overlay" X-Launchpad-Hash: a122a2adb01f4551baa526d0b2dd1131f37f5aa8 Merge authors: Zygmunt Krynicki (zkrynicki) Related merge proposals: https://code.launchpad.net/~zkrynicki/lava-server/0.3b3/+merge/67829 proposed by: Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 207 [merge] committer: Zygmunt Krynicki branch nick: trunk timestamp: Wed 2011-07-13 15:21:02 +0200 message: Merge 0.3b3 changes removed: demo/demo_app/static/demo_app/ lava_server/media/ lava_server/static/ renamed: demo/demo_app/static/demo_app/example.txt => demo/demo_app/static/example.txt modified: lava_server/__init__.py lava_server/extension.py lava_server/settings/common.py lava_server/settings/debian.py lava_server/settings/development.py lava_server/settings/production.py lava_server/templates/layouts/base.html lava_server/templates/layouts/content.html lava_server/templates/layouts/dialog.html lava_server/templates/linaro_django_xmlrpc/_base.html lava_server/templates/linaro_django_xmlrpc/api.html lava_server/templates/linaro_django_xmlrpc/tokens.html lava_server/templates/registration/base.html lava_server/urls.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 === removed directory 'demo/demo_app/static/demo_app' === renamed file 'demo/demo_app/static/demo_app/example.txt' => 'demo/demo_app/static/example.txt' === modified file 'lava_server/__init__.py' --- lava_server/__init__.py 2011-07-12 12:18:40 +0000 +++ lava_server/__init__.py 2011-07-12 15:09:34 +0000 @@ -17,4 +17,4 @@ # along with LAVA Server. If not, see . -__version__ = (0, 3, 0, "beta", 2) +__version__ = (0, 3, 0, "beta", 3) === modified file 'lava_server/extension.py' --- lava_server/extension.py 2011-07-01 10:11:07 +0000 +++ lava_server/extension.py 2011-07-13 10:59:13 +0000 @@ -114,7 +114,7 @@ def contribute_to_settings(self, settings_module): settings_module['INSTALLED_APPS'].append(self.app_name) - settings_module['PREPEND_LABEL_APPS'].append(self.app_name) + settings_module['STATICFILES_PREPEND_LABEL_APPS'].append(self.app_name) def contribute_to_settings_ex(self, settings_module, settings_object): pass === removed directory 'lava_server/media' === modified file 'lava_server/settings/common.py' --- lava_server/settings/common.py 2011-07-01 10:50:43 +0000 +++ lava_server/settings/common.py 2011-07-13 10:59:13 +0000 @@ -68,7 +68,7 @@ "static", ) -PREPEND_LABEL_APPS = [ +STATICFILES_PREPEND_LABEL_APPS = [ "django.contrib.admin", ] === modified file 'lava_server/settings/debian.py' --- lava_server/settings/debian.py 2011-07-07 18:15:31 +0000 +++ lava_server/settings/debian.py 2011-07-12 15:06:26 +0000 @@ -41,10 +41,8 @@ # List of absolute pathnames used to resolve templates. TEMPLATE_DIRS = debian_settings.TEMPLATE_DIRS -# TODO: Debianize this -STATICFILES_DIRS = [ - ('lava', "/usr/share/lava-server/htdocs"), -] +# Like TEMPLATE_DIRS but for static files +STATICFILES_DIRS = debian_settings.STATICFILES_DIRS # A tuple that lists people who get code error notifications. When DEBUG=False # and a view raises an exception, Django will e-mail these people with the === modified file 'lava_server/settings/development.py' --- lava_server/settings/development.py 2011-07-05 10:43:10 +0000 +++ lava_server/settings/development.py 2011-07-13 10:26:20 +0000 @@ -18,11 +18,37 @@ import os +from django.core.exceptions import ImproperlyConfigured + from lava_server.extension import loader from lava_server.settings.common import * - -ROOT_DIR = os.path.normpath( +# Top-level directory for volatile, re-buildable files originated from +# installing components of a lava-dev-tool project. Here we assume the project +# uses virtualenv and look for a variable virtualenv injects into the +# environment. +LOCALENV_DIR = os.getenv("VIRTUAL_ENV") +if LOCALENV_DIR is None: + raise ImproperlyConfigured("Development mode REQUIRES VIRTUAL_ENV to be set") + +# Top-level directory for nonvolatile files, as used by lava-dev-tool. It is a +# sibling directory to localenv so it's easier to define its location as +# relative to LOCALENV_DIR. +PRECIOUS_DIR = os.path.join(LOCALENV_DIR, "../precious") + +# Top-level directory of the precious project state. +# +# In short: this is where your non-source content ends up at, this place should +# keep the database file(s), user uploaded media files as well as the cache of +# static files, if built. +PROJECT_STATE_DIR = os.path.join(PRECIOUS_DIR, "var/lib/lava-server/") + +# Top-level directory of the project. +# +# This directory MUST contain two sub-directories: +# * templates/ - project-wide template files +# * htdocs/ - project-wide static files (_not_ the root of the static file cache) +PROJECT_SRC_DIR = os.path.normpath( os.path.join( os.path.dirname( os.path.abspath(__file__)), @@ -45,10 +71,10 @@ # # The prefix _MUST_ end with a slash when not empty. -# Code is served directly, WSGI mapping make it appear in "django-hello" but +# Code is served directly, WSGI mapping make it appear in "lava-server" but # this is done externally to django URL resolver. APP_URL_PREFIX = r"" -# Data is served by external web server in "django-hello/" +# Data is served by external web server in "lava-server/" DATA_URL_PREFIX = r"" @@ -69,7 +95,7 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(ROOT_DIR, 'development.db'), + 'NAME': os.path.join(PROJECT_STATE_DIR, 'development.db'), 'USER': '', 'PASSWORD': '', 'HOST': '', @@ -84,12 +110,12 @@ # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = os.path.join(ROOT_DIR, "media", devel_db) +MEDIA_ROOT = os.path.join(PROJECT_STATE_DIR, "media") # Absolute filesystem path to the directory that will hold static, read only # files collected from all applications. # Example: "/home/media/static.lawrence.com/" -STATIC_ROOT = os.path.join(ROOT_DIR, "static") +STATIC_ROOT = os.path.join(PROJECT_STATE_DIR, "static") # 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). @@ -114,11 +140,11 @@ TEMPLATE_DIRS = ( - os.path.join(ROOT_DIR, "templates"), + os.path.join(PROJECT_SRC_DIR, "templates"), ) STATICFILES_DIRS = [ - ('lava', os.path.join(ROOT_DIR, 'htdocs')) + ('lava-server', os.path.join(PROJECT_SRC_DIR, 'htdocs')) ] === modified file 'lava_server/settings/production.py' --- lava_server/settings/production.py 2011-07-01 11:09:58 +0000 +++ lava_server/settings/production.py 2011-07-13 11:27:51 +0000 @@ -35,11 +35,11 @@ # # Both values _MUST_ end with a slash when not empty. -# Code is served directly, WSGI mapping make it appear in "django-hello" but +# Code is served directly, WSGI mapping make it appear in "lava-server" but # 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"" +# Data is served by external web server in "lava-server/" +DATA_URL_PREFIX = r"lava-server/" # 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). @@ -56,8 +56,13 @@ # Examples: "http://foo.com/media/", "/media/". ADMIN_MEDIA_PREFIX = "/" + DATA_URL_PREFIX + "static/admin/" -# The true outer url is /lava/ +# The true outer url is /lava-server/ LOGIN_REDIRECT_URL = "/" + DATA_URL_PREFIX +# URL of the login screen, has to be hard-coded like that for Django. +# I cheat a little, using DATA_URL_PREFIX here is technically incorrect +# but it seems better than hard-coding 'lava-server' yet again. +LOGIN_URL = '/' + DATA_URL_PREFIX + 'accounts/login/' + if DEBUG: raise Exception("You should not run this application with debugging in a production environment") === removed directory 'lava_server/static' === modified file 'lava_server/templates/layouts/base.html' --- lava_server/templates/layouts/base.html 2011-07-12 02:22:10 +0000 +++ lava_server/templates/layouts/base.html 2011-07-12 15:05:51 +0000 @@ -5,17 +5,17 @@ {% block title %}LAVA{% endblock %} {% block scripts_and_styles %} - - - - + + + + {% endblock %} {% block extrahead %}{% endblock %} {% block ajax_notification %}
- + {% trans "AJAX request is in progress..." %}
- + + {% endblock %} === modified file 'lava_server/templates/linaro_django_xmlrpc/_base.html' --- lava_server/templates/linaro_django_xmlrpc/_base.html 2011-07-12 02:22:10 +0000 +++ lava_server/templates/linaro_django_xmlrpc/_base.html 2011-07-13 12:48:44 +0000 @@ -10,7 +10,7 @@ {% block extension_navigation %} @@ -19,5 +19,5 @@ {% block breadcrumbs %} {{ block.super }} -
  • {% trans "XML-RPC Handler" %}
  • +
  • {% trans "API Help" %}
  • {% endblock %} === modified file 'lava_server/templates/linaro_django_xmlrpc/api.html' --- lava_server/templates/linaro_django_xmlrpc/api.html 2011-07-12 02:22:10 +0000 +++ lava_server/templates/linaro_django_xmlrpc/api.html 2011-07-13 10:24:49 +0000 @@ -13,15 +13,13 @@ {% block content %}

    About XML-RPC API

    -

    This URL is an XML-RPC server. You can interact with it using any XML-RPC +

    LAVA Server offers API services as an XML-RPC server. You can interact with it using any XML-RPC client. For example, in python you can do this:

     import xmlrpclib
     server = xmlrpclib.ServerProxy("{{ site_url }}{% url linaro_django_xmlrpc.views.handler %}")
     print server.version()
     
    -

    The rest of this page is an automatically generated documentation of the -available functions.

    Available functions

    === modified file 'lava_server/templates/linaro_django_xmlrpc/tokens.html' --- lava_server/templates/linaro_django_xmlrpc/tokens.html 2011-07-12 02:22:10 +0000 +++ lava_server/templates/linaro_django_xmlrpc/tokens.html 2011-07-13 10:24:17 +0000 @@ -3,8 +3,8 @@ {% block extrahead %} - - + + {% endblock %} === modified file 'lava_server/templates/registration/base.html' --- lava_server/templates/registration/base.html 2011-07-09 14:25:11 +0000 +++ lava_server/templates/registration/base.html 2011-07-13 10:24:17 +0000 @@ -7,9 +7,9 @@ {% block scripts_and_styles %} {{ block.super }} - - - + + + {% endblock %} === modified file 'lava_server/urls.py' --- lava_server/urls.py 2011-06-07 04:25:21 +0000 +++ lava_server/urls.py 2011-07-13 12:48:44 +0000 @@ -21,6 +21,7 @@ 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 from lava_server.extension import loader @@ -39,8 +40,18 @@ url(r'^' + settings.APP_URL_PREFIX + r'accounts/', include('django.contrib.auth.urls')), url(r'^' + settings.APP_URL_PREFIX + r'admin/', include(admin.site.urls)), url(r'^' + settings.APP_URL_PREFIX + r'openid/', include('django_openid_auth.urls')), - url(r'^' + settings.APP_URL_PREFIX + r'RPC2/', 'linaro_django_xmlrpc.views.handler', {'mapper':loader.xmlrpc_mapper}), - url(r'^' + settings.APP_URL_PREFIX, include('linaro_django_xmlrpc.urls')), + url(r'^' + settings.APP_URL_PREFIX + r'RPC2/', 'linaro_django_xmlrpc.views.handler', + name='lava.api_handler', + kwargs={ + 'mapper': loader.xmlrpc_mapper, + 'help_view': 'lava.api_help'}), + url(r'^' + settings.APP_URL_PREFIX + r'api/help/$', 'linaro_django_xmlrpc.views.help', + name='lava.api_help', + kwargs={ + 'mapper': loader.xmlrpc_mapper}), + url(r'^' + settings.APP_URL_PREFIX + r'api/', include(api_urls.token_urlpatterns)), + # XXX: This is not needed but without it linaro-django-xmlrpc tests fail + url(r'^' + settings.APP_URL_PREFIX + r'api/', include(api_urls.default_mapper_urlpatterns)), ) === modified file 'setup.py' --- setup.py 2011-07-05 10:43:10 +0000 +++ setup.py 2011-07-13 10:25:14 +0000 @@ -54,7 +54,7 @@ "django-staticfiles == 0.3.4", 'django < 1.3', 'django-openid-auth >= 0.2', - 'linaro-django-xmlrpc >= 0.3.2', + 'linaro-django-xmlrpc >= 0.4', 'python-openid >= 2.2.4', # this should be a part of django-openid-auth deps 'south >= 0.7.3', 'versiontools >= 1.3.1',