diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 207: Merge 0.3b3 changes

Message ID 20110713132212.896.79500.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki July 13, 2011, 1:22 p.m. UTC
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 <zygmunt.krynicki@linaro.org>
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
diff mbox

Patch

=== 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 <http://www.gnu.org/licenses/>.
 
 
-__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 @@ 
     <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
     <title>{% block title %}LAVA{% endblock %}</title>
     {% block scripts_and_styles %}
-    <script type="text/javascript" src="{{ STATIC_URL }}lava/js/jquery-1.5.1.min.js"></script> 
-    <script type="text/javascript" src="{{ STATIC_URL }}lava/js/jquery-ui-1.8.12.custom.min.js"></script> 
-    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava/css/Aristo/jquery-ui-1.8.7.custom.css"/>
-    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava/css/default.css"/>
+    <script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery-1.5.1.min.js"></script> 
+    <script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery-ui-1.8.12.custom.min.js"></script> 
+    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/Aristo/jquery-ui-1.8.7.custom.css"/>
+    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/default.css"/>
     {% endblock %}
     {% block extrahead %}{% endblock %}
   </head>
   <body>
     {% block ajax_notification %}
     <div id="ajax_notification">
-      <img src="{{ STATIC_URL }}lava/images/ajax-progress.gif"/>
+      <img src="{{ STATIC_URL }}lava-server/images/ajax-progress.gif"/>
       {% trans "AJAX request is in progress..." %}
     </div>
     <script type="text/javascript">

=== modified file 'lava_server/templates/layouts/content.html'
--- lava_server/templates/layouts/content.html	2011-07-12 02:22:10 +0000
+++ lava_server/templates/layouts/content.html	2011-07-13 12:48:44 +0000
@@ -36,7 +36,7 @@ 
       {% for extension in lava.extensions %}
       <li><a href="{{ extension.get_main_url }}">{{ extension.name }}</a></li>
       {% endfor %}
-      <li><a href="{% url linaro_django_xmlrpc.views.default_handler %}">{% trans "XML-RPC" %}</a></li>
+      <li><a href="{% url lava.api_help %}">{% trans "API" %}</a></li>
     </ul>
   </div>
   {% endblock navigation %}

=== modified file 'lava_server/templates/layouts/dialog.html'
--- lava_server/templates/layouts/dialog.html	2011-07-08 02:56:22 +0000
+++ lava_server/templates/layouts/dialog.html	2011-07-12 15:05:51 +0000
@@ -2,8 +2,8 @@ 
 
 
 {% block scripts_and_styles %}
-<script type="text/javascript" src="{{ STATIC_URL }}lava/js/jquery-1.5.1.min.js"></script> 
-<script type="text/javascript" src="{{ STATIC_URL }}lava/js/jquery-ui-1.8.12.custom.min.js"></script> 
+<script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery-1.5.1.min.js"></script> 
+<script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery-ui-1.8.12.custom.min.js"></script> 
 {% 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 %}
 <div id="lava-server-extension-navigation" class="lava-server-sub-toolbar">
   <ul>
-    <li><a href="{% url linaro_django_xmlrpc.views.default_handler %}">{% trans "XML-RPC Handler" %}</a></li>
+    <li><a href="{% url linaro_django_xmlrpc.views.help %}">{% trans "API Help" %}</a></li>
     <li><a href="{% url linaro_django_xmlrpc.views.tokens %}">{% trans "Authentication Tokens" %}</a></li>
   </ul>
 </div>
@@ -19,5 +19,5 @@ 
 
 {% block breadcrumbs %}
 {{ block.super }}
-<li><a href="{% url linaro_django_xmlrpc.views.handler %}">{% trans "XML-RPC Handler" %}</a></li>
+<li><a href="{% url linaro_django_xmlrpc.views.handler %}">{% trans "API Help" %}</a></li>
 {% 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 %}
 <h2>About XML-RPC API</h2>
-<p>This URL is an XML-RPC server. You can interact with it using any XML-RPC
+<p>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:</p>
 <pre>
 import xmlrpclib
 server = xmlrpclib.ServerProxy("{{ site_url }}{% url linaro_django_xmlrpc.views.handler %}")
 print server.version()
 </pre>
-<p>The rest of this page is an automatically generated documentation of the
-available functions.</p>
 
 <h2>Available functions</h2>
 <div id="accordion">

=== 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 %}
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava/css/demo_table_jui.css"/>
-<script type="text/javascript" src="{{ STATIC_URL }}lava/js/jquery.dataTables.min.js"></script> 
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/demo_table_jui.css"/>
+<script type="text/javascript" src="{{ STATIC_URL }}lava-server/js/jquery.dataTables.min.js"></script> 
 {% 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 }}
-<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava/css/login.css"/>
-<script src="{{ STATIC_URL }}lava/js/jquery.watermark.min.js" type="text/javascript"></script>
-<script src="{{ STATIC_URL }}lava/js/jquery.pseudofocus.js" type="text/javascript"></script>
+<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}lava-server/css/login.css"/>
+<script src="{{ STATIC_URL }}lava-server/js/jquery.watermark.min.js" type="text/javascript"></script>
+<script src="{{ STATIC_URL }}lava-server/js/jquery.pseudofocus.js" type="text/javascript"></script>
 {% 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',