print makeTabs(5) + '</table>' print "</td>" #### Second one print "<td>" print form.getvalue("qBook2") print makeTabs(5) + '<table border="1">' print "Unique words: " + str(unique2) print dataToTable.makeTableBody(dictToList(tally2, count2)) print makeTabs(5) + '</table>' print "</td>" ### Both print "<td>" print "both" print makeTabs(5) + '<table border="1">' print dataToTable.makeTableBody( dictToList(tally, count, form.getvalue("qBook"), count2, tally2, form.getvalue("qBook2"))) print makeTabs(5) + '</table>' print "</td>" print "</tr>" print "</table>" print htmlFuncts.endPage()
""" #search has been queried else: #begin open file tableStream = open("MOCK_DATA.csv", "r") tableString = tableStream.read() tableStream.close() #end open file dataTable = dataToTable.makeList(tableString) #the result table finalTable = dataTable #search by name if "findByName" in form and not(form.getvalue("qString") is None): if form.getvalue("searchType") == "first": finalTable = searchByName(finalTable, form.getvalue("qString"), 1) elif form.getvalue("searchType") == "last": finalTable = searchByName(finalTable, form.getvalue("qString"), 2) elif form.getvalue("searchType") == "email": finalTable = searchByName(finalTable, form.getvalue("qString"), 3) #search by state if "findByState" in form: finalTable = searchByName(finalTable, form.getvalue("qState"), 4) print "<table>\n" + dataToTable.makeTableBody(finalTable) + \ "</table>" print htmlFuncts.endPage()