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
837f02cd
Commit
837f02cd
authored
Oct 20, 2016
by
Timothée Peignier
Committed by
GitHub
Oct 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #594 from malefice/master
Start Django 1.10 compatibility
parents
b0f83b9b
baf1e6ab
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
4 deletions
+28
-4
.travis.yml
+4
-0
AUTHORS
+1
-0
pipeline/collector.py
+8
-2
pipeline/middleware.py
+7
-1
tests/utils.py
+6
-0
tox.ini
+2
-1
No files found.
.travis.yml
View file @
837f02cd
...
...
@@ -16,6 +16,10 @@ env:
-
TOXENV=pypy-django19
-
TOXENV=py34-django19
-
TOXENV=py35-django19
-
TOXENV=py27-django110
-
TOXENV=pypy-django110
-
TOXENV=py34-django110
-
TOXENV=py35-django110
docsinstall
:
pip install -q tox
before_install
:
-
nvm install node
...
...
AUTHORS
View file @
837f02cd
...
...
@@ -18,6 +18,7 @@ or just made Pipeline more awesome.
* Andy Kish <agkish@gmail.com>
* Ara Anjargolian <ara818@gmail.com>
* Arnar Yngvason <arnar@hvitahusid.is>
* Austin Pua <pua.austin.anderson@gmail.com>
* Axel Haustant <noirbizarre@gmail.com>
* Balazs Kossovics <balazs.kossovics@e-loue.com>
* Ben Vinegar <ben@benv.ca>
...
...
pipeline/collector.py
View file @
837f02cd
...
...
@@ -4,6 +4,7 @@ import os
from
collections
import
OrderedDict
import
django
from
django.contrib.staticfiles
import
finders
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.utils
import
six
...
...
@@ -19,6 +20,11 @@ class Collector(object):
storage
=
staticfiles_storage
self
.
storage
=
storage
def
_get_modified_time
(
self
,
storage
,
prefixed_path
):
if
django
.
VERSION
[:
2
]
>=
(
1
,
10
):
return
storage
.
get_modified_time
(
prefixed_path
)
return
storage
.
modified_time
(
prefixed_path
)
def
clear
(
self
,
path
=
""
):
dirs
,
files
=
self
.
storage
.
listdir
(
path
)
for
f
in
files
:
...
...
@@ -65,14 +71,14 @@ class Collector(object):
if
self
.
storage
.
exists
(
prefixed_path
):
try
:
# When was the target file modified last time?
target_last_modified
=
self
.
storage
.
modified_time
(
prefixed_path
)
target_last_modified
=
self
.
_get_modified_time
(
self
.
storage
,
prefixed_path
)
except
(
OSError
,
NotImplementedError
,
AttributeError
):
# The storage doesn't support ``modified_time`` or failed
pass
else
:
try
:
# When was the source file modified last time?
source_last_modified
=
s
ource_storage
.
modified_time
(
path
)
source_last_modified
=
s
elf
.
_get_modified_time
(
source_storage
,
prefixed_
path
)
except
(
OSError
,
NotImplementedError
,
AttributeError
):
pass
else
:
...
...
pipeline/middleware.py
View file @
837f02cd
...
...
@@ -6,8 +6,14 @@ from django.utils.html import strip_spaces_between_tags as minify_html
from
pipeline.conf
import
settings
try
:
# Support for Django 1.10 new MIDDLEWARE setting
from
django.utils.deprecation
import
MiddlewareMixin
except
ImportError
:
# Django < 1.10
MiddlewareMixin
=
object
class
MinifyHTMLMiddleware
(
object
):
class
MinifyHTMLMiddleware
(
MiddlewareMixin
):
def
__init__
(
self
):
if
not
settings
.
PIPELINE_ENABLED
:
raise
MiddlewareNotUsed
...
...
tests/utils.py
View file @
837f02cd
import
os
import
django
from
django.conf
import
settings
from
django.utils
import
six
...
...
@@ -17,6 +18,11 @@ def _(path):
class
pipeline_settings
(
override_settings
):
def
__init__
(
self
,
**
kwargs
):
if
django
.
VERSION
[:
2
]
>=
(
1
,
10
):
# Django 1.10's override_settings inherits from TestContextDecorator
# and its __init__ method calls its superclass' __init__ method too,
# so we must do the same.
super
(
pipeline_settings
,
self
)
.
__init__
()
self
.
options
=
{
'PIPELINE'
:
kwargs
}
...
...
tox.ini
View file @
837f02cd
[tox]
envlist
=
{py27,pypy,py34}-django{16,17,18,19
},py35-django19
,docs
{py27,pypy,py34}-django{16,17,18,19
,110},py35-django{19,110}
,docs
[testenv]
basepython
=
...
...
@@ -15,6 +15,7 @@ deps =
django17:
Django>=1.7,<1.8
django18:
Django>=1.8,<1.9
django19:
Django>=1.9,<1.10
django110:
Django>=1.10,<1.11
jinja2
jsmin
=
=2.2.0
ply
=
=3.4
...
...
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