Total Complexity | 2 |
Total Lines | 16 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | 1 | from lxml import etree |
|
2 | |||
3 | 1 | from ..namespaces import NAMESPACES |
|
4 | |||
5 | |||
6 | 1 | class DescriptionParser(): |
|
7 | 1 | @staticmethod |
|
8 | 1 | def get_full_description(item): |
|
9 | 1 | description = item.find(".//xccdf:description", NAMESPACES) |
|
10 | 1 | if description is None: |
|
11 | 1 | return None |
|
12 | 1 | str_description = etree.tostring(description).decode() |
|
13 | 1 | start_tag_description = str_description.find(">") + 1 |
|
14 | 1 | end_tag_description = str_description.rfind("</") |
|
15 | return str_description[start_tag_description:end_tag_description].replace("html:", "") |
||
16 |