AttocubeScan.walk_groups

AttocubeScan.walk_groups(walker, **kargs)

Walk through a hierarchy of groups and calls walker for each file.

Parameters:

walker (callable) – A callable object that takes either a metadataObject instance or a objectFolder instance.

Keyword Arguments:
  • group (bool) – (default False) determines whether the walker function will expect to be given the objectFolder representing the lowest level group or individual metadataObject objects from the lowest level group

  • replace_terminal (bool) – If group is True and the walker function returns an instance of metadataObject then the return value is appended to the files and the group is removed from the current objectFolder. This will unwind the group hierarchy by one level.

  • obly_terminal (bool) – Only execute the walker function on groups that have no sub-groups inside them (i.e. are terminal groups)

  • walker_args (dict) – A dictionary of static arguments for the walker function.

Notes

The walker function should have a prototype of the form:

walker(f,list_of_group_names,**walker_args)

where f is either a objectFolder or metadataObject.