apptools.logger.plugin.view.logger_view module

class apptools.logger.plugin.view.logger_view.LogRecordAdapter[source]

Bases: traitsui.tabular_adapter.TabularAdapter

A TabularEditor adapter for logging.LogRecord objects.

column_widths = [80, 100, 120, -1]
get_width(object, trait, column)[source]

Returns the width to use for a specified column.

If the value is <= 0, the column will have a default width, which is the same as specifying a width of 0.1.

If the value is > 1.0, it is converted to an integer and the result is the width of the column in pixels. This is referred to as a fixed width column.

If the value is a float such that 0.0 < value <= 1.0, it is treated as the unnormalized fraction of the available space that is to be assigned to the column. What this means requires a little explanation.

To arrive at the size in pixels of the column at any given time, the editor adds together all of the unnormalized fraction values returned for all columns in the table to arrive at a total value. Each unnormalized fraction is then divided by the total to create a normalized fraction. Each column is then assigned an amount of space in pixels equal to the maximum of 30 or its normalized fraction multiplied by the available space. The available space is defined as the actual width of the table minus the width of all fixed width columns. Note that this calculation is performed each time the table is resized in the user interface, thus allowing columns of this type to increase or decrease their width dynamically, while leaving fixed width columns unchanged.

class apptools.logger.plugin.view.logger_view.LoggerView(*args, **kwargs)[source]

Bases: pyface.workbench.traits_ui_view.TraitsUIView

The Workbench View showing the list of log items.

activated = <traits.trait_types.Instance object>
activated_text = <traits.traits.ForwardProperty object>
code_editor = <traitsui.editors.code_editor.CodeEditor object>
copy_button = <traits.trait_types.Button object>
formatted_records = <traits.traits.ForwardProperty object>
id = <traits.trait_types.Str object>
log_records = <traits.trait_types.List object>
log_records_editor = <traitsui.editors.tabular_editor.TabularEditor object>
name = <traits.trait_types.Str object>
reset_button = <traits.trait_types.Button object>
service = <traits.trait_types.Instance object>
show_button = <traits.trait_types.Button object>
trait_view = ( Group(     Item( 'log_records'           object     = 'object',           style      = 'simple',           show_label = False     ),     Group(         Item( 'reset_button'               object     = 'object',               style      = 'simple',               show_label = False         ),         Item( 'trait_modified'               object = 'object',               style  = 'simple'         ),         Item( 'show_button'               object     = 'object',               style      = 'simple',               show_label = False         ),         Item( 'copy_button'               object     = 'object',               style      = 'simple',               show_label = False         ),         orientation = 'horizontal',         show_labels = False,         object      = 'object',         style       = 'simple'     ),     show_labels = False,     object      = 'object',     style       = 'simple' ) )
update(force=False)[source]

Update ‘log_records’ if our handler has new records or ‘force’ is set.