Documentation additions. Fixes to compilation. Made true passthrough which works.

This commit is contained in:
2019-04-17 19:19:09 -07:00
parent 1093636728
commit 3922b13fb1
24 changed files with 181 additions and 9 deletions

View File

@ -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.

View 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."""