MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / lookup_path

Function lookup_path

keepercommander/subfolder.py:112–128  ·  view source on GitHub ↗

Lookup path of components within the folder cache. Get all the folders starting from the left end of component, plus the index of the first component that isn't present in the folder cache.

(params, folder, components)

Source from the content-addressed store, hash-verified

110
111
112def lookup_path(params, folder, components):
113 # type: (KeeperParams, BaseFolderNode, List[Optional[str]]) -> Tuple[int, List[Optional[BaseFolderNode]]]
114 """
115 Lookup path of components within the folder cache.
116
117 Get all the folders starting from the left end of component, plus the index of the first component that isn't
118 present in the folder cache.
119 """
120 remainder = 0
121 folders = [folder]
122 for index, component in enumerate(components):
123 child_folders = contained_folders(params, folders, component)
124 if not child_folders:
125 break
126 folders = child_folders
127 remainder = index + 1
128 return remainder, folders
129
130
131def is_abs_path(path_string):

Callers 1

try_resolve_pathFunction · 0.85

Calls 1

contained_foldersFunction · 0.85

Tested by

no test coverage detected