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
8eb006ca
Commit
8eb006ca
authored
May 07, 2011
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix external urls bug
parent
b9ccb5a7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
5 deletions
+28
-5
compress/packager.py
+4
-3
tests/runtests.py
+2
-2
tests/tests/packager.py
+22
-0
No files found.
compress/packager.py
View file @
8eb006ca
...
...
@@ -77,9 +77,12 @@ class Packager(object):
for
name
in
config
:
packages
[
name
]
=
{}
paths
=
[]
if
'external_urls'
in
config
[
name
]:
packages
[
name
][
'externals'
]
=
config
[
name
][
'external_urls'
]
continue
for
path
in
config
[
name
][
'source_filenames'
]:
full_path
=
os
.
path
.
join
(
settings
.
COMPRESS_ROOT
,
path
)
paths
.
extend
([
os
.
path
.
normpath
(
path
)
paths
.
extend
([
os
.
path
.
normpath
(
path
)
.
replace
(
settings
.
COMPRESS_ROOT
,
''
)
for
path
in
glob
.
glob
(
full_path
)])
packages
[
name
][
'paths'
]
=
paths
packages
[
name
][
'output'
]
=
config
[
name
][
'output_filename'
]
...
...
@@ -88,8 +91,6 @@ class Packager(object):
packages
[
name
][
'context'
]
=
config
[
name
][
'extra_context'
]
if
'template_name'
in
config
[
name
]:
packages
[
name
][
'template'
]
=
config
[
name
][
'template_name'
]
if
'externals_urls'
in
config
[
name
]:
packages
[
name
][
'externals'
]
=
config
[
name
][
'external_urls'
]
return
packages
...
...
tests/runtests.py
View file @
8eb006ca
...
...
@@ -15,9 +15,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/packager.py
View file @
8eb006ca
...
...
@@ -19,5 +19,27 @@ class PackagerTest(TestCase):
self
.
assertEqual
(
individual_url
,
"http://localhost/static/js/application.js"
)
def
test_external_urls
(
self
):
packager
=
Packager
()
packages
=
packager
.
create_packages
({
'jquery'
:
{
'external_urls'
:
(
'//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'
,)
},
'application'
:
{
'source_filenames'
:
(
'js/application.js'
,),
'output_filename'
:
'application.r?.js'
}
})
self
.
assertEqual
(
packages
,
{
'jquery'
:
{
'externals'
:
(
'//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js'
,)
},
'application'
:
{
'context'
:
{},
'output'
:
'application.r?.js'
,
'paths'
:
[
'js/application.js'
]
}
})
def
tearDown
(
self
):
settings
.
COMPRESS_URL
=
self
.
old_compress_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