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
a17312b2
Commit
a17312b2
authored
May 30, 2012
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't compile if not outdated in development, but force compilation when running collectstatic
parent
0a7b5496
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
pipeline/compilers/__init__.py
+4
-2
pipeline/packager.py
+3
-3
No files found.
pipeline/compilers/__init__.py
View file @
a17312b2
...
...
@@ -23,13 +23,15 @@ class Compiler(object):
return
[
to_class
(
compiler
)
for
compiler
in
settings
.
PIPELINE_COMPILERS
]
compilers
=
property
(
compilers
)
def
compile
(
self
,
paths
):
def
compile
(
self
,
paths
,
force
=
False
):
for
index
,
path
in
enumerate
(
paths
):
for
compiler
in
self
.
compilers
:
compiler
=
compiler
(
self
.
verbose
)
if
compiler
.
match_file
(
path
):
new_path
=
self
.
output_path
(
path
,
compiler
.
output_extension
)
paths
[
index
]
=
new_path
if
not
force
and
not
self
.
is_outdated
(
path
,
new_path
):
continue
try
:
content
=
self
.
read_file
(
path
)
compiled_content
=
compiler
.
compile_file
(
content
,
finders
.
find
(
path
))
...
...
@@ -52,7 +54,7 @@ class Compiler(object):
def
is_outdated
(
self
,
path
,
new_path
):
try
:
return
self
.
storage
.
modified_time
(
path
)
>
self
.
storage
.
modified_time
(
new_path
)
except
OSError
:
except
(
OSError
,
NotImplementedError
)
:
return
True
def
save_file
(
self
,
path
,
content
):
...
...
pipeline/packager.py
View file @
a17312b2
...
...
@@ -89,14 +89,14 @@ class Packager(object):
output_filename
=
package
.
output_filename
,
variant
=
package
.
variant
,
**
kwargs
)
def
compile
(
self
,
paths
):
return
self
.
compiler
.
compile
(
paths
)
def
compile
(
self
,
paths
,
force
=
False
):
return
self
.
compiler
.
compile
(
paths
,
force
=
force
)
def
pack
(
self
,
package
,
compress
,
signal
,
**
kwargs
):
output_filename
=
package
.
output_filename
if
self
.
verbose
:
print
"Saving:
%
s"
%
output_filename
paths
=
self
.
compile
(
package
.
paths
)
paths
=
self
.
compile
(
package
.
paths
,
force
=
True
)
content
=
compress
(
paths
,
**
kwargs
)
self
.
save_file
(
output_filename
,
content
)
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