Browse Source

less compiler accept several arguments including compression

main
Vincent Bernat 13 years ago
parent
commit
21f64f056b
1 changed files with 14 additions and 1 deletions
  1. +14
    -1
      hyde/ext/plugins/less.py

+ 14
- 1
hyde/ext/plugins/less.py View File

@@ -71,11 +71,24 @@ class LessCSSPlugin(CLTransformer):
"""
if not resource.source_file.kind == 'less':
return

supported = [
"verbose",
("silent", "s"),
("compress", "x"),
"O0",
"O1",
"O2"
]

less = self.app
source = File.make_temp(text)
target = File.make_temp('')
args = [str(less)]
args.extend(self.process_args(supported))
args.extend([str(source), str(target)])
try:
self.call_app([str(less), str(source), str(target)])
self.call_app(args)
except subprocess.CalledProcessError:
raise self.template.exception_class(
"Cannot process %s. Error occurred when "


Loading…
Cancel
Save