#59 Substantially simplify and prune html_util (#58)
Closed by plautrba. Opened by adamwill.
adamwill/setroubleshoot py310  into  main

Download 59.patch

This resolves #58 by removing use of formatter (which was removed in Python 3.10), and generally heavily simplifies the module, including removing html_document on the basis that it's been broken for six years so it's fairly likely nothing uses it.

As there are no unit tests it's hard to prove this is 100% equivalent, but I at least edited it into a quick test script and verified it gives a reasonable text representation of a sample block of HTML in both Python 2.7 and Python 3.10.

A further pruning could drop escape_html (replace it with cgi.escape for Python < 3.2 and html.escape for Python >= 3.2) and unescape_html (nothing uses it), at which point we could probably just move html_to_text into the single file that uses it...

https://pagure.io/setroubleshoot/c/653cc3006a58f9d3dc56c1c6ea86511b05fdf4f7?branch=main
https://pagure.io/setroubleshoot/c/717f6946e8c90cdd4d98f10ba7e443f4f075be49?branch=main
https://pagure.io/setroubleshoot/c/1707224c480ff57cb33ba8db1ea73cdcafa3cc7a?branch=main

and FTR alternative repo with split framework and plugins
https://gitlab.com/setroubleshoot/framework/-/commit/838f53a97ce44ea0f8f4d361afcb62a441f8633f
https://gitlab.com/setroubleshoot/framework/-/commit/4722407e107911d448b47a9beeb8240c4df833fa
https://gitlab.com/setroubleshoot/framework/-/commit/15c8f55d85fc5b314b8a00cd5e9432e8d2726d7a

Thank you!

https://src.fedoraproject.org/rpms/setroubleshoot/pull-request/28

Pull-Request has been closed by plautrba

Metadata