hyperspyui.bindinglist module

Created on Mon Oct 27 23:17:25 2014

@author: Vidar Tonaas Fauske

class hyperspyui.bindinglist.BindingList(target=None, *args, **kwargs)

Bases: list

A list that has been extended to sync other lists or collections to changes in its contents. By custom targets, it can also be used to trigger events on addition/removal. Only append and remove actions are required, as extend, insert and pop can be inferred (insert loses order however), but for reasons of speed, it is recommended to supply all if they are available. Supported targets for add_target are types ‘list’ and ‘QListWidget’.

add_custom(target, append, insert, extend, remove, pop)
add_target(target)
append(object)

Append object to the end of the list.

extend(iterable)

Extend list by appending elements from the iterable.

insert(index, object)

Insert object before index.

pop(index=-1)

Remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

remove(value)

Remove first occurrence of value.

Raises ValueError if the value is not present.

remove_target(target)
set_target(target)