tools.printers package
Submodules
tools.printers.basicPrinter module
- class tools.printers.basicPrinter.BasicPrinter(output, filename, outputFormat='current')[source]
Bases:
object
Super class to handle the basic printing methods
- Variables
typeofexpectedvalues (str) – what type of expected values to print, apriori or posteriori
- addObj(obj)[source]
Adds object to the Printer.
- Parameters
obj – A object to be printed. Must match one of the types defined in formatObj
- Returns
True if the object has been added to the output. If the object does not belong to the pre-defined printing list toPrint, returns False.
- property filename
- flush()[source]
Format the objects added to the output, print them to the screen or file and remove them from the printer.
tools.printers.masterPrinter module
- class tools.printers.masterPrinter.MPrinter[source]
Bases:
object
Master Printer class to handle the Printers (one printer/output type)
- addObj(obj)[source]
Adds the object to all its Printers:
- Parameters
obj – An object which can be handled by the Printers.
- flush()[source]
Ask all printers to write the output and clear their cache. If the printers return anything other than None, we pass it on.
- setOutPutFiles(filename, silent=False)[source]
Set the basename for the output files. Each printer will use this file name appended of the respective extension (i.e. .py for a python printer, .smodels for a summary printer,…)
- Parameters
filename – Input file name
silent – dont comment removing old files
tools.printers.pythonPrinter module
- class tools.printers.pythonPrinter.PyPrinter(output='stdout', filename=None, outputFormat='current')[source]
Bases:
BasicPrinter
Printer class to handle the printing of one single pythonic output
- Variables
typeofexpectedvalues (str) – what type of expected values to print, apriori or posteriori
tools.printers.slhaPrinter module
- class tools.printers.slhaPrinter.SLHAPrinter(output='file', filename=None, outputFormat='current')[source]
Bases:
TxTPrinter
Printer class to handle the printing of slha format summary output. It uses the facilities of the TxTPrinter.
- Variables
typeofexpectedvalues (str) – what type of expected values to print, apriori or posteriori
- setOutPutFile(filename, overwrite=True, silent=False)[source]
Set the basename for the text printer. The output filename will be filename.smodels. :param filename: Base filename :param overwrite: If True and the file already exists, it will be removed. :param silent: dont comment removing old files
tools.printers.summaryPrinter module
- class tools.printers.summaryPrinter.SummaryPrinter(output='stdout', filename=None, outputFormat='current')[source]
Bases:
TxTPrinter
Printer class to handle the printing of one single summary output. It uses the facilities of the TxTPrinter.
- Variables
typeofexpectedvalues (str) – what type of expected values to print, apriori or posteriori
- setOutPutFile(filename, overwrite=True, silent=False)[source]
Set the basename for the text printer. The output filename will be filename.smodels. :param filename: Base filename :param overwrite: If True and the file already exists, it will be removed. :param silent: dont comment removing old files
tools.printers.txtPrinter module
tools.printers.xmlPrinter module
- class tools.printers.xmlPrinter.XmlPrinter(output='stdout', filename=None, outputFormat='current')[source]
Bases:
PyPrinter
Printer class to handle the printing of one single XML output
- Variables
typeofexpectedvalues (str) – what type of expected values to print, apriori or posteriori
- convertToElement(pyObj, parent, tag='')[source]
Convert a python object (list,dict,string,…) to a nested XML element tree. :param pyObj: python object (list,dict,string…) :param parent: XML Element parent :param tag: tag for the daughter element