Commit 39406c97 by Timothée Peignier

allow to specifiy several group as syncompress args

parent 1b724ab2
...@@ -23,20 +23,20 @@ class Command(BaseCommand): ...@@ -23,20 +23,20 @@ class Command(BaseCommand):
) )
) )
help = 'Updates and compresses CSS and JS on-demand' help = 'Updates and compresses CSS and JS on-demand'
args = '<group>' args = '<groups>'
def handle(self, group=None, **options): def handle(self, *args, **options):
from pipeline.packager import Packager from pipeline.packager import Packager
packager = Packager( packager = Packager(
force=options.get('force', False), force=options.get('force', False),
verbose=int(options.get('verbosity', 1)) >= 2 verbose=int(options.get('verbosity', 1)) >= 2
) )
sync = options.get('dry_run', True) sync = options.get('dry_run', True)
bust_cache = options.get('bust_cache', True) bust_cache = options.get('bust_cache', True)
for package_name in packager.packages['css']: for package_name in packager.packages['css']:
if group and package_name != group: if args and package_name not in args:
continue continue
package = packager.package_for('css', package_name) package = packager.package_for('css', package_name)
if packager.verbose or packager.force: if packager.verbose or packager.force:
...@@ -47,7 +47,7 @@ class Command(BaseCommand): ...@@ -47,7 +47,7 @@ class Command(BaseCommand):
packager.pack_stylesheets(package, sync=sync, bust_cache=bust_cache) packager.pack_stylesheets(package, sync=sync, bust_cache=bust_cache)
for package_name in packager.packages['js']: for package_name in packager.packages['js']:
if group and package_name != group: if args and package_name not in args:
continue continue
package = packager.package_for('js', package_name) package = packager.package_for('js', package_name)
if packager.verbose or packager.force: if packager.verbose or packager.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