Added comments to Parser.py
This commit is contained in:
		| @@ -2,10 +2,20 @@ from lxml import etree | ||||
|  | ||||
|  | ||||
| def prettify(source: str) -> str: | ||||
|     """Method used to pretty format given XML | ||||
|  | ||||
|     :param source: XML | ||||
|     :return: prettified XML | ||||
|     """ | ||||
|     xml = etree.XML(source) | ||||
|     return etree.tostring(xml, pretty_print=True).decode() | ||||
|  | ||||
| def minimize(source: str) -> str: | ||||
|     """Method used to minimize XML by deleting not needed whitespaces. | ||||
|  | ||||
|     :param source: XML | ||||
|     :return: minimized XML | ||||
|     """ | ||||
|     result = source | ||||
|      | ||||
|     to_remove = ["   ", "  ", "\t", "\n"] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user