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