A pixt generator is a class that exists in the generators
directory. The dynamic module loader will automatically load the
specified generator when needed for a specific filetype. In other
words, if you write a generator to read Microsoft Outlook PST
files, you simply put the generator in the generators
directory.
The simples generator example is below (using MS Outlook as an
example):
class
PstGenerator(base.Generator):
CMD = "somecommand"
def __init__(self **kwargs):
base.Generator.__init__(self,
kwargs['infile'])
def _set_args(self):
args = []
args.append(self.INFILE)
args.append('-d
someoption')
args.append('-r
someotheroption')
return args
The class must be named using the file extension,
with the first letter being capitalized, followed by the word
Generator, and must inherit from base.Generator.
Setting the CMD variable, and creating
_set_args function ensures that the parent class
will know how to run the external application that spawns the
conversion.
For more details information, please look at base.py in the
generators directory.
Next: Currently Supported
Generators
Download pixt