Create a Loader class. This factory function creates a loader given a search string path. :type search_string_path: str :param search_string_path: The AWS_DATA_PATH value. A string of data path values separated by the ``os.path.pathsep`` value, which is typically ``:``
(search_path_string=None)
| 179 | |
| 180 | |
| 181 | def create_loader(search_path_string=None): |
| 182 | """Create a Loader class. |
| 183 | |
| 184 | This factory function creates a loader given a search string path. |
| 185 | |
| 186 | :type search_string_path: str |
| 187 | :param search_string_path: The AWS_DATA_PATH value. A string |
| 188 | of data path values separated by the ``os.path.pathsep`` value, |
| 189 | which is typically ``:`` on POSIX platforms and ``;`` on |
| 190 | windows. |
| 191 | |
| 192 | :return: A ``Loader`` instance. |
| 193 | |
| 194 | """ |
| 195 | if search_path_string is None: |
| 196 | return Loader() |
| 197 | paths = [] |
| 198 | extra_paths = search_path_string.split(os.pathsep) |
| 199 | for path in extra_paths: |
| 200 | path = os.path.expanduser(os.path.expandvars(path)) |
| 201 | paths.append(path) |
| 202 | return Loader(extra_search_paths=paths) |
| 203 | |
| 204 | |
| 205 | class Loader: |