Skip to content

Commit 084d82f

Browse files
exit99cyberdelia
authored andcommitted
Added mo-op compressors, and updated documentation
1 parent eb2740f commit 084d82f

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
:2e_*
44
*.tmproj
55
.*.swp
6+
*.swo
67
build
78
dist
89
MANIFEST
@@ -18,3 +19,4 @@ tests/assets/js/dummy.js
1819
.venv
1920
.project
2021
.pydevproject
22+
.ropeproject

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,5 @@ or just made Pipeline more awesome.
7878
* Trey Smith <[email protected]>
7979
* Venelin Stoykov <[email protected]>
8080
* Victor Shnayder <[email protected]>
81+
* Zachary Kazanski <[email protected]>
8182
* Zenobius Jiricek <[email protected]>

docs/compressors.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,17 @@ command to compress stylesheets. To use it, add this to your ``PIPELINE_CSS_COMP
221221

222222
Default to ``''``
223223

224+
No-Op Compressors
225+
=================
226+
227+
The No-Op compressor don't perform any operation, when used, only concatenation occurs.
228+
This is useful for debugging faulty concatenation due to poorly written javascript and other errors.
229+
230+
To use it, add this to your settings ::
231+
232+
PIPELINE_CSS_COMPRESSOR = 'pipeline.compressors.NoopCompressor'
233+
PIPELINE_JS_COMPRESSOR = 'pipeline.compressors.NoopCompressor'
234+
224235

225236
Write your own compressor class
226237
===============================

pipeline/compressors/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,11 @@ def execute_command(self, command, content):
238238
elif self.verbose:
239239
print(stderr)
240240
return force_text(stdout)
241+
242+
243+
class NoopCompressor(CompressorBase):
244+
def compress_js(self, js):
245+
return js
246+
247+
def compress_css(self, css):
248+
return css

0 commit comments

Comments
 (0)