class documentation
class Policy(object):
Constructor: Policy(compression_options, cluster_class, simple_pointer_list_class, ordered_pointer_list_class, ...)
A policy is a configuration that influences the behavior of various pyzim classes, mostly in regards to resource management.
| Method | __init__ |
The default constructor. |
| Instance Variable | autoflush |
automatically write modified clusters and entries. Requires caches to be used. NOTE: cache size should be at leat be 2 in this case! |
| Instance Variable | cluster |
class to use for caching clusters |
| Instance Variable | cluster |
keyword arguments to pass to the cluster_cache_class |
| Instance Variable | cluster |
cluster implementation to use |
| Instance Variable | compression |
options for to pass to pyzim.compression.BaseCompressionInterface |
| Instance Variable | compression |
compression strategy to use when writing new items |
| Instance Variable | compression |
kwargs of compression strategy to use (excluding "zim") |
| Instance Variable | counter |
how the counter should be loaded/initialized, see pyzim.counter.Counter.load_from_archive |
| Instance Variable | entry |
class to use for caching entries |
| Instance Variable | entry |
keyword arguments to pass to the entry_cache_class |
| Instance Variable | ordered |
ordered pointer list implementation to use |
| Instance Variable | reserve |
number of bytes after the header to reserve for the mimetypelist, None to disable. Will likely be removed in the future. |
| Instance Variable | simple |
simple pointer list implementation to use |
| Instance Variable | title |
title pointer list implementation to use |
| Instance Variable | truncate |
if nonzero, truncate when flushing the file |
| Instance Variable | uncompressed |
compression strategy to use when writing new items for the uncompressed clusters |
| Instance Variable | uncompressed |
kwargs of compression strategy to use (excluding "zim") |
def __init__(self, compression_options={}, cluster_class=None, simple_pointer_list_class=None, ordered_pointer_list_class=None, title_pointer_list_class=None, entry_cache_class=None, entry_cache_kwargs=None, cluster_cache_class=None, cluster_cache_kwargs=None, compression_strategy_class=None, compression_strategy_kwargs=None, uncompressed_compression_strategy_class=None, uncompressed_compression_strategy_kwargs=None, autoflush=True, truncate=False, reserve_mimetype_space=2048, counter='load_or_reinit'):
¶
The default constructor.
| Parameters | |
compressiondict | options for to pass to pyzim.compression.BaseCompressionInterface |
clusterpyzim.cluster.Cluster or a subclass) or None | cluster implemenetation to use |
simplepyzim.pointerlist.SimplePointerList or a subclass) or None | Undocumented |
orderedpyzim.pointerlist.OrderedPointerList or a subclass) or None | Undocumented |
titlepyzim.pointerlist.TitlePointerList or a subclass) or None | Undocumented |
entrypyzim.cache.BaseCache or None | class to use for caching entries |
entrydict or None | keyword arguments to pass to the entry_cache_class |
clusterpyzim.cache.BaseCache or None | class to use for caching clusters |
clusterdict or None | keyword arguments to pass to the cluster_cache_class |
compressionpyzim.compressionstrategy.BaseCompressionStrategy or None | compression strategy to use when writing new items |
compressiondict or None | Undocumented |
uncompressedpyzim.compressionstrategy.BaseCompressionStrategy | Undocumented |
uncompresseddict or None | Undocumented |
autoflush:bool | automatically write modified clusters and entries. Requires caches to be used. NOTE: cache size should be at leat be 2 in this case! |
truncate:bool | if nonzero, truncate when flushing the file |
reserveint or None | number of bytes after the header to reserve for the mimetypelist, None to disable. Will likely be removed in the future. |
counter:str | how the counter should be loaded/initialized, see pyzim.counter.Counter.load_from_archive |
automatically write modified clusters and entries. Requires caches to be used. NOTE: cache size should be at leat be 2 in this case!
number of bytes after the header to reserve for the mimetypelist, None to disable. Will likely be removed in the future.