dice.client package

Submodules

dice.client.panel module

class dice.client.panel.InputPanel(screen, height, width, write_callback, cancel_callback, x=0, y=0)[source]

Bases: dice.client.panel._PanelBase

Curses panel allows get input from keyboard.

draw(active=False)[source]

Draw the list panel.

Parameters:active – If set to true, draw the panel with surrounding box.
on_keypress(key)[source]

Event handler when keypress event received by the panel.

Parameters:key – Key being pressed.
class dice.client.panel.ListPanel(screen, height, width, x=0, y=0, format_str='')[source]

Bases: dice.client.panel._PanelBase

Curses panel contains list of entries.

add_item(bundle, catalog='')[source]

Add an item the list panel.

Parameters:
  • bundle – Content of added item.
  • catalog – Catalog of added item.
clear()[source]

Clear panel content.

draw(active=False)[source]

Draw the list panel.

Parameters:active – If set to true, draw the panel with surrounding box.
on_keypress(key)[source]

Event handler when keypress event received by the panel.

Parameters:key – Key being pressed.
select(cat_key=None, item_key=None)[source]

Select specified item.

Parameters:
  • cat_key – Catalog name of the item for selection.
  • item_key – Item name of the item for selection.
set_select_callback(callback)[source]

Set callback function triggered when an list item is selected.

Parameters:callback – Select callback function.
class dice.client.panel.TextPanel(screen, height, width, x=0, y=0)[source]

Bases: dice.client.panel._PanelBase

Curses panel contains only block of text.

clear()[source]

Clear panel content.

draw(active=False)[source]

Draw the text panel.

Parameters:active – If set to true, draw the panel with surrounding box.
on_keypress(key)[source]

Event handler when keypress event received by the panel.

Parameters:key – Key being pressed.
set_content(bundle)[source]

Set panel content.

Parameters:bundle – Content to be set.

dice.client.window module

class dice.client.window.Window(app)[source]

Bases: object

Class for a whole curses window of DICE client.

destroy()[source]

Destroy the curses window.

draw()[source]

Draw all the panels in the curses window.

get_input()[source]

Show and focus to an input panel and return the content.

Returns:A string of input content.
update()[source]

Get events and update the window.

Module contents

class dice.client.DiceApp[source]

Bases: object

Curses-based DICE client application.

run()[source]

Main loop to run tests, update screen and send tests results.

run_tests()[source]

Iteratively run tests.

update_window()[source]

Update the content of curses window and refresh it.