awsc.base_control.SingleRelationLister

class awsc.base_control.SingleRelationLister(parent, alignment, dimensions, *args, selection, **kwargs)

SingleRelationLister parses and lists resources from a single resource’s description - such as an EC2 instance. It can be used to display a list of resources related to a single resource.

resource_typestr

The human-readable name of the resource type.

main_providerstr

The provider the describe_method uses in boto3.

categorystr

A human-readable name of the category of AWS resources this lister belongs to, for logging purposes.

subcategorystr

A human-readable name of the subcategory of AWS resources this lister belongs to, for logging purposes.

describe_methodstr

The method to call to retrieve the single relational resource.

describe_kwargsTemplateDict

The kwargs to pass to the describe method. This is essentially never expected to not depend on an input, so we define it as a TemplateDict. At the end of the day, whatever this is is expected to have a resolve() method that takes one positional and two keyword arguments and returns a dict. Selection argument received by the __init__ method is passed as the selection, as well as all kwargs received as the kwargs.

object_pathstr

The path where the resource being related is found.

resource_descriptorslist

A list of resource specifications. Each resource specification is a dict with the following fields: - base_path: The jq path for where the primary keys of this related resource can be found within the resource description.

The jq expression for base_path must always yield a list of strings.

  • type: The human readable name of the resource type.

  • describer (optional): A callable, usually a ResourceRef or opener function, for the describer of the resource type. Describe actions will not be allowed on resources that don’t have a describer entry.

parent_selectionawsc.termui.list_control.ListEntry

The selection from whatever is opening this. Any dict-like object will do, ListEntry is preferred due to its getattr override.

Attributes:
border

Returns the border of the control.

corners

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

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.

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.

w_in

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

width

Read-only property for the width of the block.

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.

async_inner(*args, fn[, clear])

Inner section of asynch.

asynch(fn, *args[, clear])

Async wrapper.

auto_refresh()

Automatic refresh function stub for implementation in subclasses.

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(_)

Describer callback for SingleRelationListers.

empty(_)

Callback used to generate an empty string.

end(*args)

Hotkey callback for KEY_END.

get_data(*args, **kwargs)

Data retriever callback for SingleRelationListers.

get_data_generic(resource_key, list_method, ...)

Generic data retrieval function designed to interact with the AWS API.

handle_finalization_critical()

Finalization hook.

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.

matches(list_entry, *args)

For pre-filtering resource listers, this function decides whether a list entry being generated matches the criteria for being displayed on the control.

on_close()

Cleanup hook.

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.

refresh_data(*args, **kwargs)

Refresher.

remove_block(block)

Removes a specific block from this block.

reparent()

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

sort()

Sorts the list of entries.

title_info()

Title info functions are used to determine the title info after a lister has been instantiated.

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__(parent, alignment, dimensions, *args, selection, **kwargs)

Initializes a ListControl object.

Methods

__init__(parent, alignment, dimensions, ...)

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.

async_inner(*args, fn[, clear])

Inner section of asynch.

asynch(fn, *args[, clear])

Async wrapper.

auto_refresh()

Automatic refresh function stub for implementation in subclasses.

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(_)

Describer callback for SingleRelationListers.

empty(_)

Callback used to generate an empty string.

end(*args)

Hotkey callback for KEY_END.

get_data(*args, **kwargs)

Data retriever callback for SingleRelationListers.

get_data_generic(resource_key, list_method, ...)

Generic data retrieval function designed to interact with the AWS API.

handle_finalization_critical()

Finalization hook.

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.

matches(list_entry, *args)

For pre-filtering resource listers, this function decides whether a list entry being generated matches the criteria for being displayed on the control.

on_become_frame()

on_close()

Cleanup hook.

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.

refresh_data(*args, **kwargs)

Refresher.

remove_block(block)

Removes a specific block from this block.

reparent()

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

sort()

Sorts the list of entries.

title_info()

Title info functions are used to determine the title info after a lister has been instantiated.

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.

category

corners

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

describe_kwargs

describe_method

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.

main_provider

object_path

prefix

resource_descriptors

resource_type

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.

subcategory

title

w_in

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

width

Read-only property for the width of the block.