awsc.commander.Commander
- class awsc.commander.Commander(*args, session, color, symbol_color, autocomplete_color, ok_color, error_color, **kwargs)
The Commander is the command bar for switching between controls. It allows navigation between AWS resources by typing commands defined by the command_palette attribute of ResourceListers into the command bar.
- Attributes:
- sessionawsc.session.Session
The session manager object.
- colorawsc.termui.color.Color
The color of the control’s text and borders.
- symbol_colorawsc.termui.color.Color
The color of the symbol for the filter bar.
- autocomplete_colorawsc.termui.color.Color
The color of the autocompletion text in the bar.
- ok_colorawsc.termui.color.Color
The color of the text in the bar when it fully matches a valid command.
- autocomplete_colorawsc.termui.color.Color
The color of the text in the bar when it does not match a valid command and does not autocomplete to a valid command.
- pausedbool
Whether the bar is inactive. The inactive bar still applies its filter, but pressing keys does not type into it.
- accepted_inputstr
The list of accepted input keys. Defaults to accepted textfield inputs.
- textstr
The current filter.
- optionsdict(str, callable() -> list(awsc.termui.control.Control))
A mapping of valid options to their respective callbacks.
Methods
accept_and_close
()Hotkey callback for pressing ENTER.
accept_autocomplete
()Called when the user accepts the autocompletion, by pressing TAB.
add_block
(block)Adds a new child block to this block.
autocomplete
()Autocompletion 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.
close
()Closes the commander and removes it from view.
input
(key)Input handler hook function.
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.
topleft
()Returns the coordinates of the top left corner of the block.
on_become_frame
- __init__(*args, session, color, symbol_color, autocomplete_color, ok_color, error_color, **kwargs)
Initializes a Control object.
- Parameters:
- borderawsc.termui.control.Border
The border of the control.
Methods
__init__
(*args, session, color, ...)Initializes a Control object.
accept_and_close
()Hotkey callback for pressing ENTER.
accept_autocomplete
()Called when the user accepts the autocompletion, by pressing TAB.
add_block
(block)Adds a new child block to this block.
autocomplete
()Autocompletion 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.
close
()Closes the commander and removes it from view.
input
(key)Input handler hook function.
on_become_frame
()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.
topleft
()Returns the coordinates of the top left corner of the block.
Attributes
border
Returns the border of the control.
corners
Read-only property for calculating the four corners of the block.
height
Read-only property for the height of the block.
inner
Read-only property for calculating the four inner corners of the block.
w_in
Read-only property for the inner width of the block.
width
Read-only property for the width of the block.