pyffi :: spells :: nif :: modify :: SpellDelBranches :: Class SpellDelBranches
[hide private]
[frames] | no frames]

Class SpellDelBranches

source code

object --+        
         |        
     Spell --+    
             |    
      NifSpell --+
                 |
                SpellDelBranches
Known Subclasses:

Delete blocks that match the exclude list.
Instance Methods [hide private]
 
is_branch_to_be_deleted(self, branch)
Returns True for those branches that must be deleted.
source code
bool
_branchinspect(self, branch)
This spell inspects every branch, also the non-admissible ones, therefore we must override this method.
source code
bool
branchentry(self, branch)
Strip branch if it is flagged for deletion.
source code

Inherited from NifSpell: inspectblocktype

Inherited from NifSpell (private): _datainspect

Inherited from Spell: __init__, branchexit, branchinspect, dataentry, dataexit, datainspect, recurse

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from Spell: get_toast_stream, toastentry, toastexit

Class Variables [hide private]
  SPELLNAME = 'modify_delbranches'
A str describing how to refer to the spell from the command line.
  READONLY = False
A bool which determines whether the spell is read only or not.

Inherited from Spell: changed, data, stream, toaster

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

is_branch_to_be_deleted(self, branch)

source code 
Returns True for those branches that must be deleted. The default implementation returns True for branches that are not admissible as specified by include/exclude options of the toaster. Override in subclasses that must delete specific branches.

_branchinspect(self, branch)

source code 
This spell inspects every branch, also the non-admissible ones, therefore we must override this method.
Parameters:
  • branch - The branch to check.
Returns: bool
True if the branch must be processed, False otherwise.
Overrides: Spell._branchinspect

branchentry(self, branch)

source code 
Strip branch if it is flagged for deletion.
Parameters:
  • branch - The branch to cast the spell on.
Returns: bool
True if the children must be processed, False otherwise.
Overrides: Spell.branchentry