Retrieve a directory for the provided pack. If a directory for the provided pack doesn't exist in any of the search paths, None is returned instead. Note: If same pack exists in multiple search path, path to the first one is returned. :param pack_name: Pack name. :type pa
(pack_name)
| 184 | |
| 185 | |
| 186 | def get_pack_directory(pack_name): |
| 187 | """ |
| 188 | Retrieve a directory for the provided pack. |
| 189 | |
| 190 | If a directory for the provided pack doesn't exist in any of the search paths, None |
| 191 | is returned instead. |
| 192 | |
| 193 | Note: If same pack exists in multiple search path, path to the first one is returned. |
| 194 | |
| 195 | :param pack_name: Pack name. |
| 196 | :type pack_name: ``str`` |
| 197 | |
| 198 | :return: Pack to the pack directory. |
| 199 | :rtype: ``str`` or ``None`` |
| 200 | """ |
| 201 | packs_base_paths = get_packs_base_paths() |
| 202 | for packs_base_path in packs_base_paths: |
| 203 | pack_base_path = os.path.join(packs_base_path, quote_unix(pack_name)) |
| 204 | pack_base_path = os.path.abspath(pack_base_path) |
| 205 | |
| 206 | if os.path.isdir(pack_base_path): |
| 207 | return pack_base_path |
| 208 | |
| 209 | return None |
| 210 | |
| 211 | |
| 212 | def get_entry_point_abs_path(pack=None, entry_point=None, use_pack_cache=False): |
no test coverage detected