Home | Trees | Indices | Help |
|
---|
|
object --+ | Spell
|
|||
|
|||
bool |
|
||
bool |
|
||
bool |
|
||
bool |
|
||
|
|||
bool |
|
||
bool |
|
||
|
|||
|
|||
Inherited from |
|
|||
bool |
|
||
|
|||
|
|
|||
data = None The pyffi.object_models.FileFormat.Data instance this spell acts on. |
|||
stream = None The current file being processed. |
|||
toaster = None The Toaster instance this spell is called from. |
|||
changed = False Whether the spell changed the data. |
|||
READONLY = True A bool which determines whether the spell is read only or not. |
|||
SPELLNAME = None A str describing how to refer to the spell from the command line. |
|
|||
Inherited from |
|
|
|
|
|
|
Helper function which calls _branchinspect and branchinspect on the branch, if both successful then branchentry on the branch, and if this is succesful it calls recurse on the branch's children, and once all children are done, it calls branchexit. Note that _branchinspect and branchinspect are not called upon first entry of this function, that is, when called with data as branch argument. Use datainspect to stop recursion into this branch. Do not override this function.
|
Called before all blocks are recursed. The default implementation simply returns True. You can access the data via data, and unlike in the datainspect method, the full file has been processed at this stage. Typically, you will override this function to perform a global operation on the file data.
|
Cast the spell on the given branch. First called with branch equal to data's children, then the grandchildren, and so on. The default implementation simply returns True. Typically, you will override this function to perform an operation on a particular block type and/or to stop recursion at particular block types.
|
Cast a spell on the given branch, after all its children, grandchildren, have been processed, if branchentry returned True on the given branch. Typically, you will override this function to perform a particular operation on a block type, but you rely on the fact that the children must have been processed first.
|
Called after all blocks have been processed, if dataentry returned True. Typically, you will override this function to perform a final spell operation, such as writing back the file in a special way, or making a summary log. |
Called just before the toaster starts processing all files. If it returns False, then the spell is not used. The default implementation simply returns True. For example, if the spell only acts on a particular block type, but that block type is excluded, then you can use this function to flag that this spell can be skipped. You can also use this function to initialize statistics data to be aggregated from files, to initialize a log file, and so.
|
|
|
|
changedWhether the spell changed the data. If True, the file will be written back, otherwise not.
|
READONLYA bool which determines whether the spell is read only or not. Default value is True. Override this class attribute, and set to False, when subclassing a spell that must write files back to the disk.
|
SPELLNAMEA str describing how to refer to the spell from the command line. Override this class attribute when subclassing.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 10 19:03:59 2011 | http://epydoc.sourceforge.net |