devctrl.task.sweeps.find_hierarchy#
- find_hierarchy(task: Task) tuple[str, SettingsClass] | None[source]#
Return the hierarchy object of the task.
First, the task (and its nested settings fields) are searched for a
GroupHierarchy-typed field. If it has none, the task itself is used as the hierarchy object when it owns flat hierarchy level fields (fields named likeHIERARCHY_SEGMENTS), so sweep templates write the level fields of the task directly.- Parameters:
task – Task to inspect.
- Returns:
(dotted field path, hierarchy object), or
Noneif the task has neither aGroupHierarchy-typed field nor flat hierarchy level fields.