Example Project API Reference

Api Layer

class todo_example.api.TodoApp(collections=NOTHING)[source]

A Basic Todo List Storage

create_item(name)

create a new named <class ‘todo_example.api.TodoList’> item

get_by(name)

get element by name

class todo_example.api.TodoElement(name, completed=False)[source]

Element of a todo list

class todo_example.api.TodoList(name, items=NOTHING)[source]

a named todolist

clear_completed()[source]

removes completed elements

create_item(name)

create a new named <class ‘todo_example.api.TodoElement’> item

get_by(name)

get element by name

todo_example.api.get_by(self, name)[source]

get element by name

UX layer

class todo_example.ux.TodoElementUX(parent, controlled_element)[source]

ux controller element for a todo list element

parent

the controling TodoListUX

controlled_element

the controlled TodoElement

completed

completion state of the controlled element

class todo_example.ux.TodoListUX(ux, controlled_list)[source]

example ux for single todo lists .. attribute:: ux

reference to the root ux
controlled_list

reference of the todo list implementation

clear_completed()[source]

remove all completed elements

create_item(name)[source]

create a new todo list item

get_by(name)[source]

find a todo list element by name

class todo_example.ux.TodoUX(app)[source]

example root UX fore todo lists

create_item(name)[source]

create a new named todo list

Return type:TodoListUX
get_by(name)[source]

get a todo list ux by name

Return type:TodoListUX

RPC Layer

a hideous rpc interface used to demonstrate partial implementation

class todo_example.pseudorpc.PseudoRpc(backend)[source]

a hideous implementation

clear_completed(collection)[source]

clears the completed elements of a todo list

complete_item(collection, name)[source]

marks a todo list element as completed

has_item(collection, name)[source]

checks for the existence of a todo list element

make_collection(collection)[source]

creates a todo list

make_item(collection, name)[source]

creates a todo list element

Spec Layer

class todo_example.spec.TodoAPI(implementations, implementation_chooser=NOTHING, strict_calls=False)[source]

example description for a simple todo application

classmethod from_api(api)[source]

create an application description for the todo app, that based on the api can use either tha api or the ux for interaction

class todo_example.spec.TodoCollection(parent, name)[source]

domain object describing a todo list

class todo_example.spec.TodoItem(parent, name)[source]

describing a todo list element