hexes package

Submodules

hexes.aiotextpad module

class hexes.aiotextpad.AsyncTextbox(win, box, app, insert_mode=False)[source]

Bases: curses.textpad.Textbox

Editing widget using the interior of a window object. Supports the following Emacs-like key bindings:

Ctrl-A Go to left edge of window. Ctrl-B Cursor left, wrapping to previous line if appropriate. Ctrl-D Delete character under cursor. Ctrl-E Go to right edge (stripspaces off) or end of line

(stripspaces on).

Ctrl-F Cursor right, wrapping to next line when appropriate. Ctrl-G Terminate, returning the window contents. Ctrl-H Delete character backward. Ctrl-J Terminate if the window is 1 line, otherwise insert newline. Ctrl-K If line is blank, delete it, otherwise clear to end of line. Ctrl-L Refresh screen. Ctrl-N Cursor down; move down one line. Ctrl-O Insert a blank line at cursor location. Ctrl-P Cursor up; move up one line.

Move operations do nothing if the cursor is at an edge where the movement is not possible. The following synonyms are supported where possible:

KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N KEY_BACKSPACE = Ctrl-h

static bounded(val, min_, max_)[source]
ctrl_a(ch, x, y)[source]
ctrl_d(ch, x, y)[source]
ctrl_e(ch, x, y)[source]
ctrl_f(ch, x, y)[source]
ctrl_g(ch, x, y)[source]
ctrl_j(ch, x, y)[source]
ctrl_k(ch, x, y)[source]
ctrl_l(ch, x, y)[source]
ctrl_n(ch, x, y)[source]
ctrl_o(ch, x, y)[source]
ctrl_p(ch, x, y)[source]
cursor
do_command(ch)[source]

Process a single editing command.

do_printable_char(ch, x, y)[source]
edit(validate=None, callback=None)[source]
leftward_key(ch, x, y)[source]

hexes.behaviors module

hexes.behaviors.quit(app)[source]
hexes.behaviors.render(app)[source]

hexes.hexes module

class hexes.hexes.Application(root=None)[source]

Bases: object

add_window(box)[source]
add_windows(*boxes)[source]
edit(box, callback=None)[source]
get_window_size()[source]
has_active_textbox
log(*args)[source]
on(event, func=None)[source]
process_key()[source]
recalculate_windows()[source]
register(event_id, fn)[source]
run()[source]
schedule(coro_func)[source]
class hexes.hexes.Box(title=None, style=None, text=None, editable=False, children=None)[source]

Bases: object

add_child(child)[source]
add_children(*children)[source]
ancestors
available_dimension(main)[source]
available_height
available_width
dimension(main)[source]
height
inner_height
inner_width
lower_right
older_siblings
root
scroll(amount=1)[source]
siblings
siblings_including_self
text
traverse_pre_order
upper_left
width
younger_siblings
class hexes.hexes.Style(**kwargs)[source]

Bases: object

class Height[source]

Bases: object

Auto = 'auto'
class Style.Layout[source]

Bases: object

Horizontal = 'horizontal'
Vertical = 'vertical'
class Style.Width[source]

Bases: object

Auto = 'auto'
Style.border_collapse = True
Style.flow = False
Style.height = 'auto'
Style.layout = 'vertical'
Style.min_height = 0
Style.min_width = 0
Style.width = 'auto'

hexes.utils module

class hexes.utils.Point(x, y)

Bases: tuple

x

Alias for field number 0

y

Alias for field number 1

hexes.utils.flatten(container)[source]
hexes.utils.wrap_by_paragraph(text, width=70, **kwargs)[source]

Module contents

class hexes.Application(root=None)[source]

Bases: object

add_window(box)[source]
add_windows(*boxes)[source]
edit(box, callback=None)[source]
get_window_size()[source]
has_active_textbox
log(*args)[source]
on(event, func=None)[source]
process_key()[source]
recalculate_windows()[source]
register(event_id, fn)[source]
run()[source]
schedule(coro_func)[source]
class hexes.Box(title=None, style=None, text=None, editable=False, children=None)[source]

Bases: object

add_child(child)[source]
add_children(*children)[source]
ancestors
available_dimension(main)[source]
available_height
available_width
dimension(main)[source]
height
inner_height
inner_width
lower_right
older_siblings
root
scroll(amount=1)[source]
siblings
siblings_including_self
text
traverse_pre_order
upper_left
width
younger_siblings
class hexes.Style(**kwargs)[source]

Bases: object

class Height[source]

Bases: object

Auto = 'auto'
class Style.Layout[source]

Bases: object

Horizontal = 'horizontal'
Vertical = 'vertical'
class Style.Width[source]

Bases: object

Auto = 'auto'
Style.border_collapse = True
Style.flow = False
Style.height = 'auto'
Style.layout = 'vertical'
Style.min_height = 0
Style.min_width = 0
Style.width = 'auto'