Return, load or build and cache a LicenseCache.
(
only_builtin=False,
force=False,
index_all_languages=False,
additional_directory=None
)
| 411 | |
| 412 | |
| 413 | def populate_cache( |
| 414 | only_builtin=False, |
| 415 | force=False, |
| 416 | index_all_languages=False, |
| 417 | additional_directory=None |
| 418 | ): |
| 419 | """ |
| 420 | Return, load or build and cache a LicenseCache. |
| 421 | """ |
| 422 | global _LICENSE_CACHE |
| 423 | |
| 424 | if force or not _LICENSE_CACHE: |
| 425 | _LICENSE_CACHE = LicenseCache.load_or_build( |
| 426 | only_builtin=only_builtin, |
| 427 | licensedcode_cache_dir=licensedcode_cache_dir, |
| 428 | scancode_cache_dir=scancode_cache_dir, |
| 429 | force=force, |
| 430 | index_all_languages=index_all_languages, |
| 431 | # used for testing only |
| 432 | timeout=LICENSE_INDEX_LOCK_TIMEOUT, |
| 433 | additional_directory=additional_directory, |
| 434 | ) |
| 435 | return _LICENSE_CACHE |
| 436 | |
| 437 | |
| 438 | def load_cache_file(cache_file): |
no test coverage detected