class documentation

class PathReaderMixIn(object):

Constructor: PathReaderMixIn(inpath, outpath)

View In Hierarchy

A mix-in class for ZimTranslator that implements reading from path.

If you inherit from this class in addition to the ZimTranslator class, the translator will read the ZIM file at PathReaderMixIn.inpath and write to PathReaderMixIn.outpath.

This class has its own constructor, which allows you to more easily set inpath and outpath. However, this does not call ZimTranslator.__init__, so be sure to call that translator as well!

Method __init__ The default constructor.
Method get_in_policy Return the policy to use for the input ZIM file.
Method get_out_policy Return the policy to use for the output ZIM file.
Method open_in Open the input ZIM based on the specified inpath.
Method open_out Open the input ZIM based on the specified inpath.
Class Variable allow_replacement whether overwriting existing files is allowed (default: yes)
Instance Variable inpath path to ZIM file to read from
Instance Variable outpath path to ZIM file to write to
def __init__(self, inpath, outpath):

The default constructor.

Parameters
inpath:strpath to ZIM file to read from
outpath:strpath to ZIM file to write to
def get_in_policy(self):

Return the policy to use for the input ZIM file.

By default this will be a ZIM file for reasonable performance.

Returns
pyzim.policy.Policythe policy to use for the input ZIM file.
def get_out_policy(self):

Return the policy to use for the output ZIM file.

By default this will be a ZIM file for a good compression.

Returns
pyzim.policy.Policythe policy to use for the input ZIM file.
def open_in(self):

Open the input ZIM based on the specified inpath.

Returns
pyzim.archive.Zimthe ZIM to read from
def open_out(self):

Open the input ZIM based on the specified inpath.

Returns
pyzim.archive.Zimthe ZIM to read from
allow_replacement: bool =

whether overwriting existing files is allowed (default: yes)

inpath: str =

path to ZIM file to read from

outpath: str =

path to ZIM file to write to