copyxnat.xnat_backend.lazy_list module

Smart list of SimpleXnat items which will auto-populate when required

class copyxnat.xnat_backend.lazy_list.LazyList(parent, wrapper_cls)[source]

Bases: object

Smart list of SimpleXnat items which will auto-populate when required

add_new(label)[source]

Adds a label to the list of recently created labels. The added label will be included in label key lists and item counts. If the metadata are requested for the new item then a refetch will be triggered when that happens

contains(label)[source]

Return True if item exists with label

count()[source]

Return number of items, including cached and newly created items

get_all_metadata()[source]

Fetch metadata for all items. If items have been create since the previous cache of metadata, a new fetch will be triggered

get_labels()[source]

Fetch labels for all items including newly created items

get_metadata(label)[source]

Return metadata for item with label, or None if it does not exist

yield_items()[source]

Lazily populate the dictionary and yield in wrapper objects