Commit 494787d1 authored by Cyril Roelandt's avatar Cyril Roelandt

Expose upt.licenses.get_license_by_spdx_identifier.

parent 94423e70
......@@ -6,6 +6,7 @@ Based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- licenses: Add new licenses
- upt.licenses: Expose get_license_by_spdx_identifier
## [0.8] - 2019-06-15
### Changed
......
......@@ -699,7 +699,7 @@ class ZlibLibpngLicense(DFSGCompatibleLicense,
spdx_identifier = 'zlib-acknowledgement'
def _get_license_by_spdx_identifier(spdx_id):
def get_license_by_spdx_identifier(spdx_id):
"""Return a License object corresponding to the given spdx id."""
# Keys are spdx identifiers.
# Values are License classes.
......@@ -739,4 +739,4 @@ def guess_from_file(license_file, min_confidence=95):
return UnknownLicense()
if match.confidence < min_confidence:
return UnknownLicense()
return _get_license_by_spdx_identifier(match.license.id)
return get_license_by_spdx_identifier(match.license.id)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment