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
044ad01c
Commit
044ad01c
authored
Dec 16, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove packages files from processing
parent
a9f4f90a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
32 deletions
+9
-32
pipeline/storage.py
+9
-32
No files found.
pipeline/storage.py
View file @
044ad01c
try
:
try
:
from
staticfiles
import
finders
from
staticfiles.storage
import
CachedStaticFilesStorage
,
StaticFilesStorage
from
staticfiles.storage
import
CachedStaticFilesStorage
,
StaticFilesStorage
except
ImportError
:
except
ImportError
:
from
django.contrib.staticfiles
import
finders
from
django.contrib.staticfiles.storage
import
CachedStaticFilesStorage
,
StaticFilesStorage
from
django.contrib.staticfiles.storage
import
CachedStaticFilesStorage
,
StaticFilesStorage
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.files.storage
import
get_storage_class
from
django.core.files.storage
import
get_storage_class
from
django.utils.functional
import
LazyObject
from
django.utils.functional
import
LazyObject
from
pipeline.conf
import
settings
from
pipeline.conf
import
settings
class
BaseFinderStorage
(
StaticFilesStorage
):
class
PipelineStorage
(
StaticFilesStorage
):
finders
=
None
def
__init__
(
self
,
finders
=
None
,
*
args
,
**
kwargs
):
if
finders
is
not
None
:
self
.
finders
=
finders
if
self
.
finders
is
None
:
raise
ImproperlyConfigured
(
"The storage
%
r doesn't have a finders class assigned."
%
self
.
__class__
)
super
(
BaseFinderStorage
,
self
)
.
__init__
(
*
args
,
**
kwargs
)
def
path
(
self
,
name
):
path
=
self
.
finders
.
find
(
name
)
if
not
path
:
path
=
super
(
BaseFinderStorage
,
self
)
.
path
(
name
)
return
path
def
exists
(
self
,
name
):
exists
=
self
.
finders
.
find
(
name
)
!=
None
if
not
exists
:
exists
=
super
(
BaseFinderStorage
,
self
)
.
exists
(
name
)
return
exists
class
PipelineFinderStorage
(
BaseFinderStorage
):
finders
=
finders
class
PipelineStorage
(
PipelineFinderStorage
):
def
post_process
(
self
,
paths
,
dry_run
=
False
,
**
options
):
def
post_process
(
self
,
paths
,
dry_run
=
False
,
**
options
):
from
pipeline.packager
import
Packager
from
pipeline.packager
import
Packager
if
dry_run
:
if
dry_run
:
return
[]
return
[]
packager
=
Packager
()
packager
=
Packager
()
for
package_name
in
packager
.
packages
[
'css'
]:
for
package_name
in
packager
.
packages
[
'css'
]:
package
=
packager
.
package_for
(
'css'
,
package_name
)
package
=
packager
.
package_for
(
'css'
,
package_name
)
for
path
in
package
[
'paths'
]:
if
path
in
paths
:
paths
.
remove
(
path
)
output_file
=
packager
.
pack_stylesheets
(
package
)
output_file
=
packager
.
pack_stylesheets
(
package
)
paths
.
append
(
output_file
)
paths
.
append
(
output_file
)
for
package_name
in
packager
.
packages
[
'js'
]:
for
package_name
in
packager
.
packages
[
'js'
]:
package
=
packager
.
package_for
(
'js'
,
package_name
)
package
=
packager
.
package_for
(
'js'
,
package_name
)
for
path
in
package
[
'paths'
]:
if
path
in
paths
:
paths
.
remove
(
path
)
output_file
=
packager
.
pack_javascripts
(
package
)
output_file
=
packager
.
pack_javascripts
(
package
)
paths
.
append
(
output_file
)
paths
.
append
(
output_file
)
return
super
(
PipelineStorage
,
self
)
.
post_process
(
paths
,
dry_run
,
**
options
)
return
super
(
PipelineStorage
,
self
)
.
post_process
(
paths
,
dry_run
,
**
options
)
...
...
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