Retrieve a list of packs in the provided directories. :return: Dictionary where the key is pack name and the value is full path to the pack directory. :rtype: ``dict``
(self, base_dirs)
| 52 | ] |
| 53 | |
| 54 | def get_packs(self, base_dirs): |
| 55 | """ |
| 56 | Retrieve a list of packs in the provided directories. |
| 57 | |
| 58 | :return: Dictionary where the key is pack name and the value is full path to the pack |
| 59 | directory. |
| 60 | :rtype: ``dict`` |
| 61 | """ |
| 62 | if not isinstance(base_dirs, list): |
| 63 | raise TypeError( |
| 64 | "The base dirs has a value that is not a list" |
| 65 | f" (was {type(base_dirs)})." |
| 66 | ) |
| 67 | |
| 68 | result = {} |
| 69 | for base_dir in base_dirs: |
| 70 | if not os.path.isdir(base_dir): |
| 71 | raise ValueError('Directory "%s" doesn\'t exist' % (base_dir)) |
| 72 | |
| 73 | packs_in_dir = self._get_packs_from_dir(base_dir=base_dir) |
| 74 | result.update(packs_in_dir) |
| 75 | |
| 76 | return result |
| 77 | |
| 78 | def get_content(self, base_dirs, content_type): |
| 79 | """ |
no test coverage detected