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
a8811960
Commit
a8811960
authored
May 12, 2012
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't compile not outdated file, for fastest development
parent
dd2eed6e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
pipeline/compilers/__init__.py
+10
-2
No files found.
pipeline/compilers/__init__.py
View file @
a8811960
...
@@ -29,14 +29,16 @@ class Compiler(object):
...
@@ -29,14 +29,16 @@ class Compiler(object):
compiler
=
compiler
(
self
.
verbose
)
compiler
=
compiler
(
self
.
verbose
)
if
compiler
.
match_file
(
path
):
if
compiler
.
match_file
(
path
):
new_path
=
self
.
output_path
(
path
,
compiler
.
output_extension
)
new_path
=
self
.
output_path
(
path
,
compiler
.
output_extension
)
content
=
self
.
read_file
(
path
)
paths
[
index
]
=
new_path
if
not
self
.
is_outdated
(
path
,
new_path
):
continue
# No need to re-compile this file
try
:
try
:
content
=
self
.
read_file
(
path
)
compiled_content
=
compiler
.
compile_file
(
content
,
finders
.
find
(
path
))
compiled_content
=
compiler
.
compile_file
(
content
,
finders
.
find
(
path
))
self
.
save_file
(
new_path
,
compiled_content
)
self
.
save_file
(
new_path
,
compiled_content
)
except
CompilerError
:
except
CompilerError
:
if
not
self
.
storage
.
exists
(
new_path
)
or
not
settings
.
PIPELINE
:
if
not
self
.
storage
.
exists
(
new_path
)
or
not
settings
.
PIPELINE
:
raise
raise
paths
[
index
]
=
new_path
return
paths
return
paths
def
output_path
(
self
,
path
,
extension
):
def
output_path
(
self
,
path
,
extension
):
...
@@ -49,6 +51,12 @@ class Compiler(object):
...
@@ -49,6 +51,12 @@ class Compiler(object):
file
.
close
()
file
.
close
()
return
content
return
content
def
is_outdated
(
self
,
path
,
new_path
):
try
:
return
self
.
storage
.
modified_time
(
path
)
>
self
.
storage
.
modified_time
(
new_path
)
except
OSError
:
return
True
def
save_file
(
self
,
path
,
content
):
def
save_file
(
self
,
path
,
content
):
return
self
.
storage
.
save
(
path
,
ContentFile
(
smart_str
(
content
)))
return
self
.
storage
.
save
(
path
,
ContentFile
(
smart_str
(
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