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
31df862b
Commit
31df862b
authored
Nov 19, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change cwd for less and sass compiler
parent
5c421949
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
pipeline/compilers/__init__.py
+4
-3
pipeline/compilers/less/__init__.py
+4
-1
pipeline/compilers/sass/__init__.py
+4
-1
No files found.
pipeline/compilers/__init__.py
View file @
31df862b
...
@@ -68,9 +68,10 @@ class CompilerError(Exception):
...
@@ -68,9 +68,10 @@ class CompilerError(Exception):
class
SubProcessCompiler
(
CompilerBase
):
class
SubProcessCompiler
(
CompilerBase
):
def
execute_command
(
self
,
command
,
content
=
None
):
def
execute_command
(
self
,
command
,
content
=
None
,
cwd
=
None
):
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
cwd
=
cwd
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdout
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
if
content
:
if
content
:
pipe
.
stdin
.
write
(
content
)
pipe
.
stdin
.
write
(
content
)
...
...
pipeline/compilers/less/__init__.py
View file @
31df862b
import
os.path
from
pipeline.conf
import
settings
from
pipeline.conf
import
settings
from
pipeline.compilers
import
SubProcessCompiler
from
pipeline.compilers
import
SubProcessCompiler
...
@@ -14,5 +16,6 @@ class LessCompiler(SubProcessCompiler):
...
@@ -14,5 +16,6 @@ class LessCompiler(SubProcessCompiler):
settings
.
PIPELINE_LESS_ARGUMENTS
,
settings
.
PIPELINE_LESS_ARGUMENTS
,
path
path
)
)
content
=
self
.
execute_command
(
command
)
cwd
=
os
.
path
.
dirname
(
path
)
content
=
self
.
execute_command
(
command
,
cwd
=
cwd
)
return
content
return
content
pipeline/compilers/sass/__init__.py
View file @
31df862b
import
os.path
from
pipeline.conf
import
settings
from
pipeline.conf
import
settings
from
pipeline.compilers
import
SubProcessCompiler
from
pipeline.compilers
import
SubProcessCompiler
...
@@ -14,4 +16,5 @@ class SASSCompiler(SubProcessCompiler):
...
@@ -14,4 +16,5 @@ class SASSCompiler(SubProcessCompiler):
settings
.
PIPELINE_SASS_ARGUMENTS
,
settings
.
PIPELINE_SASS_ARGUMENTS
,
path
path
)
)
return
self
.
execute_command
(
command
)
cwd
=
os
.
path
.
dirname
(
path
)
return
self
.
execute_command
(
command
,
cwd
=
cwd
)
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