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
ae6b3f8e
Commit
ae6b3f8e
authored
Oct 20, 2016
by
Austin Pua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Django 1.10 deprecation warnings described in #586
parent
41fced3d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
pipeline/collector.py
+8
-2
No files found.
pipeline/collector.py
View file @
ae6b3f8e
...
...
@@ -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
:
...
...
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