refactoring

This commit is contained in:
frankknoll
2022-11-22 12:40:26 +01:00
parent 134a133da1
commit e87fe0c8ba
21 changed files with 692 additions and 731 deletions

View File

@@ -0,0 +1,15 @@
from bs4 import BeautifulSoup
class HtmlTransformerUtil:
def applySoupTransformerToFile(self, file, soupTransformer):
self._writeSoup(soupTransformer(self._readSoup(file)), file)
def _readSoup(self, file):
with open(file) as fp:
soup = BeautifulSoup(fp, 'lxml')
return soup
def _writeSoup(self, soup, file):
with open(file, "w") as fp:
fp.write(str(soup))