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
3cf8257f
Commit
3cf8257f
authored
Oct 26, 2012
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve python3 support
parent
c66df66a
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
66 additions
and
14 deletions
+66
-14
pipeline/compilers/__init__.py
+2
-0
pipeline/compilers/coffee.py
+2
-0
pipeline/compilers/less.py
+2
-0
pipeline/compilers/sass.py
+2
-0
pipeline/compilers/stylus.py
+2
-0
pipeline/compressors/__init__.py
+6
-6
pipeline/compressors/closure.py
+2
-0
pipeline/compressors/cssmin.py
+2
-0
pipeline/compressors/csstidy.py
+2
-0
pipeline/compressors/jsmin.py
+1
-1
pipeline/compressors/slimit.py
+1
-1
pipeline/compressors/uglifyjs.py
+2
-0
pipeline/compressors/yui.py
+2
-0
pipeline/conf/settings.py
+2
-0
pipeline/glob.py
+2
-0
pipeline/jinja2/ext.py
+2
-0
pipeline/manifest.py
+2
-0
pipeline/middleware.py
+2
-0
pipeline/packager.py
+2
-0
pipeline/signals.py
+2
-0
pipeline/storage.py
+3
-1
pipeline/templatetags/compressed.py
+3
-1
pipeline/utils.py
+2
-0
tests/tests/test_compiler.py
+2
-0
tests/tests/test_compressor.py
+5
-3
tests/tests/test_glob.py
+2
-0
tests/tests/test_jinja2.py
+1
-1
tests/tests/test_packager.py
+2
-0
tests/tests/test_storage.py
+2
-0
tests/tests/test_utils.py
+2
-0
No files found.
pipeline/compilers/__init__.py
View file @
3cf8257f
from
__future__
import
unicode_literals
import
os
import
subprocess
...
...
pipeline/compilers/coffee.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compilers
import
SubProcessCompiler
...
...
pipeline/compilers/less.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
os.path
import
dirname
from
pipeline.conf
import
settings
...
...
pipeline/compilers/sass.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
os.path
import
dirname
from
pipeline.conf
import
settings
...
...
pipeline/compilers/stylus.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
os.path
import
dirname
from
pipeline.conf
import
settings
...
...
pipeline/compressors/__init__.py
View file @
3cf8257f
from
__future__
import
unicode_literals
import
base64
import
os
import
posixpath
...
...
@@ -8,8 +10,6 @@ from itertools import takewhile
from
django.utils.encoding
import
smart_bytes
,
force_text
from
django.contrib.staticfiles
import
finders
from
pipeline.conf
import
settings
from
pipeline.storage
import
default_storage
from
pipeline.utils
import
to_class
,
relpath
...
...
@@ -86,8 +86,8 @@ class Compressor(object):
base_path
=
self
.
base_path
(
paths
)
for
path
in
paths
:
contents
=
self
.
read_file
(
path
)
contents
=
re
.
sub
(
"
\r
?
\n
"
,
"
\\\\
n"
,
contents
)
contents
=
re
.
sub
(
"'"
,
"
\\
'"
,
contents
)
contents
=
re
.
sub
(
b
"
\r
?
\n
"
,
b
"
\\\\
n"
,
contents
)
contents
=
re
.
sub
(
b
"'"
,
b
"
\\
'"
,
contents
)
name
=
self
.
template_name
(
path
,
base_path
)
compiled
+=
"
%
s['
%
s'] =
%
s('
%
s');
\n
"
%
(
namespace
,
...
...
@@ -138,7 +138,7 @@ class Compressor(object):
def
concatenate
(
self
,
paths
):
"""Concatenate together a list of files"""
return
'
\n
'
.
join
([
self
.
read_file
(
path
)
for
path
in
paths
])
return
b
"
\n
"
.
join
([
self
.
read_file
(
path
)
for
path
in
paths
])
def
construct_asset_path
(
self
,
asset_path
,
css_path
,
output_filename
,
variant
=
None
):
"""Return a rewritten asset URL for a stylesheet"""
...
...
@@ -203,7 +203,7 @@ class Compressor(object):
def
read_file
(
self
,
path
):
"""Read file content in binary mode"""
file
=
default_storage
.
open
(
path
,
'rb'
)
file
=
default_storage
.
open
(
path
)
content
=
file
.
read
()
file
.
close
()
return
content
...
...
pipeline/compressors/closure.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
pipeline/compressors/cssmin.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
pipeline/compressors/csstidy.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
django.core.files
import
temp
as
tempfile
from
pipeline.conf
import
settings
...
...
pipeline/compressors/jsmin.py
View file @
3cf8257f
from
__future__
import
absolute_import
from
__future__
import
absolute_import
,
unicode_literals
from
pipeline.compressors
import
CompressorBase
...
...
pipeline/compressors/slimit.py
View file @
3cf8257f
from
__future__
import
absolute_import
from
__future__
import
absolute_import
,
unicode_literals
from
pipeline.compressors
import
CompressorBase
...
...
pipeline/compressors/uglifyjs.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
pipeline/compressors/yui.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
pipeline.conf
import
settings
from
pipeline.compressors
import
SubProcessCompressor
...
...
pipeline/conf/settings.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
django.conf
import
settings
PIPELINE
=
getattr
(
settings
,
'PIPELINE'
,
not
settings
.
DEBUG
)
...
...
pipeline/glob.py
View file @
3cf8257f
from
__future__
import
unicode_literals
import
os
import
re
import
fnmatch
...
...
pipeline/jinja2/ext.py
View file @
3cf8257f
from
__future__
import
unicode_literals
import
inspect
from
django.contrib.staticfiles.storage
import
staticfiles_storage
...
...
pipeline/manifest.py
View file @
3cf8257f
from
__future__
import
unicode_literals
import
os
from
django.contrib.staticfiles.finders
import
get_finders
...
...
pipeline/middleware.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
django.utils.encoding
import
DjangoUnicodeDecodeError
from
django.utils.html
import
strip_spaces_between_tags
as
minify_html
...
...
pipeline/packager.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
django.core.files.base
import
ContentFile
from
django.utils.encoding
import
smart_str
...
...
pipeline/signals.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
django.dispatch
import
Signal
...
...
pipeline/storage.py
View file @
3cf8257f
from
__future__
import
unicode_literals
import
os
from
django.contrib.staticfiles
import
finders
from
django.contrib.staticfiles.storage
import
CachedFilesMixin
,
StaticFilesStorage
from
django.contrib.staticfiles.storage
import
CachedFilesMixin
,
StaticFilesStorage
# noqa
from
django.core.exceptions
import
ImproperlyConfigured
from
django.core.files.storage
import
get_storage_class
...
...
pipeline/templatetags/compressed.py
View file @
3cf8257f
from
django.contrib.staticfiles.storage
import
staticfiles_storage
from
__future__
import
unicode_literals
from
django.contrib.staticfiles.storage
import
staticfiles_storage
# noqa
from
django
import
template
from
django.template.loader
import
render_to_string
...
...
pipeline/utils.py
View file @
3cf8257f
from
__future__
import
unicode_literals
import
mimetypes
import
posixpath
import
urllib
...
...
tests/tests/test_compiler.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
pipeline.conf
import
settings
...
...
tests/tests/test_compressor.py
View file @
3cf8257f
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
import
base64
try
:
from
mock
import
patch
except
:
from
unittest.mock
import
patch
from
unittest.mock
import
patch
# noqa
from
django.test
import
TestCase
...
...
@@ -37,7 +39,7 @@ class CompressorTest(TestCase):
_
(
'pipeline/js/first.js'
),
_
(
'pipeline/js/second.js'
)
])
self
.
assertEquals
(
"""function concat() {
\n
console.log(arguments);
\n
}
\n\n
function cat() {
\n
console.log("hello world");
\n
}
\n
"""
,
js
)
self
.
assertEquals
(
b
"""function concat() {
\n
console.log(arguments);
\n
}
\n\n
function cat() {
\n
console.log("hello world");
\n
}
\n
"""
,
js
)
@patch.object
(
base64
,
'b64encode'
)
def
test_encoded_content
(
self
,
mock
):
...
...
@@ -102,7 +104,7 @@ class CompressorTest(TestCase):
output
=
self
.
compressor
.
concatenate_and_rewrite
([
_
(
'pipeline/css/urls.css'
),
],
'css/screen.css'
)
self
.
assertEquals
(
u
"""@font-face {
self
.
assertEquals
(
"""@font-face {
font-family: 'Pipeline';
src: url(../pipeline/fonts/pipeline.eot);
src: url(../pipeline/fonts/pipeline.eot?#iefix) format('embedded-opentype');
...
...
tests/tests/test_glob.py
View file @
3cf8257f
from
__future__
import
unicode_literals
import
os
import
shutil
...
...
tests/tests/test_jinja2.py
View file @
3cf8257f
# -*- coding: utf-8 -*-
from
__future__
import
absolute_import
from
__future__
import
absolute_import
,
unicode_literals
from
django.conf
import
settings
from
django.test
import
TestCase
...
...
tests/tests/test_packager.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
pipeline.packager
import
Packager
,
PackageNotFound
...
...
tests/tests/test_storage.py
View file @
3cf8257f
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
django.utils.datastructures
import
SortedDict
...
...
tests/tests/test_utils.py
View file @
3cf8257f
# -*- coding: utf-8 -*-
from
__future__
import
unicode_literals
from
django.test
import
TestCase
from
pipeline.utils
import
guess_type
...
...
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