MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / is_path_in_tree

Function is_path_in_tree

tools/targets/vsc.py:113–126  ·  view source on GitHub ↗
(path, tree)

Source from the content-addressed store, hash-verified

111
112
113def is_path_in_tree(path, tree):
114 parts = path.split(os.sep)
115 current_level = tree
116 found_first_node = False
117 root_key = list(tree.keys())[0]
118
119 index_start = parts.index(root_key)
120 length = len(parts)
121 try:
122 for i in range(index_start, length):
123 current_level = current_level[parts[i]]
124 return True
125 except KeyError:
126 return False
127
128
129def generate_code_workspace_file(source_dirs,command_json_path,root_path):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected