awsc.base_control.OpenableListControl

class awsc.base_control.OpenableListControl(*args, selector_cb=None, **kwargs)

A ListControl which is aware of the AWSC session. Implements alternate constructor functions for use in different AWSC-specific contexts.

Attributes:
prefixstr

The class-specific prefix for the color scheme entries used by this control.

titlestr

The title of the control to display in the title bar.

describercallable

Callback to call for the default describe action of the control. Describe action will not be automatically generated if this is None. In practice, this attribute exists with the expectation that it will point to the opener function of another OpenableListControl or GenericDescriber derivative. The current selection of the OpenableListControl is passed in the selection keyword argument.

selector_cbcallable

If set, the list control is opened in selector mode. In selector mode, the ENTER hotkey is forcibly replaced with a hotkey that calls an external callback passed to the initializer in the selector_cb keyword argument. This exists so we can piggyback existing resource listers, such as those for EC2 Instance Classes as a control for selecting from a list of valid values for the value of a dialog field, such as a dialog that can be used to create a new EC2 Instance with a specified EC2 Instance Class.

hotkey_displayawsc.info.HotkeyDisplay

The hotkey display block associated with this list control. Automatically managed by this control based on its hotkeys. Each control is expected to manage its own hotkey display that is then placed in the top right corner of the screen by the session manager.

Methods

Autohotkey(key[, tooltip, is_validated, ...])

Decorator that automatically assigns a hotkey to a function upon instantiation.

add_block(block)

Adds a new child block to this block.

add_column(column[, min_size, index])

Adds a new column to the ListControl.

add_entry(entry)

Adds a new entry to the ListControl.

add_hotkey(hotkey, action[, tooltip, ...])

Adds a new hotkey to the control.

autohotkey_condition(hotkey)

Autohotkey condition callback.

before_paint()

Hook function for acting on the block before any blocks are painted for the current frame.

before_paint_critical()

Critical section for the pre-paint hook.

bottomright()

Returns the coordinates of the bottom right corner of the block.

clear_blocks([tag])

Removes all blocks with the matching tag from the child blocks of this block.

describe(_)

Describe autogenerated action hotkey callback.

end(*args)

Hotkey callback for KEY_END.

handle_finalization_critical()

Critical section for the finalization of new entries.

handle_new_entries_critical(entries)

Critical section for the new entry hook.

home(*args)

Hotkey callback for KEY_HOME.

input(key)

Input handler hook function.

list_down(*args)

Hotkey callback for KEY_DOWN.

list_up(*args)

Hotkey callback for KEY_UP.

opener(**kwargs)

Session-aware initializer for this class.

pagedown(*args)

Hotkey callback for KEY_PAGEDOWN.

pageup(*args)

Hotkey callback for KEY_PAGEUP.

paint()

Hook function for painting the block.

remove_block(block)

Removes a specific block from this block.

reparent()

Shorthand function for removing a Block from its parent and re-adding it.

select_and_close(_)

Select autogenerated action hotkey callback if control is in selector mode.

selector(callback, **kwargs)

Session-aware initializer for this class which opens it in selector mode.

sort()

Sorts the list of entries.

topleft()

Returns the coordinates of the top left corner of the block.

validate_hotkey(key)

Validates whether a hotkey can be used based on the state of the control.

on_become_frame

__init__(*args, selector_cb=None, **kwargs)

Initializes a ListControl object.

Methods

__init__(*args[, selector_cb])

Initializes a ListControl object.

add_block(block)

Adds a new child block to this block.

add_column(column[, min_size, index])

Adds a new column to the ListControl.

add_entry(entry)

Adds a new entry to the ListControl.

add_hotkey(hotkey, action[, tooltip, ...])

Adds a new hotkey to the control.

autohotkey_condition(hotkey)

Autohotkey condition callback.

before_paint()

Hook function for acting on the block before any blocks are painted for the current frame.

before_paint_critical()

Critical section for the pre-paint hook.

bottomright()

Returns the coordinates of the bottom right corner of the block.

clear_blocks([tag])

Removes all blocks with the matching tag from the child blocks of this block.

describe(_)

Describe autogenerated action hotkey callback.

end(*args)

Hotkey callback for KEY_END.

handle_finalization_critical()

Critical section for the finalization of new entries.

handle_new_entries_critical(entries)

Critical section for the new entry hook.

home(*args)

Hotkey callback for KEY_HOME.

input(key)

Input handler hook function.

list_down(*args)

Hotkey callback for KEY_DOWN.

list_up(*args)

Hotkey callback for KEY_UP.

on_become_frame()

opener(**kwargs)

Session-aware initializer for this class.

pagedown(*args)

Hotkey callback for KEY_PAGEDOWN.

pageup(*args)

Hotkey callback for KEY_PAGEUP.

paint()

Hook function for painting the block.

remove_block(block)

Removes a specific block from this block.

reparent()

Shorthand function for removing a Block from its parent and re-adding it.

select_and_close(_)

Select autogenerated action hotkey callback if control is in selector mode.

selector(callback, **kwargs)

Session-aware initializer for this class which opens it in selector mode.

sort()

Sorts the list of entries.

topleft()

Returns the coordinates of the top left corner of the block.

validate_hotkey(key)

Validates whether a hotkey can be used based on the state of the control.

Attributes

border

Returns the border of the control.

corners

Read-only property for calculating the four corners of the block.

describer

filter

Allows for filtering the list entries without removing them.

filtered

Read-only property that returns the list of filtered entris.

height

Read-only property for the height of the block.

inner

Read-only property for calculating the four inner corners of the block.

prefix

rows

Read-only property which contains the number of visible rows in the control.

selection

Read-only property which contains the currently selected list entry.

title

w_in

Read-only property for the inner width of the block.

width

Read-only property for the width of the block.