From b709866ba93d98c32127ff4deae5b783e271e5b3 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 18 Mar 2013 14:13:06 +0100 Subject: [PATCH] split engine/ into manifold/ (backend oriented) and unfold/ (the UI) --- Makefile | 2 +- README | 7 +++++-- auth/manifoldbackend.py | 2 +- {engine => manifold}/__init__.py | 0 {engine => manifold}/manifoldapi.py | 0 {engine => manifold}/manifoldproxy.py | 4 ++-- {engine => manifold}/manifoldquery.py | 0 myslice/settings.py | 10 +++++++--- myslice/urls.py | 2 +- plugins/lists/simplelist.py | 2 +- plugins/lists/staticlist.py | 2 +- plugins/querycode/querycode.py | 2 +- plugins/quickfilter/quickfilter.py | 2 +- plugins/raw/raw.py | 2 +- plugins/tabs/tabs.py | 2 +- plugins/verticallayout/verticallayout.py | 2 +- trash/dashboard.py | 4 ++-- trash/pluginview.py | 2 +- trash/sampleviews.py | 2 +- unfold/__init__.py | 0 {engine => unfold}/composite.py | 2 +- {engine => unfold}/css/plugin.css | 0 {engine => unfold}/js/manifold-async.js | 0 {engine => unfold}/js/manifold-pubsub.js | 0 {engine => unfold}/js/manifold-query.js | 0 {engine => unfold}/js/onavail.js | 0 {engine => unfold}/js/plugin-init.js | 0 {engine => unfold}/js/plugin.js | 0 {engine => unfold}/models.py | 0 {engine => unfold}/page.py | 4 ++-- {engine => unfold}/plugin.py | 4 ++-- {engine => unfold}/prelude.py | 0 {engine => unfold}/templates/header-prelude.html | 0 {engine => unfold}/templates/plugin-setenv.js | 0 {engine => unfold}/templates/plugin.html | 0 {engine => unfold}/tests.py | 0 36 files changed, 33 insertions(+), 26 deletions(-) rename {engine => manifold}/__init__.py (100%) rename {engine => manifold}/manifoldapi.py (100%) rename {engine => manifold}/manifoldproxy.py (95%) rename {engine => manifold}/manifoldquery.py (100%) create mode 100644 unfold/__init__.py rename {engine => unfold}/composite.py (96%) rename {engine => unfold}/css/plugin.css (100%) rename {engine => unfold}/js/manifold-async.js (100%) rename {engine => unfold}/js/manifold-pubsub.js (100%) rename {engine => unfold}/js/manifold-query.js (100%) rename {engine => unfold}/js/onavail.js (100%) rename {engine => unfold}/js/plugin-init.js (100%) rename {engine => unfold}/js/plugin.js (100%) rename {engine => unfold}/models.py (100%) rename {engine => unfold}/page.py (98%) rename {engine => unfold}/plugin.py (99%) rename {engine => unfold}/prelude.py (100%) rename {engine => unfold}/templates/header-prelude.html (100%) rename {engine => unfold}/templates/plugin-setenv.js (100%) rename {engine => unfold}/templates/plugin.html (100%) rename {engine => unfold}/tests.py (100%) diff --git a/Makefile b/Makefile index a819950b..85b5d09a 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ thirdparty-css: thirdparty-img: @find $(THIRD-PARTY-RESOURCES) -name '*.png' -# we might have any of these as templates - e.g. ./engine/templates/plugin-setenv.js +# we might have any of these as templates - e.g. ./unfold/templates/plugin-setenv.js # so if there's a /templates/ in the path ignore the file local-js: force @find . -type f -name '*.js' | egrep -v '/all-(static|templates)/|/third-party/|/templates/' diff --git a/README b/README index 95a197ae..724fa20b 100644 --- a/README +++ b/README @@ -103,8 +103,11 @@ I've tried to keep track of the version I picked and to have an easy upgrade pat . settings.py . urls.py -* engine: - the code for building / rendering plugins / queries +* manifold: + the code for dealing with queries, sending them to the backend, and offering the /manifold/api/ proxy URL + +* unfold: + the code for building / rendering plugins * plugins: the actual code for plugins diff --git a/auth/manifoldbackend.py b/auth/manifoldbackend.py index dbaf863c..96697b3f 100644 --- a/auth/manifoldbackend.py +++ b/auth/manifoldbackend.py @@ -2,7 +2,7 @@ import time from django.contrib.auth.models import User -from engine.manifoldapi import ManifoldAPI +from manifold.manifoldapi import ManifoldAPI # Name my backend 'ManifoldBackend' class ManifoldBackend: diff --git a/engine/__init__.py b/manifold/__init__.py similarity index 100% rename from engine/__init__.py rename to manifold/__init__.py diff --git a/engine/manifoldapi.py b/manifold/manifoldapi.py similarity index 100% rename from engine/manifoldapi.py rename to manifold/manifoldapi.py diff --git a/engine/manifoldproxy.py b/manifold/manifoldproxy.py similarity index 95% rename from engine/manifoldproxy.py rename to manifold/manifoldproxy.py index f75d430c..3b3ba0fb 100644 --- a/engine/manifoldproxy.py +++ b/manifold/manifoldproxy.py @@ -3,8 +3,8 @@ import json #from django.core import serializers from django.http import HttpResponse, HttpResponseForbidden -from engine.manifoldquery import ManifoldQuery -from engine.manifoldapi import ManifoldAPI +from manifold.manifoldquery import ManifoldQuery +from manifold.manifoldapi import ManifoldAPI # add artificial delay in s debug_spin=0 diff --git a/engine/manifoldquery.py b/manifold/manifoldquery.py similarity index 100% rename from engine/manifoldquery.py rename to manifold/manifoldquery.py diff --git a/myslice/settings.py b/myslice/settings.py index a4a32214..0deec523 100644 --- a/myslice/settings.py +++ b/myslice/settings.py @@ -142,12 +142,16 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', + # handling the {% insert %} and {% container %} tags # see details in devel/django-insert-above-1.0-4 'insert_above', + # our django project 'myslice', - 'auth', - 'engine', + # the core of the UI + 'auth', 'manifold', 'unfold', + # plugins 'plugins', + # views - more or less stable 'views', 'trash', # Uncomment the next line to enable the admin: @@ -190,7 +194,7 @@ AUTHENTICATION_BACKENDS = ( 'auth.backend.MyCustomBackend', 'auth.manifoldbacken ### the view to redirect malformed (i.e. with a wrong CSRF) incoming requests # without this setting django will return a 403 forbidden error, which is fine # if you need to see the error message then use this setting -CSRF_FAILURE_VIEW = 'engine.manifoldproxy.csrf_failure' +CSRF_FAILURE_VIEW = 'manifold.manifoldproxy.csrf_failure' #################### for insert_above #IA_JS_FORMAT = "