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
f5ec70b4
Commit
f5ec70b4
authored
Oct 31, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix absolute path generation
parent
8c16870f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
pipeline/compressors/__init__.py
+2
-2
tests/runtests.py
+2
-2
tests/tests/compressor.py
+2
-2
No files found.
pipeline/compressors/__init__.py
View file @
f5ec70b4
...
...
@@ -122,7 +122,7 @@ class Compressor(object):
def
construct_asset_path
(
self
,
asset_path
,
css_path
,
variant
=
None
):
"""Return a rewritten asset URL for a stylesheet"""
public_path
=
self
.
absolute_path
(
asset_path
,
css_path
)
public_path
=
self
.
absolute_path
(
asset_path
,
os
.
path
.
dirname
(
css_path
)
)
if
self
.
embeddable
(
public_path
,
variant
):
return
"__EMBED__
%
s"
%
public_path
if
not
os
.
path
.
isabs
(
asset_path
):
...
...
@@ -195,7 +195,7 @@ class Compressor(object):
if
os
.
path
.
isabs
(
path
):
path
=
os
.
path
.
join
(
settings
.
PIPELINE_ROOT
,
path
)
else
:
path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
start
)
,
path
)
path
=
os
.
path
.
join
(
start
,
path
)
return
os
.
path
.
normpath
(
path
)
def
relative_path
(
self
,
absolute_path
):
...
...
tests/runtests.py
View file @
f5ec70b4
...
...
@@ -16,9 +16,9 @@ if not settings.configured:
'tests'
],
MEDIA_URL
=
'/media/'
,
MEDIA_ROOT
=
os
.
path
.
join
(
TEST_DIR
,
'media
/
'
),
MEDIA_ROOT
=
os
.
path
.
join
(
TEST_DIR
,
'media'
),
STATIC_URL
=
'/static/'
,
STATIC_ROOT
=
os
.
path
.
join
(
TEST_DIR
,
'static
/
'
),
STATIC_ROOT
=
os
.
path
.
join
(
TEST_DIR
,
'static'
),
TEMPLATE_DIRS
=
(
os
.
path
.
join
(
TEST_DIR
,
'templates'
),
),
...
...
tests/tests/compressor.py
View file @
f5ec70b4
...
...
@@ -52,10 +52,10 @@ class CompressorTest(TestCase):
def
test_absolute_path
(
self
):
absolute_path
=
self
.
compressor
.
absolute_path
(
'../../images/sprite.png'
,
'css/plugins/
gallery.css
'
)
'css/plugins/'
)
self
.
assertEquals
(
absolute_path
,
'images/sprite.png'
)
absolute_path
=
self
.
compressor
.
absolute_path
(
'/images/sprite.png'
,
'css/plugins/
gallery.css
'
)
'css/plugins/'
)
self
.
assertEquals
(
absolute_path
,
'/images/sprite.png'
)
def
test_template_name
(
self
):
...
...
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