removing createAndSaveHistogramsForCountries

This commit is contained in:
frankknoll
2023-04-02 22:15:18 +02:00
parent fedb6c44bf
commit c9e885f9f0
15 changed files with 82 additions and 368 deletions

View File

@@ -1,30 +1,14 @@
from bs4 import BeautifulSoup
from HtmlTransformerUtil import HtmlTransformerUtil
from CountryOptionsSetter import CountryOptionsSetter
from DateProvider import DateProvider
from HtmlUtils import getCountryOptions, getCountries
from DateProvider import DateProvider
def updateBatchCodeTableHtmlFile(internationalVaersCovid19, batchCodeTableHtmlFile):
countryOptions = getCountryOptions(getCountries(internationalVaersCovid19))
_saveCountryOptions(countryOptions, batchCodeTableHtmlFile)
def updateBatchCodeTableHtmlFile(batchCodeTableHtmlFile):
_saveLastUpdatedBatchCodeTable(
DateProvider().getLastUpdatedDataSource(),
batchCodeTableHtmlFile)
def _saveCountryOptions(countryOptions, batchCodeTableHtmlFile):
HtmlTransformerUtil().applySoupTransformerToFile(
file=batchCodeTableHtmlFile,
soupTransformer=lambda soup:
BeautifulSoup(
CountryOptionsSetter().setCountryOptions(
html=str(soup),
options=countryOptions),
'lxml'))
def _saveLastUpdatedBatchCodeTable(lastUpdated, batchCodeTableHtmlFile):
def setLastUpdated(soup):
soup.find(id="last_updated").string.replace_with(