Commit a3f94e59 by Timothée Peignier

pep8 fixes

parent 76c3060c
......@@ -82,8 +82,8 @@ class CompilerError(Exception):
class SubProcessCompiler(CompilerBase):
def execute_command(self, command, content=None, cwd=None):
pipe = subprocess.Popen(command, shell=True, cwd=cwd,
stdout=subprocess.PIPE, stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout=subprocess.PIPE, stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
if content:
pipe.stdin.write(content)
......
......@@ -128,7 +128,7 @@ class Compressor(object):
if asset_path.startswith("http") or asset_path.startswith("//"):
return "url(%s)" % asset_path
asset_url = self.construct_asset_path(asset_path, path,
output_filename, variant)
output_filename, variant)
return "url(%s)" % asset_url
content = self.read_text(path)
# content needs to be unicode to avoid explosions with non-ascii chars
......@@ -232,7 +232,7 @@ class CompressorError(Exception):
class SubProcessCompressor(CompressorBase):
def execute_command(self, command, content):
pipe = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
stdin=subprocess.PIPE, stderr=subprocess.PIPE)
stdin=subprocess.PIPE, stderr=subprocess.PIPE)
pipe.stdin.write(smart_bytes(content))
pipe.stdin.close()
......
......@@ -7,14 +7,12 @@ PIPELINE_ROOT = getattr(settings, 'PIPELINE_ROOT', settings.STATIC_ROOT)
PIPELINE_URL = getattr(settings, 'PIPELINE_URL', settings.STATIC_URL)
PIPELINE_STORAGE = getattr(settings, 'PIPELINE_STORAGE',
'pipeline.storage.PipelineFinderStorage')
'pipeline.storage.PipelineFinderStorage')
PIPELINE_CSS_COMPRESSOR = getattr(settings, 'PIPELINE_CSS_COMPRESSOR',
'pipeline.compressors.yui.YUICompressor'
)
'pipeline.compressors.yui.YUICompressor')
PIPELINE_JS_COMPRESSOR = getattr(settings, 'PIPELINE_JS_COMPRESSOR',
'pipeline.compressors.yui.YUICompressor'
)
'pipeline.compressors.yui.YUICompressor')
PIPELINE_COMPILERS = getattr(settings, 'PIPELINE_COMPILERS', [])
PIPELINE_CSS = getattr(settings, 'PIPELINE_CSS', {})
......
from __future__ import unicode_literals
from django.utils import six
from django.contrib.staticfiles.storage import staticfiles_storage
from django.conf import settings
......@@ -16,7 +15,7 @@ class Jinja2Compressed(object):
raise PackageNotFound("Package type must be css or js, supplied %s" % package_type)
self.package_type = package_type
self.loader = FileSystemLoader((app_directories.app_template_dirs +
settings.TEMPLATE_DIRS))
settings.TEMPLATE_DIRS))
def get_package(self, name):
"""Get the js or css package."""
......@@ -93,7 +92,7 @@ class Jinja2Compressed(object):
def render_inline_js(self, package, js):
template_name = (self.package.template_name or
"pipeline/inline_js.jinja")
"pipeline/inline_js.jinja")
context = self.package.extra_context
context.update({
'source': js
......
......@@ -30,12 +30,12 @@ class Package(object):
@property
def paths(self):
return [path for path in self.sources
if not path.endswith(settings.PIPELINE_TEMPLATE_EXT)]
if not path.endswith(settings.PIPELINE_TEMPLATE_EXT)]
@property
def templates(self):
return [path for path in self.sources
if path.endswith(settings.PIPELINE_TEMPLATE_EXT)]
if path.endswith(settings.PIPELINE_TEMPLATE_EXT)]
@property
def output_filename(self):
......@@ -88,8 +88,8 @@ class Packager(object):
def pack_stylesheets(self, package, **kwargs):
return self.pack(package, self.compressor.compress_css, css_compressed,
output_filename=package.output_filename,
variant=package.variant, **kwargs)
output_filename=package.output_filename,
variant=package.variant, **kwargs)
def compile(self, paths, force=False):
return self.compiler.compile(paths, force=force)
......
......@@ -3,7 +3,7 @@ from __future__ import unicode_literals
import os
from django.contrib.staticfiles import finders
from django.contrib.staticfiles.storage import CachedFilesMixin, StaticFilesStorage # noqa
from django.contrib.staticfiles.storage import CachedFilesMixin, StaticFilesStorage
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import get_storage_class
......
from __future__ import unicode_literals
from django.contrib.staticfiles.storage import staticfiles_storage # noqa
from django.contrib.staticfiles.storage import staticfiles_storage
from django import template
from django.template.loader import render_to_string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment