awsc.dashboard.KeyValueDashboardBlock

class awsc.dashboard.KeyValueDashboardBlock(*args, **kwargs)

Key-value display template for dashboard blocks. Blocks that do nothing fancy, just display info, should use this.

Attributes:
infodict

A mapping of fields to field values. Refreshing the data should update this.

statusint

The current status of the block, comparable with the STATUS constants. Handling the status field is the responsibility of the subclass implementing refresh_data.

labelsdict

A mapping of fields to field labels for display purposes. Only fields present in labels, order and info will be rendered.

orderlist

A list of fields. The order in which fields should be rendered.

thresholdsdict

A mapping of fields to threshold definitions. A threshold definition is a list alternating color names and numeric values. The first and the last element must always be a color. The color represents the color to print the value with if it’s less than the next numeric value in the list, but greater than the previous numeric value of the list. There is an assumed negative infinity at the beginning, and positive infinity at the end of the list.

suffixesdict

A mapping of field names to suffixes to render after the field value.

invertedlist

A list of field names where the label should be printed after the field value.

additional_lineslist(tuple)

A list of additional lines to display at the end of the block. Each entry in the list is a tuple in the format of (str, str, bool), where the first entry is the line to display, the second is the name of the color for the line, and the third is whether the line should be bold.

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_hotkey(hotkey, action[, tooltip, ...])

Adds a new hotkey to the control.

async_refresh()

Async flow for refresh_data.

auto_refresh_data([force])

Called by Dashboard to facilitate auto-refreshing.

autohotkey_condition(hotkey)

Autohotkey condition callback.

before_paint()

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

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.

input(key)

Input handler hook function.

paint()

Hook function for painting the block.

refresh_data()

Called automatically to refresh the data on the dashboard block.

register()

Classmethod to register this class and all of its subclasses with the commander control.

remove_block(block)

Removes a specific block from this block.

reparent()

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

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, **kwargs)

Initializes a HotkeyControl object.

Methods

__init__(*args, **kwargs)

Initializes a HotkeyControl object.

add_block(block)

Adds a new child block to this block.

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

Adds a new hotkey to the control.

async_refresh()

Async flow for refresh_data.

auto_refresh_data([force])

Called by Dashboard to facilitate auto-refreshing.

autohotkey_condition(hotkey)

Autohotkey condition callback.

before_paint()

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

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.

input(key)

Input handler hook function.

on_become_frame()

paint()

Hook function for painting the block.

refresh_data()

Called automatically to refresh the data on the dashboard block.

register()

Classmethod to register this class and all of its subclasses with the commander control.

remove_block(block)

Removes a specific block from this block.

reparent()

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

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

STATUS_ERROR

Status value which represents that the block data failed to load in the last refresh cycle.

STATUS_LOADING

Status value which represents that the block data is still loading.

STATUS_READY

Status value which represents that the block data succeeded to load in the last refresh cycle.

border

Returns the border of the control.

corners

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

description

height

Read-only property for the height of the block.

inner

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

inverted

labels

order

refresh_frequency

suffixes

thresholds

w_in

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

width

Read-only property for the width of the block.