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
1d801441
Commit
1d801441
authored
Feb 02, 2012
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use django tempfile implementation to provide windows support
parent
27216d38
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
pipeline/compressors/csstidy/__init__.py
+5
-9
No files found.
pipeline/compressors/csstidy/__init__.py
View file @
1d801441
import
os
import
tempfile
from
django.core.files
import
temp
as
tempfile
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
@@ -7,18 +6,15 @@ from pipeline.compressors import SubProcessCompressor
class
CSSTidyCompressor
(
SubProcessCompressor
):
def
compress_css
(
self
,
css
):
out_file
,
out_filename
=
tempfile
.
mkstemp
()
out_file
=
os
.
fdopen
(
out_file
,
'rb'
)
output_file
=
tempfile
.
NamedTemporaryFile
(
suffix
=
'.pipeline'
)
command
=
'
%
s -
%
s
%
s'
%
(
settings
.
PIPELINE_CSSTIDY_BINARY
,
settings
.
PIPELINE_CSSTIDY_ARGUMENTS
,
out
_file
name
out
put_file
.
name
)
self
.
execute_command
(
command
,
css
)
filtered_css
=
out_file
.
read
()
out_file
.
close
()
os
.
remove
(
out_filename
)
filtered_css
=
output_file
.
read
()
output_file
.
close
()
return
filtered_css
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