Returns a list of all names in a tree.
(t, parent_path)
| 186 | |
| 187 | |
| 188 | def _traverse_tree(t, parent_path): |
| 189 | """Returns a list of all names in a tree.""" |
| 190 | assert not parent_path or parent_path[-1] == "/" |
| 191 | full_node_name = parent_path + t.name |
| 192 | if t.is_file(): |
| 193 | result = [full_node_name] |
| 194 | else: |
| 195 | name_prefix = full_node_name + "/" |
| 196 | result = [name_prefix] |
| 197 | for i in t.children: |
| 198 | result.extend(_traverse_tree(i, name_prefix)) |
| 199 | return result |
| 200 | |
| 201 | |
| 202 | def _get_text(path): |
no test coverage detected