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
05e0a940
Commit
05e0a940
authored
Jul 30, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ensuring that absolute path stay absolute. close #3
parent
4cd6026f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
3 deletions
+14
-3
pipeline/compressors/__init__.py
+1
-1
pipeline/conf/settings.py
+5
-0
pipeline/packager.py
+1
-1
tests/static/css/urls.css
+3
-0
tests/tests/compressor.py
+4
-1
No files found.
pipeline/compressors/__init__.py
View file @
05e0a940
...
@@ -207,7 +207,7 @@ class Compressor(object):
...
@@ -207,7 +207,7 @@ class Compressor(object):
def
relative_path
(
self
,
absolute_path
):
def
relative_path
(
self
,
absolute_path
):
"""Rewrite paths relative to the output stylesheet path"""
"""Rewrite paths relative to the output stylesheet path"""
compress_root
=
os
.
path
.
normpath
(
settings
.
PIPELINE_ROOT
)
compress_root
=
os
.
path
.
normpath
(
settings
.
PIPELINE_ROOT
)
return
os
.
path
.
join
(
'../'
,
absolute_path
.
replace
(
compress_root
,
''
))
return
os
.
path
.
join
(
os
.
sep
,
absolute_path
.
replace
(
compress_root
,
''
))
def
read_file
(
self
,
path
):
def
read_file
(
self
,
path
):
"""Read file content in binary mode"""
"""Read file content in binary mode"""
...
...
pipeline/conf/settings.py
View file @
05e0a940
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core.exceptions
import
ImproperlyConfigured
PIPELINE_ROOT
=
getattr
(
settings
,
'PIPELINE_ROOT'
,
settings
.
MEDIA_ROOT
)
PIPELINE_ROOT
=
getattr
(
settings
,
'PIPELINE_ROOT'
,
settings
.
MEDIA_ROOT
)
...
@@ -57,3 +58,7 @@ PIPELINE_LESS_ARGUMENTS = getattr(settings, 'PIPELINE_LESS_ARGUMENTS', '-x')
...
@@ -57,3 +58,7 @@ PIPELINE_LESS_ARGUMENTS = getattr(settings, 'PIPELINE_LESS_ARGUMENTS', '-x')
if
PIPELINE_COMPILERS
is
None
:
if
PIPELINE_COMPILERS
is
None
:
PIPELINE_COMPILERS
=
[]
PIPELINE_COMPILERS
=
[]
if
not
PIPELINE_URL
:
raise
ImproperlyConfigured
(
"You're using the pipeline app "
"without having set the required STATIC_URL setting."
)
pipeline/packager.py
View file @
05e0a940
...
@@ -109,7 +109,7 @@ class Packager(object):
...
@@ -109,7 +109,7 @@ class Packager(object):
if
'variant'
in
config
[
name
]:
if
'variant'
in
config
[
name
]:
packages
[
name
][
'variant'
]
=
config
[
name
][
'variant'
]
packages
[
name
][
'variant'
]
=
config
[
name
][
'variant'
]
if
'manifest'
in
config
[
name
]:
if
'manifest'
in
config
[
name
]:
packages
[
name
][
'manifest'
]
=
config
[
name
][
'manifest'
]
packages
[
name
][
'manifest'
]
=
config
[
name
][
'manifest'
]
return
packages
return
packages
...
...
tests/static/css/urls.css
View file @
05e0a940
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
background-image
:
url(../images/sprite-buttons.png)
;
background-image
:
url(../images/sprite-buttons.png)
;
}
}
.absolute-url
{
.absolute-url
{
background-image
:
url(/images/sprite-buttons.png)
;
}
.absolute-full-url
{
background-image
:
url(http://localhost/images/sprite-buttons.png)
;
background-image
:
url(http://localhost/images/sprite-buttons.png)
;
}
}
.no-protocol-url
{
.no-protocol-url
{
...
...
tests/tests/compressor.py
View file @
05e0a940
...
@@ -82,10 +82,13 @@ class CompressorTest(TestCase):
...
@@ -82,10 +82,13 @@ class CompressorTest(TestCase):
output
=
self
.
compressor
.
concatenate_and_rewrite
([
output
=
self
.
compressor
.
concatenate_and_rewrite
([
'css/urls.css'
,
'css/urls.css'
,
])
])
self
.
assert
Equals
(
""".relative-url {
self
.
assert
MultiLineEqual
(
""".relative-url {
background-image: url(http://localhost/static/images/sprite-buttons.png);
background-image: url(http://localhost/static/images/sprite-buttons.png);
}
}
.absolute-url {
.absolute-url {
background-image: url(http://localhost/static/images/sprite-buttons.png);
}
.absolute-full-url {
background-image: url(http://localhost/images/sprite-buttons.png);
background-image: url(http://localhost/images/sprite-buttons.png);
}
}
.no-protocol-url {
.no-protocol-url {
...
...
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