Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ Files: src/fosslight_util/resources/frequentLicenselist.json
Copyright: 2021 LG Electronics
License: Apache-2.0

Files: src/fosslight_util/resources/frequent_license_nick_list.json
Copyright: 2022 LG Electronics
License: Apache-2.0

Files: src/fosslight_util/resources/licenses.json
Copyright: SPDX
License: CC-BY-3.0
Expand Down
39 changes: 39 additions & 0 deletions src/fosslight_util/resources/frequent_license_nick_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"gpl-2.0": "GPL-2.0-only",
"gpl2.0": "GPL-2.0-only",
"gpl 2.0": "GPL-2.0-only",
"gpl-2.0-only": "GPL-2.0-only",
"gpl-3.0": "GPL-3.0-only",
"gpl3.0": "GPL-3.0-only",
"gpl 3.0": "GPL-3.0-only",
"gpl-3.0-only": "GPL-3.0-only",
"lgpl-2.1": "LGPL-2.1-only",
"lgpl-2.0": "LGPL-2.1-only",
"lgpl 2.0": "LGPL-2.1-only",
"lgpl 2.1": "LGPL-2.1-only",
"lgpl2.0": "LGPL-2.1-only",
"lgpl2.1": "LGPL-2.1-only",
"lgpl-2.1-only": "LGPL-2.1-only",
"apache-2.0": "Apache-2.0",
"apache2.0": "Apache-2.0",
"apache 2.0": "Apache-2.0",
"bsd-3-clause": "BSD-3-clause",
"bsd 3 clause": "BSD-3-clause",
"bsd-3 clause": "BSD-3-clause",
"bsd 3-clause": "BSD-3-clause",
"agpl 3.0": "AGPL-3.0",
"apgl-3.0": "APGL-3.0",
"apgl3.0": "APGL-3.0",
"agplv3": "AGPL-3.0",
"mit": "MIT",
"epl-1.0": "EPL-1.0",
"epl 1.0": "EPL-1.0",
"epl1.0": "EPL-1.0",
"epl-2.0": "EPL-2.0",
"epl 2.0": "EPL-2.0",
"epl2.0": "EPL-2.0",
"lge": "LicenseRef-LGE_Proprietary_License",
"lge license": "LicenseRef-LGE_Proprietary_License",
"lge proprietary": "LicenseRef-LGE_Proprietary_License",
"lge-proprietary": "LicenseRef-LGE_Proprietary_License"
}
20 changes: 20 additions & 0 deletions src/fosslight_util/spdx_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@
_resources_dir = 'resources'
_licenses_json_file = 'licenses.json'
_frequentLicenselist_file = 'frequentLicenselist.json'
_frequent_lic_nick_json_file = 'frequent_license_nick_list.json'


def get_license_from_nick():
licenses = {}
licenses_file = os.path.join(_resources_dir, _frequent_lic_nick_json_file)

try:
base_dir = sys._MEIPASS
except Exception:
base_dir = os.path.dirname(__file__)

file_withpath = os.path.join(base_dir, licenses_file)
try:
with open(file_withpath, 'r') as f:
licenses = json.load(f)
except Exception as ex:
print(f"Error to get license from json file : {ex}")

return licenses


def get_spdx_licenses_json():
Expand Down