MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / from_dir

Method from_dir

src/licensedcode/models.py:370–378  ·  view source on GitHub ↗

Return a new License object for a license ``key`` and load its attribute from a data file stored in ``licenses_data_dir``.

(cls, key, licenses_data_dir=licenses_data_dir, check_consistency=True, is_builtin=True)

Source from the content-addressed store, hash-verified

368
369 @classmethod
370 def from_dir(cls, key, licenses_data_dir=licenses_data_dir, check_consistency=True, is_builtin=True):
371 """
372 Return a new License object for a license ``key`` and load its attribute
373 from a data file stored in ``licenses_data_dir``.
374 """
375 lic = cls(key=key, is_builtin=is_builtin)
376 license_file = lic.license_file(licenses_data_dir=licenses_data_dir)
377 lic.load(license_file=license_file, check_consistency=check_consistency)
378 return lic
379
380 @property
381 def scancode_url(self):

Callers 1

load_licensesFunction · 0.45

Calls 2

license_fileMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected