class documentation
class MimetypeBasedCompressionStrategy(BaseCompressionStrategy):
Constructor: MimetypeBasedCompressionStrategy(zim, cs_class, cs_kwargs)
A compression strategy utilizing mimetypes.
| Method | __init__ |
The default constructor. |
| Method | add |
Handle the addition of an item (e.g. create entries, ...). |
| Method | flush |
Flush all current items. |
| Method | has |
True if this compression strategy still has items to be written. |
| Instance Variable | cs |
compression strategy to use for each mimetype |
| Instance Variable | cs |
kwargs to pass to each new instance of cs_class (ignoring "zim") |
| Instance Variable | mimetype2cs |
a dict mapping mimetype -> compression strategy |
| Method | _get |
Get the compression strategy for the specified mimetype. |
| Instance Variable | _lock |
thread safety lock |
Inherited from BaseCompressionStrategy:
| Instance Variable | zim |
zim archive this compression strategy compresses for |
The default constructor.
| Parameters | |
zim:pyzim.archive.Zim | zim archive this compression strategy compresses for |
csBaseCompressionStrategy | compression strategy to use for each mimetype |
csdict | kwargs to pass to each new instance of cs_class |
True if this compression strategy still has items to be written.
| Returns | |
bool | whether there are some items that still need to be written |
Get the compression strategy for the specified mimetype.
| Parameters | |
mimetype:str | mimetype to get compression strategy for |
| Returns | |
BaseCompressionStrategy | the compression strategy to use |