Module s.r.b.utils

Part of stoqlib.reporting.base

Useful functions related to reports building and visualization.
Function build_report Given a class (BaseReportTemplate instance), build a report. It is
Function print_file Given a filename try to print it. If no printer is specified, print
Function print_preview Try preview the filename using one of the PDF viewers registred in
def build_report(report_class, *args, **kwargs):
Given a class (BaseReportTemplate instance), build a report. It is important to note that this function create a temporary file where the report will be drawed to -- the name of the temporary file is returned.
Parametersreport_classThe report class to be build.
(type: A BaseReportTemplate instance

If specified, extra parameters will be send to the report class constructor.

)
def print_file(filename, printer=None, extra_opts=):
Given a filename try to print it. If no printer is specified, print the file on the default one.
ParametersfilenameThe filename to print.
(type: str )
printerThe printer name where to print.
(type: str )
extra_optsExtra options to be passed to the printing command.
(type: list of strings )
def print_preview(filename, keep_file=False):
Try preview the filename using one of the PDF viewers registred in the package.
Parameterskeep_fileIf the file don't must be deleted after the program finish.
(type: bool )
API Documentation for Stoqlib, generated by pydoctor at 2009-07-14 16:00:32.