Skip to content

Commit ac433f5

Browse files
committed
Update variable/function name to be more precise
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent d716da2 commit ac433f5

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/attributecode/attrib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def generate(abouts, template_string=None):
4949
captured_license = []
5050
license_key_and_context = {}
5151
sorted_license_key_and_context = {}
52-
license_text_name_and_key = {}
52+
license_file_name_and_key = {}
5353
license_key_to_license_name = {}
5454
# FIXME: This need to be simplified
5555
for about in abouts:
@@ -67,7 +67,7 @@ def generate(abouts, template_string=None):
6767
license_key = license_text_name
6868
license_key_and_context[license_key] = about.license_file.value[license_text_name]
6969
sorted_license_key_and_context = collections.OrderedDict(sorted(license_key_and_context.items()))
70-
license_text_name_and_key[license_text_name] = license_key
70+
license_file_name_and_key[license_text_name] = license_key
7171

7272
# Convert/map the key in license expression to license name
7373
if about.license_expression.value and about.license_name.value:
@@ -99,7 +99,7 @@ def generate(abouts, template_string=None):
9999
about.license_name_expression = lic_name_expression
100100

101101
rendered = template.render(abouts=abouts, common_licenses=COMMON_LICENSES, license_key_and_context=sorted_license_key_and_context,
102-
license_text_name_and_key=license_text_name_and_key, license_key_to_license_name=license_key_to_license_name)
102+
license_file_name_and_key=license_file_name_and_key, license_key_to_license_name=license_key_to_license_name)
103103
except Exception as e:
104104
line = getattr(e, 'lineno', None)
105105
ln_msg = ' at line: %r' % line if line else ''

src/attributecode/templates/default_html.template

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@
5252
is available at the end of this document.</p>
5353
{% else %}
5454
{% if about_object.license_file.value %}
55-
{% for lic_text_name in about_object.license_file.value %}
56-
{% if not license_text_name_and_key[lic_text_name] in common_licenses %}
57-
<pre>{{ about_object.license_file.value[lic_text_name] | e}}</pre>
55+
{% for lic_file_name in about_object.license_file.value %}
56+
{% if not license_file_name_and_key[lic_file_name] in common_licenses %}
57+
<pre>{{ about_object.license_file.value[lic_file_name] | e}}</pre>
5858
{% endif %}
5959
{% endfor %}
6060
{% endif %}
6161
{% endif %}
6262
{% endfor %}
6363
{% else %}
6464
{% if about_object.license_file.value %}
65-
{% for lic_text_name in about_object.license_file.value %}
66-
<pre>{{ about_object.license_file.value[lic_text_name] | e}}</pre>
65+
{% for lic_file_name in about_object.license_file.value %}
66+
<pre>{{ about_object.license_file.value[lic_file_name] | e}}</pre>
6767
{% endfor %}
6868
{% endif %}
6969
{% endif %}

0 commit comments

Comments
 (0)