Documentation additions. Fixes to compilation. Made true passthrough which works.
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
import os
|
||||
|
||||
from .processors import Processor
|
||||
from .processors import Processor, PassthroughException
|
||||
from ..utils import guess_mime
|
||||
from typing import Iterable, Optional, Dict, cast
|
||||
|
||||
@ -49,7 +49,7 @@ class PassThrough(Processor):
|
||||
Returns:
|
||||
iterable: The post-processed output stream
|
||||
"""
|
||||
return input_file
|
||||
raise PassthroughException("passthrough")
|
||||
|
||||
def extension(self, oldname: str, ctx: Optional[Dict] = None) -> str:
|
||||
"""Return the mimetype of the post-processed file.
|
||||
|
@ -3,6 +3,10 @@ import abc
|
||||
from typing import Iterable, Optional, Dict
|
||||
|
||||
|
||||
class PassthroughException(Exception):
|
||||
"""Raised when the processor would like the file to pass through unchanged."""
|
||||
|
||||
|
||||
class ProcessorException(Exception): # pragma: no cover
|
||||
"""A base exception class to be used by processor objects."""
|
||||
|
||||
|
Reference in New Issue
Block a user