Skip to content

Commit 27bac99

Browse files
Merge branch 'develop' into add-ignored-resources
2 parents 65e1bda + 19e4b32 commit 27bac99

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
==============================
22
Changelog
33

4-
Next
5-
Release 8.0.1
4+
2023-xx-xx
5+
Release x.x.x
66

7-
* Adopt 3.3.1 specification
8-
* Introduce ``ignored_resources`` to ABOUT specification
7+
* The tool will now show which worksheet (if .xlsx input) is the tool working on
8+
* Error handling if defined worksheet does not exist
9+
* Adopt 3.3.1 specification: introduce ``ignored_resources``
910

1011

1112
2023-03-09

src/attributecode/util.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,10 +680,16 @@ def load_excel(location, worksheet=None):
680680
# This is to prevent showing the: warn("Workbook contains no default style, apply openpyxl's default")
681681
with warnings.catch_warnings(record=True):
682682
input_bom = openpyxl.load_workbook(location)
683+
sheetnames = input_bom.sheetnames
683684
if worksheet:
685+
if worksheet not in sheetnames:
686+
import sys
687+
print("The input worksheet name does not exist. Exiting.")
688+
sys.exit(1)
684689
sheet_obj = input_bom[worksheet]
685690
else:
686691
sheet_obj = input_bom.active
692+
print("Working on the " + sheet_obj.title + " worksheet.")
687693
max_col = sheet_obj.max_column
688694

689695
index = 1

templates/license_ref.template

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ This document lists the open source and third-party components of a {{ vartext['
3434
<div id="group_{{ loop.index0 }}">
3535
<h3>{{ license.name }}</h3>
3636
<p>This product contains the following open source software packages licensed under the terms of the license: {{license.name}}</p>
37-
37+
3838
<div class="oss-component" id="component_{{ loop.index0 }}">
39-
{%for about_object in abouts %}
39+
{%for about_object in abouts %}
4040
{% if loop.first %}
4141
{% if license.url %}
4242
<p>License Gallery URL: <a href="{{ license.url }}">{{license.url}}</a> </p>
4343
{% endif %}
4444
{% endif %}
4545
{% if license.key in about_object.license_key.value %}
46-
<li>{{ about_object.name.value }}{% if about_object.version.value %} - Version {{ about_object.version.value }}{% endif %}</li>
46+
<li>{{ about_object.name.value }}{% if about_object.version.value %} - Version {{ about_object.version.value }}{% endif %}</li>
4747
{% if about_object.copyright.value %}
4848
<pre>Copyright: {{about_object.copyright.value}}</pre>
4949
{% endif %}
@@ -63,7 +63,7 @@ This document lists the open source and third-party components of a {{ vartext['
6363
</div>
6464
{% endfor %}
6565
<hr>
66-
<hr>
66+
<hr>
6767
<h3><a id="End">End</a></h3>
6868
</body>
6969
</html>

0 commit comments

Comments
 (0)