cement.ext.ext_print
¶
Cement print extension module.
-
class
cement.ext.ext_print.
PrintDictOutputHandler
(**kw)[source]¶ Bases:
cement.core.output.OutputHandler
This class implements the Output Handler interface. It is intended primarily for development where printing out a string reprisentation of the data dictionary would be useful. Please see the developer documentation on Output Handling.
-
class
Meta
[source]¶ Bases:
object
Handler meta-data
-
label
= 'print_dict'¶ The string identifier of this handler.
-
overridable
= False¶ Whether or not to include
json
as an available choice to override theoutput_handler
via command line options.
-
-
render
(data_dict, template=None, **kw)[source]¶ Take a data dictionary and render it as text output. Note that the template option is received here per the interface, however this handler just ignores it.
Parameters: data_dict (dict) – The data dictionary to render. Keyword Arguments: template – This option is completely ignored. Returns: A text string. Return type: str
-
class
-
class
cement.ext.ext_print.
PrintOutputHandler
(**kw)[source]¶ Bases:
cement.core.output.OutputHandler
This class implements the Output Handler interface. It takes a dict and only prints out the
out
key. It is primarily used by theapp.print()
extended function in order to replaceprint()
so that framework features likepre_render
andpost_render
hooks are honored. Please see the developer documentation on Output Handling.-
class
Meta
[source]¶ Bases:
object
Handler meta-data
-
label
= 'print'¶ The string identifier of this handler.
-
overridable
= False¶ Whether or not to include
json
as an available choice to override theoutput_handler
via command line options.
-
-
render
(data_dict, template=None, **kw)[source]¶ Take a data dictionary and render only the
out
key as text output. Note that the template option is received here per the interface, however this handler just ignores it.Parameters: data_dict (dict) – The data dictionary to render. Keyword Arguments: template – This option is completely ignored. Returns: A text string. Return type: str
-
class