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
f52ae576
Commit
f52ae576
authored
Jan 06, 2012
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix manifesto support
parent
adb9021f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
25 deletions
+13
-25
pipeline/manifest.py
+12
-21
pipeline/packager.py
+1
-4
No files found.
pipeline/manifest.py
View file @
f52ae576
import
os
try
:
from
staticfiles.finders
import
DefaultStorageFinder
except
ImportError
:
from
django.contrib.staticfiles.storage
import
DefaultStorageFinder
from
django.conf
import
settings
from
manifesto
import
Manifest
...
...
@@ -11,41 +16,27 @@ class PipelineManifest(Manifest):
def
__init__
(
self
):
self
.
packager
=
Packager
()
self
.
packages
=
self
.
collect_packages
()
self
.
finder
=
DefaultStorageFinder
()
def
collect_packages
(
self
):
packages
=
[]
for
package_name
in
self
.
packager
.
packages
[
'css'
]:
package
=
self
.
packager
.
package_for
(
'css'
,
package_name
)
if
package
[
'manifest'
]
:
if
package
.
manifest
:
packages
.
append
(
package
)
for
package_name
in
self
.
packager
.
packages
[
'js'
]:
package
=
self
.
packager
.
package_for
(
'js'
,
package_name
)
if
package
[
'manifest'
]
:
if
package
.
manifest
:
packages
.
append
(
package
)
return
packages
def
cache
(
self
):
if
settings
.
PIPELINE
:
for
package
in
self
.
packages
:
filename_base
,
filename
=
os
.
path
.
split
(
package
[
'output'
])
version
=
self
.
packager
.
versioning
.
version_from_file
(
filename_base
,
filename
)
output_filename
=
self
.
packager
.
versioning
.
output_filename
(
package
[
'output'
],
version
)
yield
str
(
self
.
packager
.
individual_url
(
output_filename
))
yield
str
(
self
.
packager
.
individual_url
(
package
.
output_filename
))
else
:
for
package
in
self
.
packages
:
for
path
in
self
.
packager
.
compile
(
package
[
'paths'
]
):
for
path
in
self
.
packager
.
compile
(
package
.
paths
):
yield
str
(
self
.
packager
.
individual_url
(
path
))
def
revision
(
self
):
versions
=
[]
if
settings
.
PIPELINE
:
for
package
in
self
.
packages
:
filename_base
,
filename
=
os
.
path
.
split
(
package
[
'output'
])
version
=
self
.
packager
.
versioning
.
version_from_file
(
filename_base
,
filename
)
versions
.
append
(
str
(
version
))
else
:
for
package
in
self
.
packages
:
version
=
self
.
packager
.
versioning
.
version
(
package
[
'paths'
])
versions
.
append
(
str
(
version
))
versions
.
sort
()
return
versions
[
-
1
]
for
path
in
self
.
finder
.
list
():
yield
str
(
self
.
packager
.
individual_url
(
path
))
pipeline/packager.py
View file @
f52ae576
...
...
@@ -87,10 +87,7 @@ class Packager(object):
)
def
individual_url
(
self
,
filename
):
relative_path
=
self
.
compressor
.
relative_path
(
filename
)[
1
:]
relative_url
=
relative_path
.
replace
(
os
.
sep
,
'/'
)
return
urlparse
.
urljoin
(
settings
.
PIPELINE_URL
,
relative_url
)
return
storage
.
url
(
filename
)
def
pack_stylesheets
(
self
,
package
,
**
kwargs
):
return
self
.
pack
(
package
,
self
.
compressor
.
compress_css
,
css_compressed
,
...
...
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