Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-pipeline
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-pipeline
Commits
f5218a14
Commit
f5218a14
authored
Apr 17, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
closure only compact javascript
parent
cbeb85ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
compress/conf/settings.py
+1
-1
compress/filters/closure/__init__.py
+6
-9
No files found.
compress/conf/settings.py
View file @
f5218a14
...
@@ -25,7 +25,7 @@ COMPRESS_YUI_CSS_ARGUMENTS = getattr(settings, 'COMPRESS_YUI_CSS_ARGUMENTS', '')
...
@@ -25,7 +25,7 @@ COMPRESS_YUI_CSS_ARGUMENTS = getattr(settings, 'COMPRESS_YUI_CSS_ARGUMENTS', '')
COMPRESS_YUI_JS_ARGUMENTS
=
getattr
(
settings
,
'COMPRESS_YUI_JS_ARGUMENTS'
,
''
)
COMPRESS_YUI_JS_ARGUMENTS
=
getattr
(
settings
,
'COMPRESS_YUI_JS_ARGUMENTS'
,
''
)
COMPRESS_CLOSURE_BINARY
=
getattr
(
settings
,
'COMPRESS_CLOSURE_BINARY'
,
'java -jar compiler.jar'
)
COMPRESS_CLOSURE_BINARY
=
getattr
(
settings
,
'COMPRESS_CLOSURE_BINARY'
,
'java -jar compiler.jar'
)
COMPRESS_CLOSURE_
JS_ARGUMENTS
=
getattr
(
settings
,
'COMPRESS_CLOSURE_JS
_ARGUMENTS'
,
''
)
COMPRESS_CLOSURE_
ARGUMENTS
=
getattr
(
settings
,
'COMPRESS_CLOSURE
_ARGUMENTS'
,
''
)
COMPRESS_UGLIFYJS_BINARY
=
getattr
(
settings
,
'COMPRESS_UGLIFYJS_BINARY'
,
'/usr/local/bin/uglifyjs'
)
COMPRESS_UGLIFYJS_BINARY
=
getattr
(
settings
,
'COMPRESS_UGLIFYJS_BINARY'
,
'/usr/local/bin/uglifyjs'
)
COMPRESS_UGLIFYJS_ARGUMENTS
=
getattr
(
settings
,
'COMPRESS_UGLIFYJS_ARGUMENTS'
,
'-nc'
)
COMPRESS_UGLIFYJS_ARGUMENTS
=
getattr
(
settings
,
'COMPRESS_UGLIFYJS_ARGUMENTS'
,
'-nc'
)
...
...
compress/filters/closure/__init__.py
View file @
f5218a14
...
@@ -5,18 +5,18 @@ from compress.filters import FilterBase, FilterError
...
@@ -5,18 +5,18 @@ from compress.filters import FilterBase, FilterError
class
ClosureCompressorFilter
(
FilterBase
):
class
ClosureCompressorFilter
(
FilterBase
):
def
filter_
common
(
self
,
content
,
type_
,
argument
s
):
def
filter_
js
(
self
,
j
s
):
command
=
'
%
s
%
s'
%
(
settings
.
COMPRESS_CLOSURE_BINARY
,
arguments
)
command
=
'
%
s
%
s'
%
(
settings
.
COMPRESS_CLOSURE_BINARY
,
settings
.
COMPRESS_CLOSURE_ARGUMENTS
)
if
self
.
verbose
:
if
self
.
verbose
:
command
+=
' --verbose'
command
+=
' --verbose'
p
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
\
p
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
p
.
stdin
.
write
(
content
)
p
.
stdin
.
write
(
js
)
p
.
stdin
.
close
()
p
.
stdin
.
close
()
filtered_
cs
s
=
p
.
stdout
.
read
()
filtered_
j
s
=
p
.
stdout
.
read
()
p
.
stdout
.
close
()
p
.
stdout
.
close
()
err
=
p
.
stderr
.
read
()
err
=
p
.
stderr
.
read
()
...
@@ -31,7 +31,4 @@ class ClosureCompressorFilter(FilterBase):
...
@@ -31,7 +31,4 @@ class ClosureCompressorFilter(FilterBase):
if
self
.
verbose
:
if
self
.
verbose
:
print
err
print
err
return
filtered_css
return
filtered_js
def
filter_js
(
self
,
js
):
return
self
.
filter_common
(
js
,
'js'
,
settings
.
COMPRESS_CLOSURE_JS_ARGUMENTS
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment