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
43b4cc34
Commit
43b4cc34
authored
Oct 17, 2013
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #266 from wienczny/master
Fix Python 3 compatibility
parents
79fd14ed
735dcee0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
pipeline/finders.py
+3
-2
pipeline/glob.py
+1
-1
pipeline/utils.py
+6
-2
No files found.
pipeline/finders.py
View file @
43b4cc34
from
itertools
import
chain
from
django.contrib.staticfiles.finders
import
BaseFinder
,
AppDirectoriesFinder
,
FileSystemFinder
,
find
from
django.utils._os
import
safe_join
from
pipeline.conf
import
settings
class
PipelineFinder
(
BaseFinder
):
def
find
(
self
,
path
,
all
=
False
):
"""
Looks for files in PIPELINE_CSS and PIPELINE_JS
"""
matches
=
[]
for
elem
in
settings
.
PIPELINE_CSS
.
values
()
+
settings
.
PIPELINE_JS
.
values
(
):
for
elem
in
chain
(
settings
.
PIPELINE_CSS
.
values
(),
settings
.
PIPELINE_JS
.
values
()
):
if
elem
[
'output_filename'
]
==
path
:
match
=
safe_join
(
settings
.
PIPELINE_ROOT
,
path
)
if
not
all
:
...
...
pipeline/glob.py
View file @
43b4cc34
...
...
@@ -63,7 +63,7 @@ def glob1(dirname, pattern):
# and storage implementations are really exotic.
return
[]
if
pattern
[
0
]
!=
'.'
:
names
=
filter
(
lambda
x
:
x
[
0
]
!=
'.'
,
names
)
names
=
[
x
for
x
in
names
if
x
[
0
]
!=
'.'
]
return
fnmatch
.
filter
(
names
,
pattern
)
...
...
pipeline/utils.py
View file @
43b4cc34
...
...
@@ -2,7 +2,11 @@ from __future__ import unicode_literals
import
mimetypes
import
posixpath
import
urllib
try
:
from
urllib.parse
import
quote
except
ImportError
:
from
urllib
import
quote
from
django.utils
import
importlib
from
django.utils.encoding
import
smart_str
...
...
@@ -23,7 +27,7 @@ def to_class(class_str):
def
filepath_to_uri
(
path
):
if
path
is
None
:
return
path
return
urllib
.
quote
(
smart_str
(
path
)
.
replace
(
"
\\
"
,
"/"
),
safe
=
"/~!*()'#?"
)
return
quote
(
smart_str
(
path
)
.
replace
(
"
\\
"
,
"/"
),
safe
=
"/~!*()'#?"
)
def
guess_type
(
path
,
default
=
None
):
...
...
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