Subclassing YUI compressor (now with correct self.type) into specific CSS/JS versions.

This commit is contained in:
Justin Lilly
2009-06-05 09:28:46 +08:00
committed by Christian Metts
parent 8db794e003
commit f206d488f2

View File

@@ -17,7 +17,7 @@ class YUICompressorFilter(FilterBase):
if self.type == 'css':
arguments = CSS_ARGUMENTS
command = '%s --type=%s %s' % (BINARY, type_, arguments)
command = '%s --type=%s %s' % (BINARY, self.type, arguments)
if self.verbose:
command += ' --verbose'
@@ -41,4 +41,14 @@ class YUICompressorFilter(FilterBase):
if self.verbose:
print err
return filtered
return filtered
class YUICSSFilter(YUICompressorFilter):
def __init__(self, *args, **kwargs):
super(YUICSSFilter, self).__init__(*args, **kwargs)
self.type = 'css'
class YUIJSFilter(YUICompressorFilter):
def __init__(self, *args, **kwargs):
super(YUIJSFilter, self).__init__(*args, **kwargs)
self.type = 'js'