comparison piecrust/processing/compressors.py @ 853:f070a4fc033c

core: Continue PieCrust3 refactor, simplify pages. The asset pipeline is still the only function pipeline at this point. * No more `QualifiedPage`, and several other pieces of code deleted. * Data providers are simpler and more focused. For instance, the page iterator doesn't try to support other types of items. * Route parameters are proper known source metadata to remove the confusion between the two. * Make the baker and pipeline more correctly manage records and record histories. * Add support for record collapsing and deleting stale outputs in the asset pipeline.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 21 May 2017 00:06:59 -0700
parents 0ab712eab0fb
children a3dec0fbd9ce
comparison
equal deleted inserted replaced
852:4850f8c21b6e 853:f070a4fc033c
15 def __init__(self): 15 def __init__(self):
16 super(CleanCssProcessor, self).__init__() 16 super(CleanCssProcessor, self).__init__()
17 self._conf = None 17 self._conf = None
18 18
19 def matches(self, path): 19 def matches(self, path):
20 return path.endswith('.css') 20 return path.endswith('.css') and not path.endswith('.min.css')
21 21
22 def getOutputFilenames(self, filename): 22 def getOutputFilenames(self, filename):
23 self._ensureInitialized() 23 self._ensureInitialized()
24 basename, _ = os.path.splitext(filename) 24 basename, _ = os.path.splitext(filename)
25 return ['%s%s' % (basename, self._conf['out_ext'])] 25 return ['%s%s' % (basename, self._conf['out_ext'])]
71 71
72 def __init__(self): 72 def __init__(self):
73 super(UglifyJSProcessor, self).__init__({'js': 'js'}) 73 super(UglifyJSProcessor, self).__init__({'js': 'js'})
74 self._conf = None 74 self._conf = None
75 75
76 def matches(self, path):
77 return path.endswith('.js') and not path.endswith('.min.js')
78
76 def _doProcess(self, in_path, out_path): 79 def _doProcess(self, in_path, out_path):
77 self._ensureInitialized() 80 self._ensureInitialized()
78 81
79 args = [self._conf['bin'], in_path, '-o', out_path] 82 args = [self._conf['bin'], in_path, '-o', out_path]
80 args += self._conf['options'] 83 args += self._conf['options']