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
8767d16a
Commit
8767d16a
authored
Jun 30, 2015
by
Tadas Dailyda
Committed by
Timothée Peignier
Jul 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change smart_str to smart_bytes and smart_text for py3 compatibility
parent
a12407e5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
pipeline/compilers/__init__.py
+2
-2
pipeline/packager.py
+2
-2
pipeline/utils.py
+3
-3
No files found.
pipeline/compilers/__init__.py
View file @
8767d16a
...
@@ -10,7 +10,7 @@ except ImportError:
...
@@ -10,7 +10,7 @@ except ImportError:
from
django.contrib.staticfiles
import
finders
from
django.contrib.staticfiles
import
finders
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.core.files.base
import
ContentFile
from
django.core.files.base
import
ContentFile
from
django.utils.encoding
import
smart_
str
,
smart_
bytes
from
django.utils.encoding
import
smart_bytes
from
pipeline.conf
import
settings
from
pipeline.conf
import
settings
from
pipeline.exceptions
import
CompilerError
from
pipeline.exceptions
import
CompilerError
...
@@ -72,7 +72,7 @@ class CompilerBase(object):
...
@@ -72,7 +72,7 @@ class CompilerBase(object):
raise
NotImplementedError
raise
NotImplementedError
def
save_file
(
self
,
path
,
content
):
def
save_file
(
self
,
path
,
content
):
return
self
.
storage
.
save
(
path
,
ContentFile
(
smart_
str
(
content
)))
return
self
.
storage
.
save
(
path
,
ContentFile
(
smart_
bytes
(
content
)))
def
read_file
(
self
,
path
):
def
read_file
(
self
,
path
):
file
=
self
.
storage
.
open
(
path
,
'rb'
)
file
=
self
.
storage
.
open
(
path
,
'rb'
)
...
...
pipeline/packager.py
View file @
8767d16a
...
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
...
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
django.contrib.staticfiles.finders
import
find
from
django.contrib.staticfiles.finders
import
find
from
django.core.files.base
import
ContentFile
from
django.core.files.base
import
ContentFile
from
django.utils.encoding
import
smart_
str
from
django.utils.encoding
import
smart_
bytes
from
pipeline.compilers
import
Compiler
from
pipeline.compilers
import
Compiler
from
pipeline.compressors
import
Compressor
from
pipeline.compressors
import
Compressor
...
@@ -115,7 +115,7 @@ class Packager(object):
...
@@ -115,7 +115,7 @@ class Packager(object):
return
self
.
compressor
.
compile_templates
(
package
.
templates
)
return
self
.
compressor
.
compile_templates
(
package
.
templates
)
def
save_file
(
self
,
path
,
content
):
def
save_file
(
self
,
path
,
content
):
return
self
.
storage
.
save
(
path
,
ContentFile
(
smart_
str
(
content
)))
return
self
.
storage
.
save
(
path
,
ContentFile
(
smart_
bytes
(
content
)))
def
create_packages
(
self
,
config
):
def
create_packages
(
self
,
config
):
packages
=
{}
packages
=
{}
...
...
pipeline/utils.py
View file @
8767d16a
...
@@ -9,7 +9,7 @@ try:
...
@@ -9,7 +9,7 @@ try:
except
ImportError
:
except
ImportError
:
from
urllib
import
quote
from
urllib
import
quote
from
django.utils.encoding
import
smart_
str
from
django.utils.encoding
import
smart_
text
from
pipeline.conf
import
settings
from
pipeline.conf
import
settings
...
@@ -27,7 +27,7 @@ def to_class(class_str):
...
@@ -27,7 +27,7 @@ def to_class(class_str):
def
filepath_to_uri
(
path
):
def
filepath_to_uri
(
path
):
if
path
is
None
:
if
path
is
None
:
return
path
return
path
return
quote
(
smart_
str
(
path
)
.
replace
(
"
\\
"
,
"/"
),
safe
=
"/~!*()'#?"
)
return
quote
(
smart_
text
(
path
)
.
replace
(
"
\\
"
,
"/"
),
safe
=
"/~!*()'#?"
)
def
guess_type
(
path
,
default
=
None
):
def
guess_type
(
path
,
default
=
None
):
...
@@ -36,7 +36,7 @@ def guess_type(path, default=None):
...
@@ -36,7 +36,7 @@ def guess_type(path, default=None):
mimetype
,
_
=
mimetypes
.
guess_type
(
path
)
mimetype
,
_
=
mimetypes
.
guess_type
(
path
)
if
not
mimetype
:
if
not
mimetype
:
return
default
return
default
return
smart_
str
(
mimetype
)
return
smart_
text
(
mimetype
)
def
relpath
(
path
,
start
=
posixpath
.
curdir
):
def
relpath
(
path
,
start
=
posixpath
.
curdir
):
...
...
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