class documentation

class DiagramGenerator(ImageGeneratorClass): (source)

View In Hierarchy

Undocumented

Method __init__ Undocumented
Method cleanup Cleanup any temporary files that were created by this generator. Including log files and image files.
Method generate_image Generate an image for a user input
Instance Variable dotfile Undocumented
Instance Variable pngfile Undocumented

Inherited from ImageGeneratorClass:

Method check_user_input Check user input before generating image
Method filter_source Filter contents of script file before displaying in textarea
Method get_default_text Provides a template or starting point for the user to begin editing.
Instance Variable notebook Undocumented
Instance Variable page Undocumented
Instance Variable plugin Undocumented
def __init__(self, plugin, notebook, page): (source)
def cleanup(self): (source)
Cleanup any temporary files that were created by this generator. Including log files and image files.
Unknown Field: implementation
should be implemented by subclasses
def generate_image(self, text): (source)

Generate an image for a user input

This is the method that does the actual work to generate an image out of input text. Typically it will write the text to a temporary file using a template and then call an external program (e.g. latex) to create an image out of that source file. The result should be an image file and optionally a log file.

When the external program failed preferably this method should still return a log file, so the user can check the details of why the creation failed.

Parameters
textthe source text as string - raw user input
Returns
a 2-tuple of the image file and the log file as File objects. If no image file was created the first element should be None, if no log file is created second element should be None.
Raises
Errorthis method is allowed to raise errors like ApplicationError when running a command failed.
Unknown Field: implementation
must be implemented by subclasses
dotfile = (source)

Undocumented

pngfile = (source)

Undocumented