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
fee90f9b
Commit
fee90f9b
authored
Jun 17, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
searching for find the real culprit, while releasing too fast
parent
57b17ba2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
15 deletions
+15
-15
pipeline/compilers/__init__.py
+5
-5
pipeline/compilers/less/__init__.py
+2
-2
pipeline/compressors/__init__.py
+3
-3
pipeline/compressors/csstidy/__init__.py
+2
-2
pipeline/packager.py
+2
-2
pipeline/versioning/hash/__init__.py
+1
-1
No files found.
pipeline/compilers/__init__.py
View file @
fee90f9b
...
@@ -36,13 +36,13 @@ class Compiler(object):
...
@@ -36,13 +36,13 @@ class Compiler(object):
def
read_file
(
self
,
path
):
def
read_file
(
self
,
path
):
file
=
storage
.
open
(
path
,
'rb'
)
file
=
storage
.
open
(
path
,
'rb'
)
content
=
file
.
read
()
.
decode
(
'utf-8'
)
content
=
file
.
read
()
file
.
close
()
file
.
close
()
return
content
return
content
def
save_file
(
self
,
path
,
content
):
def
save_file
(
self
,
path
,
content
):
file
=
storage
.
open
(
path
,
'wb'
)
file
=
storage
.
open
(
path
,
'wb'
)
file
.
write
(
content
.
encode
(
'utf-8'
)
)
file
.
write
(
content
)
file
.
close
()
file
.
close
()
...
@@ -58,7 +58,7 @@ class CompilerBase(object):
...
@@ -58,7 +58,7 @@ class CompilerBase(object):
def
save_file
(
self
,
path
,
content
):
def
save_file
(
self
,
path
,
content
):
file
=
storage
.
open
(
path
,
'wb'
)
file
=
storage
.
open
(
path
,
'wb'
)
file
.
write
(
content
.
encode
(
'utf-8'
)
)
file
.
write
(
content
)
file
.
close
()
file
.
close
()
return
path
return
path
...
@@ -71,10 +71,10 @@ class SubProcessCompiler(CompilerBase):
...
@@ -71,10 +71,10 @@ class SubProcessCompiler(CompilerBase):
def
execute_command
(
self
,
command
,
content
):
def
execute_command
(
self
,
command
,
content
):
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
pipe
.
stdin
.
write
(
content
.
encode
(
'utf-8'
)
)
pipe
.
stdin
.
write
(
content
)
pipe
.
stdin
.
close
()
pipe
.
stdin
.
close
()
compressed_content
=
pipe
.
stdout
.
read
()
.
decode
(
'utf-8'
)
compressed_content
=
pipe
.
stdout
.
read
()
pipe
.
stdout
.
close
()
pipe
.
stdout
.
close
()
error
=
pipe
.
stderr
.
read
()
error
=
pipe
.
stderr
.
read
()
...
...
pipeline/compilers/less/__init__.py
View file @
fee90f9b
...
@@ -13,7 +13,7 @@ class LessCompiler(CompilerBase):
...
@@ -13,7 +13,7 @@ class LessCompiler(CompilerBase):
def
compile_file
(
self
,
content
):
def
compile_file
(
self
,
content
):
tmp_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w+b'
)
tmp_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w+b'
)
tmp_file
.
write
(
content
.
encode
(
'utf-8'
)
)
tmp_file
.
write
(
content
)
tmp_file
.
flush
()
tmp_file
.
flush
()
output_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w+b'
)
output_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w+b'
)
...
@@ -25,7 +25,7 @@ class LessCompiler(CompilerBase):
...
@@ -25,7 +25,7 @@ class LessCompiler(CompilerBase):
command_output
=
os
.
popen
(
command
)
.
read
()
command_output
=
os
.
popen
(
command
)
.
read
()
compiled_content
=
output_file
.
read
()
.
decode
(
'utf-8'
)
compiled_content
=
output_file
.
read
()
output_file
.
close
()
output_file
.
close
()
tmp_file
.
close
()
tmp_file
.
close
()
...
...
pipeline/compressors/__init__.py
View file @
fee90f9b
...
@@ -197,7 +197,7 @@ class Compressor(object):
...
@@ -197,7 +197,7 @@ class Compressor(object):
def
read_file
(
self
,
path
):
def
read_file
(
self
,
path
):
"""Read file content in binary mode"""
"""Read file content in binary mode"""
file
=
storage
.
open
(
path
,
'rb'
)
file
=
storage
.
open
(
path
,
'rb'
)
content
=
file
.
read
()
.
decode
(
'utf-8'
)
content
=
file
.
read
()
file
.
close
()
file
.
close
()
return
content
return
content
...
@@ -222,10 +222,10 @@ class SubProcessCompressor(CompressorBase):
...
@@ -222,10 +222,10 @@ class SubProcessCompressor(CompressorBase):
def
execute_command
(
self
,
command
,
content
):
def
execute_command
(
self
,
command
,
content
):
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
pipe
.
stdin
.
write
(
content
.
encode
(
'utf-8'
)
)
pipe
.
stdin
.
write
(
content
)
pipe
.
stdin
.
close
()
pipe
.
stdin
.
close
()
compressed_content
=
pipe
.
stdout
.
read
()
.
decode
(
'utf-8'
)
compressed_content
=
pipe
.
stdout
.
read
()
pipe
.
stdout
.
close
()
pipe
.
stdout
.
close
()
error
=
pipe
.
stderr
.
read
()
error
=
pipe
.
stderr
.
read
()
...
...
pipeline/compressors/csstidy/__init__.py
View file @
fee90f9b
...
@@ -11,7 +11,7 @@ warnings.simplefilter('ignore', RuntimeWarning)
...
@@ -11,7 +11,7 @@ warnings.simplefilter('ignore', RuntimeWarning)
class
CSSTidyCompressor
(
CompressorBase
):
class
CSSTidyCompressor
(
CompressorBase
):
def
compress_css
(
self
,
css
):
def
compress_css
(
self
,
css
):
tmp_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w+b'
)
tmp_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w+b'
)
tmp_file
.
write
(
css
.
encode
(
'utf-8'
)
)
tmp_file
.
write
(
css
)
tmp_file
.
flush
()
tmp_file
.
flush
()
output_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w+b'
)
output_file
=
tempfile
.
NamedTemporaryFile
(
mode
=
'w+b'
)
...
@@ -23,7 +23,7 @@ class CSSTidyCompressor(CompressorBase):
...
@@ -23,7 +23,7 @@ class CSSTidyCompressor(CompressorBase):
command_output
=
os
.
popen
(
command
)
.
read
()
command_output
=
os
.
popen
(
command
)
.
read
()
filtered_css
=
output_file
.
read
()
.
decode
(
'utf-8'
)
filtered_css
=
output_file
.
read
()
output_file
.
close
()
output_file
.
close
()
tmp_file
.
close
()
tmp_file
.
close
()
...
...
pipeline/packager.py
View file @
fee90f9b
...
@@ -73,7 +73,7 @@ class Packager(object):
...
@@ -73,7 +73,7 @@ class Packager(object):
def
save_file
(
self
,
path
,
content
):
def
save_file
(
self
,
path
,
content
):
file
=
storage
.
open
(
path
,
'wb'
)
file
=
storage
.
open
(
path
,
'wb'
)
file
.
write
(
content
.
encode
(
'utf-8'
)
)
file
.
write
(
content
)
file
.
close
()
file
.
close
()
return
path
return
path
...
@@ -90,7 +90,7 @@ class Packager(object):
...
@@ -90,7 +90,7 @@ class Packager(object):
for
pattern
in
config
[
name
][
'source_filenames'
]:
for
pattern
in
config
[
name
][
'source_filenames'
]:
for
path
in
glob
(
pattern
):
for
path
in
glob
(
pattern
):
if
not
path
in
paths
:
if
not
path
in
paths
:
paths
.
append
(
path
)
paths
.
append
(
str
(
path
)
)
packages
[
name
][
'paths'
]
=
[
path
for
path
in
paths
if
not
path
.
endswith
(
settings
.
PIPELINE_TEMPLATE_EXT
)]
packages
[
name
][
'paths'
]
=
[
path
for
path
in
paths
if
not
path
.
endswith
(
settings
.
PIPELINE_TEMPLATE_EXT
)]
packages
[
name
][
'templates'
]
=
[
path
for
path
in
paths
if
path
.
endswith
(
settings
.
PIPELINE_TEMPLATE_EXT
)]
packages
[
name
][
'templates'
]
=
[
path
for
path
in
paths
if
path
.
endswith
(
settings
.
PIPELINE_TEMPLATE_EXT
)]
packages
[
name
][
'output'
]
=
config
[
name
][
'output_filename'
]
packages
[
name
][
'output'
]
=
config
[
name
][
'output_filename'
]
...
...
pipeline/versioning/hash/__init__.py
View file @
fee90f9b
...
@@ -29,7 +29,7 @@ class HashVersioningBase(VersioningBase):
...
@@ -29,7 +29,7 @@ class HashVersioningBase(VersioningBase):
def
read_file
(
self
,
path
):
def
read_file
(
self
,
path
):
"""Read file content in binary mode"""
"""Read file content in binary mode"""
file
=
storage
.
open
(
path
,
'rb'
)
file
=
storage
.
open
(
path
,
'rb'
)
content
=
file
.
read
()
.
decode
(
'utf-8'
)
content
=
file
.
read
()
file
.
close
()
file
.
close
()
return
content
return
content
...
...
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