Commit 0a7b5496 by Timothée Peignier

add a non-packaging storage

parent 1758e5ab
...@@ -15,6 +15,8 @@ from pipeline.conf import settings ...@@ -15,6 +15,8 @@ from pipeline.conf import settings
class PipelineMixin(object): class PipelineMixin(object):
packing = True
def post_process(self, paths, dry_run=False, **options): def post_process(self, paths, dry_run=False, **options):
if dry_run: if dry_run:
return [] return []
...@@ -23,11 +25,15 @@ class PipelineMixin(object): ...@@ -23,11 +25,15 @@ class PipelineMixin(object):
packager = Packager(storage=self) packager = Packager(storage=self)
for package_name in packager.packages['css']: for package_name in packager.packages['css']:
package = packager.package_for('css', package_name) package = packager.package_for('css', package_name)
output_file = packager.pack_stylesheets(package) output_file = package.output_filename
if self.packing:
packager.pack_stylesheets(package)
paths[output_file] = (self, output_file) paths[output_file] = (self, output_file)
for package_name in packager.packages['js']: for package_name in packager.packages['js']:
package = packager.package_for('js', package_name) package = packager.package_for('js', package_name)
output_file = packager.pack_javascripts(package) output_file = package.output_filename
if self.packing:
packager.pack_javascripts(package)
paths[output_file] = (self, output_file) paths[output_file] = (self, output_file)
super_class = super(PipelineMixin, self) super_class = super(PipelineMixin, self)
...@@ -45,14 +51,26 @@ class PipelineMixin(object): ...@@ -45,14 +51,26 @@ class PipelineMixin(object):
return name return name
class NonPackagingMixin(object):
packing = False
class PipelineStorage(PipelineMixin, StaticFilesStorage): class PipelineStorage(PipelineMixin, StaticFilesStorage):
pass pass
class NonPackagingPipelineStorage(NonPackagingMixin, PipelineStorage):
pass
class PipelineCachedStorage(PipelineMixin, CachedFilesMixin, StaticFilesStorage): class PipelineCachedStorage(PipelineMixin, CachedFilesMixin, StaticFilesStorage):
pass pass
class NonPackagingPipelineCachedStorage(NonPackagingMixin, PipelineCachedStorage):
pass
class BaseFinderStorage(PipelineStorage): class BaseFinderStorage(PipelineStorage):
finders = None finders = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment