orb.logic.thread_manager module

class orb.logic.thread_manager.ThreadManager(*args)

Bases: EventDispatcher

The ThreadManager is used to register Threads, and regularly check on whether they’re still running.

Use this class if you want your threads to be visible, and manageable from within the UI. Make sure to use the stoppable thread pattern.

:py:module:`MyModule.constants`

add_thread(thread)
check_alive(*args)
stop_threads()
threads

ListProperty(defaultvalue=0, **kw) Property that represents a list.

Parameters:
defaultvalue: list, defaults to []

Specifies the default value of the property.

Warning

When assigning a list to a ListProperty, the list stored in the property is a shallow copy of the list and not the original list. This can be demonstrated with the following example:

>>> class MyWidget(Widget):
>>>     my_list = ListProperty([])

>>> widget = MyWidget()
>>> my_list = [1, 5, {'hi': 'hello'}]
>>> widget.my_list = my_list
>>> print(my_list is widget.my_list)
False
>>> my_list.append(10)
>>> print(my_list, widget.my_list)
[1, 5, {'hi': 'hello'}, 10] [1, 5, {'hi': 'hello'}]

However, changes to nested levels will affect the property as well, since the property uses a shallow copy of my_list.

>>> my_list[2]['hi'] = 'bye'
>>> print(my_list, widget.my_list)
[1, 5, {'hi': 'bye'}, 10] [1, 5, {'hi': 'bye'}]