| Conditions | 2 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 14 |
| Ratio | 100 % |
| Tests | 1 |
| CRAP Score | 4.3145 |
| Changes | 0 | ||
| 1 | 1 | from typing import Any |
|
| 15 | 1 | def generate(self, node: IconNode, file: Any) -> None: |
|
| 16 | """ |
||
| 17 | Generates the HTML code for an icon node. |
||
| 18 | |||
| 19 | :param IconNode node: The icon node. |
||
| 20 | :param any file: The output file. |
||
| 21 | """ |
||
| 22 | attributes = IconNode.get_definition(node.argument) |
||
| 23 | |||
| 24 | if attributes: |
||
| 25 | img_element = Html.generate_void_element('img', attributes) |
||
| 26 | file.write(img_element) |
||
| 27 | else: |
||
| 28 | NodeStore.error("There is no definition for icon with name '{}'".format(node.argument), node) |
||
| 29 | |||
| 33 |