Return a directory path convenient for storing user-local, package-local and version-specific cache data.
(create: bool = False)
| 280 | |
| 281 | |
| 282 | def get_cache_dir(create: bool = False) -> str: |
| 283 | """Return a directory path convenient for storing user-local, |
| 284 | package-local and version-specific cache data. |
| 285 | """ |
| 286 | path = homebase.user_cache_dir( |
| 287 | app_name=__packagename__, app_author=CONF_AUTHOR, |
| 288 | version=__version__, use_virtualenv=False, create=False) |
| 289 | |
| 290 | # avoid possible race condition on create (https://github.com/dwavesystems/homebase/issues/37) |
| 291 | if create: |
| 292 | os.makedirs(path, exist_ok=True) |
| 293 | |
| 294 | return path |
| 295 | |
| 296 | |
| 297 | def load_config_from_files(filenames=None): |
no outgoing calls