generating select options in python
This commit is contained in:
@@ -438,7 +438,7 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from SymptomsCausedByVaccines.HtmlUpdater import updateHtmlFile\n",
|
||||
"from SymptomsCausedByVaccines.HtmlUpdater import updateHtmlFile, updateHtmlFile4SymptomsCausedByCOVIDLots\n",
|
||||
"from SymptomsCausedByVaccines.PrrSeriesFactory import PrrSeriesFactory\n",
|
||||
"from SymptomsCausedByVaccines.PrrSeriesTransformer import PrrSeriesTransformer\n",
|
||||
"from SymptomsCausedByVaccines.ProportionalReportingRatiosPersister import saveProportionalReportingRatios\n",
|
||||
@@ -627,11 +627,10 @@
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"updateHtmlFile(\n",
|
||||
"updateHtmlFile4SymptomsCausedByCOVIDLots(\n",
|
||||
" symptoms = list(prrByLotAndSymptom.columns),\n",
|
||||
" vaccines = list(prrByLotAndSymptom.index),\n",
|
||||
" htmlFile = \"../docs/SymptomsCausedByCOVIDLots/index.html\",\n",
|
||||
" defaultSelectVaccineOptionText = 'Select Batch')"
|
||||
" batches = list(prrByLotAndSymptom.index),\n",
|
||||
" htmlFile = \"../docs/SymptomsCausedByCOVIDLots/index.html\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -16,6 +16,19 @@ def updateHtmlFile(symptoms, vaccines, htmlFile, defaultSelectVaccineOptionText
|
||||
htmlFile = htmlFile,
|
||||
selectElementId = 'vaccineSelect')
|
||||
|
||||
def updateHtmlFile4SymptomsCausedByCOVIDLots(symptoms, batches, htmlFile):
|
||||
symptomOptions = getSymptomOptions(symptoms)
|
||||
for selectElementId in ['symptomSelect', 'symptomSelectX', 'symptomSelectY']:
|
||||
_saveOptions(
|
||||
options = symptomOptions,
|
||||
htmlFile = htmlFile,
|
||||
selectElementId = selectElementId)
|
||||
|
||||
_saveOptions(
|
||||
options = getVaccineOptions(batches, 'Select Batch'),
|
||||
htmlFile = htmlFile,
|
||||
selectElementId = 'vaccineSelect')
|
||||
|
||||
def _saveOptions(options, htmlFile, selectElementId):
|
||||
HtmlTransformerUtil().applySoupTransformerToFile(
|
||||
file=htmlFile,
|
||||
|
||||
Reference in New Issue
Block a user