Skip to content

Commit

Permalink
Exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianGode committed Dec 9, 2024
1 parent 7013059 commit ed2d862
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions otc_sphinx_directives/service_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,16 @@ def service_card_html(self, node):
f'<p>{node[doc["type"]]}</p>'
)
data += '</div></a>'
if doc["pdf_enabled"]:
data += (f'''
<scale-button variant="secondary" class="pdf-button-sbv" href="/{node['service_type']}-{doc["type"]}.pdf" target="_blank">
<scale-icon-user-file-pdf-file accessibility-title="pdf-file"></scale-icon-user-file-pdf-file>
<span style="font-weight: normal;">Download PDF</span>
</scale-button>
''')
try:
if doc["pdf_enabled"]:
data += (f'''
<scale-button variant="secondary" class="pdf-button-sbv" href="/{node['service_type']}-{doc["type"]}.pdf" target="_blank">
<scale-icon-user-file-pdf-file accessibility-title="pdf-file"></scale-icon-user-file-pdf-file>
<span style="font-weight: normal;">Download PDF</span>
</scale-button>
''')
except Exception as e:

Check warning on line 139 in otc_sphinx_directives/service_card.py

View check run for this annotation

otc-zuul / eco/check

otc_sphinx_directives/service_card.py#L139

pep8: F841 local variable 'e' is assigned to but never used
print("Service " + node['service_type'] + " has not defined pdf_enabled!")

Check warning on line 141 in otc_sphinx_directives/service_card.py

View check run for this annotation

otc-zuul / eco/check

otc_sphinx_directives/service_card.py#L141

pep8: W293 blank line contains whitespace
data += '</div>'

Expand Down

0 comments on commit ed2d862

Please sign in to comment.