Package pyffi :: Package spells :: Package nif :: Module dump :: Class SpellHtmlReport
[hide private]
[frames] | no frames]

Class SpellHtmlReport

source code

object --+        
         |        
     Spell --+    
             |    
      NifSpell --+
                 |
                SpellHtmlReport

Make a html report of selected blocks.
Instance Methods [hide private]
bool
_branchinspect(self, branch)
Check if spell should be cast on this branch or not, based on exclude and include options passed on the command line.
source code
bool
branchentry(self, branch)
Cast the spell on the given branch.
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]
bool
toastentry(cls, toaster)
Called just before the toaster starts processing all files.
source code
 
toastexit(cls, toaster)
Called when the toaster has finished processing all files.
source code
 
browser(cls, htmlstr)
Display html in the default web browser without creating a temp file.
source code

Inherited from Spell: get_toast_stream

Class Variables [hide private]
  SPELLNAME = 'dump_htmlreport'
A str describing how to refer to the spell from the command line.
  ENTITIES = {'\n': '<br/>'}

Inherited from Spell: READONLY, changed, data, stream, toaster

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

toastentry(cls, toaster)
Class Method

source code 

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.

Parameters:
  • toaster - The toaster this spell is called from.
Returns: bool
True if the spell applies, False otherwise.
Overrides: Spell.toastentry
(inherited documentation)

_branchinspect(self, branch)

source code 
Check if spell should be cast on this branch or not, based on exclude and include options passed on the command line. You should not need to override this function: if you need additional checks on whether a branch must be parsed or not, override the branchinspect method.
Parameters:
  • branch - The branch to check.
Returns: bool
True if the branch must be processed, False otherwise.
Overrides: Spell._branchinspect
(inherited documentation)

branchentry(self, branch)

source code 

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.

Parameters:
  • branch - The branch to cast the spell on.
Returns: bool
True if the children must be processed, False otherwise.
Overrides: Spell.branchentry
(inherited documentation)

toastexit(cls, toaster)
Class Method

source code 
Called when the toaster has finished processing all files.
Parameters:
  • toaster - The toaster this spell is called from.
Overrides: Spell.toastexit
(inherited documentation)

browser(cls, htmlstr)
Class Method

source code 

Display html in the default web browser without creating a temp file.

Instantiates a trivial http server and calls webbrowser.open with a URL to retrieve html from that server.