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)
| 110 | |
| 111 | |
| 112 | def 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 | |
| 131 | def is_abs_path(path_string): |
no test coverage detected