Function
get_nodes
(node_list, name, parents)
Source from the content-addressed store, hash-verified
| 558 | """ |
| 559 | |
| 560 | def get_nodes(node_list, name, parents): |
| 561 | if parents: |
| 562 | nodes = [] |
| 563 | for parent in parents: |
| 564 | nodes.extend( |
| 565 | [ |
| 566 | p |
| 567 | for p in node_list |
| 568 | if p["path"].is_relative_to(parent["path"]) |
| 569 | and len(p["path"].relative_to(parent["path"]).parents) == 1 |
| 570 | and re.fullmatch(name, p["name"]) |
| 571 | and p not in nodes |
| 572 | ] |
| 573 | ) |
| 574 | else: |
| 575 | nodes = [p for p in node_list if re.fullmatch(name, p["name"])] |
| 576 | |
| 577 | return nodes |
| 578 | |
| 579 | parents = None |
| 580 | for name in name_path: |
Tested by
no test coverage detected