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
24cb7544
Commit
24cb7544
authored
May 13, 2017
by
Sassan Haradji
Committed by
GitHub
May 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #585 from sassanh/master
added compiler_options field
parents
d6acb9c4
bdb4acde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
pipeline/compilers/__init__.py
+3
-2
pipeline/packager.py
+15
-3
No files found.
pipeline/compilers/__init__.py
View file @
24cb7544
...
@@ -27,7 +27,7 @@ class Compiler(object):
...
@@ -27,7 +27,7 @@ class Compiler(object):
def
compilers
(
self
):
def
compilers
(
self
):
return
[
to_class
(
compiler
)
for
compiler
in
settings
.
COMPILERS
]
return
[
to_class
(
compiler
)
for
compiler
in
settings
.
COMPILERS
]
def
compile
(
self
,
paths
,
force
=
False
):
def
compile
(
self
,
paths
,
compiler_options
=
{},
force
=
False
):
def
_compile
(
input_path
):
def
_compile
(
input_path
):
for
compiler
in
self
.
compilers
:
for
compiler
in
self
.
compilers
:
compiler
=
compiler
(
verbose
=
self
.
verbose
,
storage
=
self
.
storage
)
compiler
=
compiler
(
verbose
=
self
.
verbose
,
storage
=
self
.
storage
)
...
@@ -39,7 +39,8 @@ class Compiler(object):
...
@@ -39,7 +39,8 @@ class Compiler(object):
outfile
=
compiler
.
output_path
(
infile
,
compiler
.
output_extension
)
outfile
=
compiler
.
output_path
(
infile
,
compiler
.
output_extension
)
outdated
=
compiler
.
is_outdated
(
infile
,
outfile
)
outdated
=
compiler
.
is_outdated
(
infile
,
outfile
)
compiler
.
compile_file
(
infile
,
outfile
,
compiler
.
compile_file
(
infile
,
outfile
,
outdated
=
outdated
,
force
=
force
)
outdated
=
outdated
,
force
=
force
,
**
compiler_options
)
return
compiler
.
output_path
(
input_path
,
compiler
.
output_extension
)
return
compiler
.
output_path
(
input_path
,
compiler
.
output_extension
)
else
:
else
:
...
...
pipeline/packager.py
View file @
24cb7544
...
@@ -59,6 +59,10 @@ class Package(object):
...
@@ -59,6 +59,10 @@ class Package(object):
def
manifest
(
self
):
def
manifest
(
self
):
return
self
.
config
.
get
(
'manifest'
,
True
)
return
self
.
config
.
get
(
'manifest'
,
True
)
@property
def
compiler_options
(
self
):
return
self
.
config
.
get
(
'compiler_options'
,
{})
class
Packager
(
object
):
class
Packager
(
object
):
def
__init__
(
self
,
storage
=
None
,
verbose
=
False
,
css_packages
=
None
,
js_packages
=
None
):
def
__init__
(
self
,
storage
=
None
,
verbose
=
False
,
css_packages
=
None
,
js_packages
=
None
):
...
@@ -95,14 +99,22 @@ class Packager(object):
...
@@ -95,14 +99,22 @@ class Packager(object):
output_filename
=
package
.
output_filename
,
output_filename
=
package
.
output_filename
,
variant
=
package
.
variant
,
**
kwargs
)
variant
=
package
.
variant
,
**
kwargs
)
def
compile
(
self
,
paths
,
force
=
False
):
def
compile
(
self
,
paths
,
compiler_options
=
{},
force
=
False
):
return
self
.
compiler
.
compile
(
paths
,
force
=
force
)
return
self
.
compiler
.
compile
(
paths
,
compiler_options
=
compiler_options
,
force
=
force
,
)
def
pack
(
self
,
package
,
compress
,
signal
,
**
kwargs
):
def
pack
(
self
,
package
,
compress
,
signal
,
**
kwargs
):
output_filename
=
package
.
output_filename
output_filename
=
package
.
output_filename
if
self
.
verbose
:
if
self
.
verbose
:
print
(
"Saving:
%
s"
%
output_filename
)
print
(
"Saving:
%
s"
%
output_filename
)
paths
=
self
.
compile
(
package
.
paths
,
force
=
True
)
paths
=
self
.
compile
(
package
.
paths
,
compiler_options
=
package
.
compiler_options
,
force
=
True
,
)
content
=
compress
(
paths
,
**
kwargs
)
content
=
compress
(
paths
,
**
kwargs
)
self
.
save_file
(
output_filename
,
content
)
self
.
save_file
(
output_filename
,
content
)
signal
.
send
(
sender
=
self
,
package
=
package
,
**
kwargs
)
signal
.
send
(
sender
=
self
,
package
=
package
,
**
kwargs
)
...
...
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