cement.core.output

Cement core output module.

class cement.core.output.OutputHandler(**kw)[source]

Bases: OutputInterface, Handler

Output handler implementation.

class cement.core.output.OutputInterface(**kw)[source]

Bases: Interface

This class defines the Output Interface. Handlers that implement this interface must provide the methods and attributes defined below. In general, most implementations should sub-class from the provided OutputHandler base class as a starting point.

class Meta[source]

Bases: object

Handler meta-data.

interface = 'output'

The string identifier of the interface

abstract render(data, *args, **kwargs)[source]

Render the data dict into output in some fashion. This function must accept both *args and **kwargs to allow an application to mix output handlers that support different features.

Parameters:

data (dict) – The dictionary whose data we need to render into output.

Returns:

The rendered output string, or None if no output is rendered

Return type:

str, None