Package spells
source code
This module is based on wz's NifTester module, although
nothing of wz's original code is left in this module.A toaster, implemented by subclasses of the abstract
Toaster class, walks over all files in a folder, and applies
one or more transformations on each file. Such transformations are
called spells, and are implemented by subclasses of the
abstract Spell class.
A spell can also run independently of a toaster and be
applied on a branch directly. The recommended way of doing this is via
the Spell.recurse method.
Supported spells
For format specific spells, refer to the corresponding module.
Some spells are applicable on every file format, and those are documented
here.
Adding new spells
To create new spells, derive your custom spells from the Spell
class, and include them in the Toaster.SPELLS attribute of your
toaster.
Grouping spells together
It is also possible to create composite spells, that is, spells that
simply execute other spells. The following functions and classes can
be used for this purpose.
Creating toaster scripts
To create a new toaster script, derive your toaster from the Toaster
class, and set the Toaster.FILEFORMAT attribute of your toaster to
the file format class of the files it can toast.
|
SpellGroupSeries(*args)
Class factory for grouping spells in series. |
source code
|
|
|
SpellGroupParallel(*args)
Class factory for grouping spells in parallel. |
source code
|
|
|
|
|
CPU_COUNT = 4
|
|
__package__ = ' pyffi.spells '
|
For multiprocessing. This function creates a new toaster, with the
given options and spells, and calls the toaster on filename.
|