File: yuglify.py

package info (click to toggle)
python-django-compressor 2.0-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 896 kB
  • sloc: python: 3,917; makefile: 152
file content (26 lines) | stat: -rw-r--r-- 689 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from compressor.conf import settings
from compressor.filters import CompilerFilter


class YUglifyFilter(CompilerFilter):
    command = "{binary} {args}"

    def __init__(self, *args, **kwargs):
        super(YUglifyFilter, self).__init__(*args, **kwargs)
        self.command += ' --type=%s' % self.type


class YUglifyCSSFilter(YUglifyFilter):
    type = 'css'
    options = (
        ("binary", settings.COMPRESS_YUGLIFY_BINARY),
        ("args", settings.COMPRESS_YUGLIFY_CSS_ARGUMENTS),
    )


class YUglifyJSFilter(YUglifyFilter):
    type = 'js'
    options = (
        ("binary", settings.COMPRESS_YUGLIFY_BINARY),
        ("args", settings.COMPRESS_YUGLIFY_JS_ARGUMENTS),
    )