Skip to content
Closed
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: 3 additions & 1 deletion src/attributecode/attrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from attributecode import ERROR
from attributecode import Error
from attributecode.licenses import COMMON_LICENSES
from attributecode.licenses import COMMON_SPDX_LICENSES
from attributecode.model import parse_license_expression
from attributecode.util import add_unc
from attributecode.attrib_util import multi_sort
Expand Down Expand Up @@ -79,7 +80,7 @@ def generate(abouts, template=None, variables=None):
if not license_text_name in captured_license:
captured_license.append(license_text_name)
if license_text_name.endswith('.LICENSE'):
license_key = license_text_name.strip('.LICENSE')
license_key = license_text_name.rsplit('.', 1)[0]
else:
license_key = license_text_name
license_key_and_context[license_key] = about.license_file.value[license_text_name]
Expand Down Expand Up @@ -120,6 +121,7 @@ def generate(abouts, template=None, variables=None):
utcnow = datetime.datetime.utcnow()
rendered = template.render(
abouts=abouts, common_licenses=COMMON_LICENSES,
common_spdx_licenses=COMMON_SPDX_LICENSES,
license_key_and_context=sorted_license_key_and_context,
license_file_name_and_key=license_file_name_and_key,
license_key_to_license_name=license_key_to_license_name,
Expand Down
Loading