From: Jordan Augé Date: Thu, 19 Sep 2013 12:40:33 +0000 (+0200) Subject: fixed static file collection for third party components: now relying on symlinks X-Git-Tag: myslice-0.2-3~7 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=ed18f1b119ffd1796522ea4b53d84449d30ec854 fixed static file collection for third party components: now relying on symlinks --- diff --git a/third-party/codemirror b/third-party/codemirror new file mode 120000 index 00000000..bd8c3e78 --- /dev/null +++ b/third-party/codemirror @@ -0,0 +1 @@ +codemirror-3.15 \ No newline at end of file diff --git a/third-party/datatables b/third-party/datatables new file mode 120000 index 00000000..e657a7e3 --- /dev/null +++ b/third-party/datatables @@ -0,0 +1 @@ +datatables-1.9.4/ \ No newline at end of file diff --git a/third-party/datatables/css/README b/third-party/datatables-1.9.4/css/README similarity index 100% rename from third-party/datatables/css/README rename to third-party/datatables-1.9.4/css/README diff --git a/third-party/datatables/css/dataTables.bootstrap.css b/third-party/datatables-1.9.4/css/dataTables.bootstrap.css similarity index 100% rename from third-party/datatables/css/dataTables.bootstrap.css rename to third-party/datatables-1.9.4/css/dataTables.bootstrap.css diff --git a/third-party/datatables/css/dataTables.bootstrap.css.url b/third-party/datatables-1.9.4/css/dataTables.bootstrap.css.url similarity index 100% rename from third-party/datatables/css/dataTables.bootstrap.css.url rename to third-party/datatables-1.9.4/css/dataTables.bootstrap.css.url diff --git a/third-party/datatables/img/sort_asc.png b/third-party/datatables-1.9.4/img/sort_asc.png similarity index 100% rename from third-party/datatables/img/sort_asc.png rename to third-party/datatables-1.9.4/img/sort_asc.png diff --git a/third-party/datatables/img/sort_asc_disabled.png b/third-party/datatables-1.9.4/img/sort_asc_disabled.png similarity index 100% rename from third-party/datatables/img/sort_asc_disabled.png rename to third-party/datatables-1.9.4/img/sort_asc_disabled.png diff --git a/third-party/datatables/img/sort_both.png b/third-party/datatables-1.9.4/img/sort_both.png similarity index 100% rename from third-party/datatables/img/sort_both.png rename to third-party/datatables-1.9.4/img/sort_both.png diff --git a/third-party/datatables/img/sort_desc.png b/third-party/datatables-1.9.4/img/sort_desc.png similarity index 100% rename from third-party/datatables/img/sort_desc.png rename to third-party/datatables-1.9.4/img/sort_desc.png diff --git a/third-party/datatables/img/sort_desc_disabled.png b/third-party/datatables-1.9.4/img/sort_desc_disabled.png similarity index 100% rename from third-party/datatables/img/sort_desc_disabled.png rename to third-party/datatables-1.9.4/img/sort_desc_disabled.png diff --git a/third-party/datatables/img/sort_none.png b/third-party/datatables-1.9.4/img/sort_none.png similarity index 100% rename from third-party/datatables/img/sort_none.png rename to third-party/datatables-1.9.4/img/sort_none.png diff --git a/third-party/datatables/js/dataTables-1.9.3.js b/third-party/datatables-1.9.4/js/dataTables-1.9.3.js similarity index 100% rename from third-party/datatables/js/dataTables-1.9.3.js rename to third-party/datatables-1.9.4/js/dataTables-1.9.3.js diff --git a/third-party/datatables/js/dataTables-1.9.4.js b/third-party/datatables-1.9.4/js/dataTables-1.9.4.js similarity index 100% rename from third-party/datatables/js/dataTables-1.9.4.js rename to third-party/datatables-1.9.4/js/dataTables-1.9.4.js diff --git a/third-party/datatables/js/dataTables-1.9.4.url b/third-party/datatables-1.9.4/js/dataTables-1.9.4.url similarity index 100% rename from third-party/datatables/js/dataTables-1.9.4.url rename to third-party/datatables-1.9.4/js/dataTables-1.9.4.url diff --git a/third-party/datatables/js/dataTables.bootstrap.js b/third-party/datatables-1.9.4/js/dataTables.bootstrap.js similarity index 100% rename from third-party/datatables/js/dataTables.bootstrap.js rename to third-party/datatables-1.9.4/js/dataTables.bootstrap.js diff --git a/third-party/datatables/js/dataTables.bootstrap.js.url b/third-party/datatables-1.9.4/js/dataTables.bootstrap.js.url similarity index 100% rename from third-party/datatables/js/dataTables.bootstrap.js.url rename to third-party/datatables-1.9.4/js/dataTables.bootstrap.js.url diff --git a/third-party/datatables/js/dataTables.js b/third-party/datatables-1.9.4/js/dataTables.js similarity index 100% rename from third-party/datatables/js/dataTables.js rename to third-party/datatables-1.9.4/js/dataTables.js diff --git a/third-party/jquery b/third-party/jquery new file mode 120000 index 00000000..e71f93a4 --- /dev/null +++ b/third-party/jquery @@ -0,0 +1 @@ +jquery-2.0.3/ \ No newline at end of file diff --git a/third-party/jquery/js/jquery-1.10.2.js b/third-party/jquery-2.0.3/js/jquery-1.10.2.js similarity index 100% rename from third-party/jquery/js/jquery-1.10.2.js rename to third-party/jquery-2.0.3/js/jquery-1.10.2.js diff --git a/third-party/jquery/js/jquery-1.10.2.js.url b/third-party/jquery-2.0.3/js/jquery-1.10.2.js.url similarity index 100% rename from third-party/jquery/js/jquery-1.10.2.js.url rename to third-party/jquery-2.0.3/js/jquery-1.10.2.js.url diff --git a/third-party/jquery/js/jquery-1.10.2.min.js b/third-party/jquery-2.0.3/js/jquery-1.10.2.min.js similarity index 100% rename from third-party/jquery/js/jquery-1.10.2.min.js rename to third-party/jquery-2.0.3/js/jquery-1.10.2.min.js diff --git a/third-party/jquery/js/jquery-1.10.2.min.js.url b/third-party/jquery-2.0.3/js/jquery-1.10.2.min.js.url similarity index 100% rename from third-party/jquery/js/jquery-1.10.2.min.js.url rename to third-party/jquery-2.0.3/js/jquery-1.10.2.min.js.url diff --git a/third-party/jquery/js/jquery-1.7.2.js b/third-party/jquery-2.0.3/js/jquery-1.7.2.js similarity index 100% rename from third-party/jquery/js/jquery-1.7.2.js rename to third-party/jquery-2.0.3/js/jquery-1.7.2.js diff --git a/third-party/jquery/js/jquery-1.7.2.js.url b/third-party/jquery-2.0.3/js/jquery-1.7.2.js.url similarity index 100% rename from third-party/jquery/js/jquery-1.7.2.js.url rename to third-party/jquery-2.0.3/js/jquery-1.7.2.js.url diff --git a/third-party/jquery/js/jquery-1.7.2.min.js b/third-party/jquery-2.0.3/js/jquery-1.7.2.min.js similarity index 100% rename from third-party/jquery/js/jquery-1.7.2.min.js rename to third-party/jquery-2.0.3/js/jquery-1.7.2.min.js diff --git a/third-party/jquery/js/jquery-1.7.2.min.js.url b/third-party/jquery-2.0.3/js/jquery-1.7.2.min.js.url similarity index 100% rename from third-party/jquery/js/jquery-1.7.2.min.js.url rename to third-party/jquery-2.0.3/js/jquery-1.7.2.min.js.url diff --git a/third-party/jquery/js/jquery-1.9.1.js b/third-party/jquery-2.0.3/js/jquery-1.9.1.js similarity index 100% rename from third-party/jquery/js/jquery-1.9.1.js rename to third-party/jquery-2.0.3/js/jquery-1.9.1.js diff --git a/third-party/jquery/js/jquery-1.9.1.min.js b/third-party/jquery-2.0.3/js/jquery-1.9.1.min.js similarity index 100% rename from third-party/jquery/js/jquery-1.9.1.min.js rename to third-party/jquery-2.0.3/js/jquery-1.9.1.min.js diff --git a/third-party/jquery/js/jquery-1.9.1.min.js.url b/third-party/jquery-2.0.3/js/jquery-1.9.1.min.js.url similarity index 100% rename from third-party/jquery/js/jquery-1.9.1.min.js.url rename to third-party/jquery-2.0.3/js/jquery-1.9.1.min.js.url diff --git a/third-party/jquery/js/jquery-2.0.3.js b/third-party/jquery-2.0.3/js/jquery-2.0.3.js similarity index 100% rename from third-party/jquery/js/jquery-2.0.3.js rename to third-party/jquery-2.0.3/js/jquery-2.0.3.js diff --git a/third-party/jquery/js/jquery-2.0.3.js.url b/third-party/jquery-2.0.3/js/jquery-2.0.3.js.url similarity index 100% rename from third-party/jquery/js/jquery-2.0.3.js.url rename to third-party/jquery-2.0.3/js/jquery-2.0.3.js.url diff --git a/third-party/jquery/js/jquery-2.0.3.min.js b/third-party/jquery-2.0.3/js/jquery-2.0.3.min.js similarity index 100% rename from third-party/jquery/js/jquery-2.0.3.min.js rename to third-party/jquery-2.0.3/js/jquery-2.0.3.min.js diff --git a/third-party/jquery/js/jquery-2.0.3.min.js.url b/third-party/jquery-2.0.3/js/jquery-2.0.3.min.js.url similarity index 100% rename from third-party/jquery/js/jquery-2.0.3.min.js.url rename to third-party/jquery-2.0.3/js/jquery-2.0.3.min.js.url diff --git a/third-party/jquery/js/jquery.js b/third-party/jquery-2.0.3/js/jquery.js similarity index 100% rename from third-party/jquery/js/jquery.js rename to third-party/jquery-2.0.3/js/jquery.js diff --git a/third-party/jquery/js/jquery.min.js b/third-party/jquery-2.0.3/js/jquery.min.js similarity index 100% rename from third-party/jquery/js/jquery.min.js rename to third-party/jquery-2.0.3/js/jquery.min.js diff --git a/third-party/jquery/js/jquery.validate.js b/third-party/jquery-2.0.3/js/jquery.validate.js similarity index 100% rename from third-party/jquery/js/jquery.validate.js rename to third-party/jquery-2.0.3/js/jquery.validate.js diff --git a/third-party/jquery-html5storage b/third-party/jquery-html5storage new file mode 120000 index 00000000..aa2a90fc --- /dev/null +++ b/third-party/jquery-html5storage @@ -0,0 +1 @@ +jquery-html5storage-1.0 \ No newline at end of file diff --git a/third-party/jquery-html5storage/jquery.html5storage.js b/third-party/jquery-html5storage-1.0/jquery.html5storage.js similarity index 100% rename from third-party/jquery-html5storage/jquery.html5storage.js rename to third-party/jquery-html5storage-1.0/jquery.html5storage.js diff --git a/third-party/jquery-html5storage/jquery.html5storage.min.js b/third-party/jquery-html5storage-1.0/jquery.html5storage.min.js similarity index 100% rename from third-party/jquery-html5storage/jquery.html5storage.min.js rename to third-party/jquery-html5storage-1.0/jquery.html5storage.min.js diff --git a/third-party/jquery-html5storage/jquery.html5storage.url b/third-party/jquery-html5storage-1.0/jquery.html5storage.url similarity index 100% rename from third-party/jquery-html5storage/jquery.html5storage.url rename to third-party/jquery-html5storage-1.0/jquery.html5storage.url diff --git a/third-party/jquery-notify b/third-party/jquery-notify new file mode 120000 index 00000000..cf980dda --- /dev/null +++ b/third-party/jquery-notify @@ -0,0 +1 @@ +jquery-notify-1.5 \ No newline at end of file diff --git a/third-party/jquery-notify/alert.png b/third-party/jquery-notify-1.5/alert.png similarity index 100% rename from third-party/jquery-notify/alert.png rename to third-party/jquery-notify-1.5/alert.png diff --git a/third-party/jquery-notify/jquery.notify.js b/third-party/jquery-notify-1.5/jquery.notify.js similarity index 100% rename from third-party/jquery-notify/jquery.notify.js rename to third-party/jquery-notify-1.5/jquery.notify.js diff --git a/third-party/jquery-notify/jquery.notify.min.js b/third-party/jquery-notify-1.5/jquery.notify.min.js similarity index 100% rename from third-party/jquery-notify/jquery.notify.min.js rename to third-party/jquery-notify-1.5/jquery.notify.min.js diff --git a/third-party/jquery-notify/style.css b/third-party/jquery-notify-1.5/style.css similarity index 100% rename from third-party/jquery-notify/style.css rename to third-party/jquery-notify-1.5/style.css diff --git a/third-party/jquery-notify/ui.notify.css b/third-party/jquery-notify-1.5/ui.notify.css similarity index 100% rename from third-party/jquery-notify/ui.notify.css rename to third-party/jquery-notify-1.5/ui.notify.css diff --git a/third-party/mustache b/third-party/mustache new file mode 120000 index 00000000..a73c9dde --- /dev/null +++ b/third-party/mustache @@ -0,0 +1 @@ +mustache-7035bf3e5f \ No newline at end of file diff --git a/third-party/mustache/mustache.js b/third-party/mustache-7035bf3e5f/mustache.js similarity index 100% rename from third-party/mustache/mustache.js rename to third-party/mustache-7035bf3e5f/mustache.js diff --git a/third-party/smartwizard b/third-party/smartwizard new file mode 120000 index 00000000..3745e8fb --- /dev/null +++ b/third-party/smartwizard @@ -0,0 +1 @@ +smartwizard-1636c86 \ No newline at end of file diff --git a/third-party/uuid b/third-party/uuid new file mode 120000 index 00000000..d7a8d5f2 --- /dev/null +++ b/third-party/uuid @@ -0,0 +1 @@ +uuid-1.4/ \ No newline at end of file diff --git a/third-party/uuid/Math.uuid.js b/third-party/uuid-1.4/Math.uuid.js similarity index 100% rename from third-party/uuid/Math.uuid.js rename to third-party/uuid-1.4/Math.uuid.js diff --git a/third-party/uuid/Math.uuid.js.url b/third-party/uuid-1.4/Math.uuid.js.url similarity index 100% rename from third-party/uuid/Math.uuid.js.url rename to third-party/uuid-1.4/Math.uuid.js.url diff --git a/unfold/static.py b/unfold/static.py index 815e8e22..ad38a9ef 100644 --- a/unfold/static.py +++ b/unfold/static.py @@ -4,6 +4,16 @@ from django.utils.datastructures import SortedDict from django.contrib.staticfiles.finders import BaseFinder, FileSystemFinder from django.core.files.storage import FileSystemStorage +# DEPRECATED # # http://nicks-liquid-soapbox.blogspot.fr/2011/03/splitting-path-to-list-in-python.html +# DEPRECATED # def splitpath(path, maxdepth=20): +# DEPRECATED # ( head, tail ) = os.path.split(path) +# DEPRECATED # return splitpath(head, maxdepth - 1) + [ tail ] \ +# DEPRECATED # if maxdepth and head and head != path \ +# DEPRECATED # else [ head or tail ] + +# The plugin finder is responsible for collecting JS, CSS and PNG files from +# the plugins, which are not declared in the myslice.settings file unlike +# applications. class PluginFinder(FileSystemFinder): """ A static files finder that looks in the directory of each plugin as @@ -75,27 +85,57 @@ class ThirdPartyFinder(BaseFinder): a two item iterable consisting of the relative path and storage instance. """ - for (path, dirs, files) in os.walk(settings.THIRDPARTY_DIR): - for file in files: - name, extension = os.path.splitext(file) - for type, extensions in self.extensions.items(): - if not extension in extensions: - continue - filesystem_storage = FileSystemStorage(location=path) - filesystem_storage.prefix = type - yield file, filesystem_storage + for component in os.listdir(settings.THIRDPARTY_DIR): + # We are looking forward symlinks only + component_path = os.path.join(settings.THIRDPARTY_DIR, component) + if not os.path.islink(component_path) or not os.path.isdir(component_path): + continue + + for (path, dirs, files) in os.walk(component_path): + for file in files: + name, extension = os.path.splitext(file) -class BaseFinder(object): - """ - A base file finder to be used for custom staticfiles finder classes. - """ + for type, extensions in self.extensions.items(): + if not extension in extensions: + continue + filesystem_storage = FileSystemStorage(location=path) + filesystem_storage.prefix = type + yield file, filesystem_storage + +# DEPRECATED # for (path, dirs, files) in os.walk(settings.THIRDPARTY_DIR): +# DEPRECATED # component_path = path[len(settings.THIRDPARTY_DIR)+1:] +# DEPRECATED # component_name = splitpath(component_path)[0] +# DEPRECATED # print "PATH", path, " -- COMPONENT", component_name +# DEPRECATED # if not os.path.islink(os.path.join(path, component_name)): +# DEPRECATED # print "IGNORED", component_name +# DEPRECATED # continue +# DEPRECATED # print "COMPONENT ADDED: ", component_name +# DEPRECATED # print "==" +# DEPRECATED # +# DEPRECATED # +# DEPRECATED # for file in files: +# DEPRECATED # name, extension = os.path.splitext(file) +# DEPRECATED # +# DEPRECATED # for type, extensions in self.extensions.items(): +# DEPRECATED # if not extension in extensions: +# DEPRECATED # continue +# DEPRECATED # filesystem_storage = FileSystemStorage(location=path) +# DEPRECATED # filesystem_storage.prefix = type +# DEPRECATED # yield file, filesystem_storage - def list(self, ignore_patterns): - """ - Given an optional list of paths to ignore, this should return - a two item iterable consisting of the relative path and storage - instance. - """ - raise NotImplementedError() +# XXX I commented this since it should be imported from django.contrib.staticfiles.finders -- jordan + +#class BaseFinder(object): +# """ +# A base file finder to be used for custom staticfiles finder classes. +# """ +# +# def list(self, ignore_patterns): +# """ +# Given an optional list of paths to ignore, this should return +# a two item iterable consisting of the relative path and storage +# instance. +# """ +# raise NotImplementedError()