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
c4307c99
Commit
c4307c99
authored
Feb 03, 2013
by
Timothée Peignier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rationalize exceptions
parent
9a91c63e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
15 deletions
+21
-15
pipeline/compilers/__init__.py
+1
-5
pipeline/compressors/__init__.py
+1
-5
pipeline/exceptions.py
+17
-0
pipeline/packager.py
+2
-5
No files found.
pipeline/compilers/__init__.py
View file @
c4307c99
...
...
@@ -4,11 +4,11 @@ import os
import
subprocess
from
django.contrib.staticfiles
import
finders
from
django.core.files.base
import
ContentFile
from
django.utils.encoding
import
smart_str
from
pipeline.conf
import
settings
from
pipeline.exceptions
import
CompilerError
from
pipeline.storage
import
default_storage
from
pipeline.utils
import
to_class
...
...
@@ -75,10 +75,6 @@ class CompilerBase(object):
return
content
class
CompilerError
(
Exception
):
pass
class
SubProcessCompiler
(
CompilerBase
):
def
execute_command
(
self
,
command
,
content
=
None
,
cwd
=
None
):
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
cwd
=
cwd
,
...
...
pipeline/compressors/__init__.py
View file @
c4307c99
...
...
@@ -13,6 +13,7 @@ from django.utils.encoding import smart_bytes, force_text
from
pipeline.conf
import
settings
from
pipeline.storage
import
default_storage
from
pipeline.utils
import
to_class
,
relpath
from
pipeline.exceptions
import
CompressorError
URL_DETECTOR
=
r'url\([\'"]?([^\s)]+\.[a-z]+[\?\#\d\w]*)[\'"]?\)'
URL_REPLACER
=
r'url\(__EMBED__(.+?)(\?\d+)?\)'
...
...
@@ -224,11 +225,6 @@ class CompressorBase(object):
raise
NotImplementedError
class
CompressorError
(
Exception
):
"""This exception is raised when a filter fails"""
pass
class
SubProcessCompressor
(
CompressorBase
):
def
execute_command
(
self
,
command
,
content
):
pipe
=
subprocess
.
Popen
(
command
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
...
...
pipeline/exceptions.py
0 → 100644
View file @
c4307c99
from
__future__
import
unicode_literals
class
PipelineException
(
Exception
):
pass
class
PackageNotFound
(
PipelineException
):
pass
class
CompilerError
(
PipelineException
):
pass
class
CompressorError
(
PipelineException
):
pass
pipeline/packager.py
View file @
c4307c99
...
...
@@ -4,9 +4,10 @@ from django.contrib.staticfiles.finders import find
from
django.core.files.base
import
ContentFile
from
django.utils.encoding
import
smart_str
from
pipeline.conf
import
settings
from
pipeline.compilers
import
Compiler
from
pipeline.compressors
import
Compressor
from
pipeline.conf
import
settings
from
pipeline.exceptions
import
PackageNotFound
from
pipeline.glob
import
glob
from
pipeline.signals
import
css_compressed
,
js_compressed
from
pipeline.storage
import
default_storage
...
...
@@ -121,7 +122,3 @@ class Packager(object):
for
name
in
config
:
packages
[
name
]
=
Package
(
config
[
name
])
return
packages
class
PackageNotFound
(
Exception
):
pass
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