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
85a5ce9c
Commit
85a5ce9c
authored
Jan 26, 2012
by
Balazs KOSSOVICS
Committed by
Timothée Peignier
Feb 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
django 1.2 compatibility
Signed-off-by: Timothée Peignier <timothee.peignier@tryphon.org>
parent
bddd52d6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
8 deletions
+20
-8
pipeline/finders.py
+4
-1
pipeline/signals.py
+4
-3
pipeline/storage.py
+5
-1
tests/tests/compressor.py
+5
-3
tox.ini
+2
-0
No files found.
pipeline/finders.py
View file @
85a5ce9c
from
django.contrib.staticfiles.finders
import
BaseStorageFinder
try
:
from
django.contrib.staticfiles.finders
import
BaseStorageFinder
except
ImportError
:
from
staticfiles.finders
import
BaseStorageFinder
from
pipeline.storage
import
PipelineStorage
...
...
pipeline/signals.py
View file @
85a5ce9c
import
os
from
django.core.cache
import
cache
from
django.dispatch
import
Signal
,
receiver
from
django.dispatch
import
Signal
from
pipeline.conf
import
settings
...
...
@@ -10,9 +10,10 @@ css_compressed = Signal(providing_args=["package", "version"])
js_compressed
=
Signal
(
providing_args
=
[
"package"
,
"version"
])
@receiver
(
css_compressed
)
@receiver
(
js_compressed
)
def
invalidate_cache
(
sender
,
package
,
version
,
**
kwargs
):
filename_base
,
filename
=
os
.
path
.
split
(
package
[
'output'
])
cache
.
set
(
"pipeline:
%
s"
%
filename
,
str
(
version
),
settings
.
PIPELINE_CACHE_TIMEOUT
)
js_compressed
.
connect
(
invalidate_cache
)
css_compressed
.
connect
(
invalidate_cache
)
pipeline/storage.py
View file @
85a5ce9c
...
...
@@ -3,7 +3,11 @@ import os
from
datetime
import
datetime
from
django.contrib.staticfiles
import
finders
try
:
from
django.contrib.staticfiles
import
finders
except
ImportError
:
from
staticfiles
import
finders
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.files.storage
import
FileSystemStorage
,
get_storage_class
from
django.utils.functional
import
LazyObject
...
...
tests/tests/compressor.py
View file @
85a5ce9c
...
...
@@ -5,7 +5,10 @@ import sys
from
mock
import
patch
from
django.test
import
TestCase
from
django.utils
import
unittest
try
:
from
django.utils
import
unittest
except
ImportError
:
import
unittest2
as
unittest
from
pipeline.conf
import
settings
from
pipeline.compressors
import
Compressor
...
...
@@ -116,11 +119,10 @@ class CompressorTest(TestCase):
self
.
assertEquals
(
asset_path
,
"/images/sprite.png"
)
def
test_url_rewrite
(
self
):
self
.
maxDiff
=
None
output
=
self
.
compressor
.
concatenate_and_rewrite
([
'css/urls.css'
,
])
self
.
assert
MultiLineEqual
(
"""@font-face {
self
.
assert
Equals
(
"""@font-face {
font-family: 'Pipeline';
src: url(http://localhost/static/fonts/pipeline.eot);
src: url(http://localhost/static/fonts/pipeline.eot?#iefix) format('embedded-opentype');
...
...
tox.ini
View file @
85a5ce9c
...
...
@@ -10,6 +10,8 @@ commands =
deps
=
Django
=
=1.3.1
mock>=0.7.2
django-staticfiles
unittest2
[testenv:docs]
changedir
=
docs
...
...
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