Commit 9c365f99 by Timothée Peignier

remove syncompress command

parent b99e0fb9
......@@ -6,28 +6,6 @@ Usage
Describes how to use Pipeline when it is installed and configured.
Management command
==================
You can update and force updates of the compressed file(s) with the management command “synccompress”.
This makes it possible to keep the files updated manually.
The command is (assuming you are in you project-folder that contains ``manage.py``) ::
./manage.py synccompress
To force all files to be re-generated, use the argument ``--force`` ::
./manage.py synccompress --force
To re-generate only a specific group ::
./manage.py synccompress screen
To re-generate only specific groups ::
./manage.py synccompress screen print
Templatetags
============
......
from optparse import make_option
from django.core.management.base import BaseCommand
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--force',
action='store_true',
default=False,
help='Force compression and/or cache busting.'
),
make_option('--dry-run',
action='store_false',
default=True,
help='Don\'t attempt to compress package.'
)
)
help = 'Updates and compresses CSS and JS on-demand'
args = '<groups>'
def handle(self, *args, **options):
from pipeline.packager import Packager
force = options.get('force', False)
verbose = int(options.get('verbosity', 1)) >= 2
sync = options.get('dry_run', True)
packager = Packager(verbose=verbose)
for package_name in packager.packages['css']:
if args and package_name not in args:
continue
package = packager.package_for('css', package_name)
if verbose:
print
message = "CSS Group '%s'" % package_name
print message
print len(message) * '-'
packager.pack_stylesheets(package, sync=sync, force=force)
for package_name in packager.packages['js']:
if args and package_name not in args:
continue
package = packager.package_for('js', package_name)
if verbose:
print
message = "JS Group '%s'" % package_name
print message
print len(message) * '-'
packager.pack_javascripts(package, sync=sync, force=force)
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