def publish_results(username, password, journalId): # Initialize Ledger API ledgerApi = LedgerApi(baseUrl) # Authenticate user in ledger session = ledgerApi.authenticateUser(username, password) # Retrieve voting journal data journalString = ledgerApi.getJournal(session, journalId) export_raw(journalString) # Calculate voting results votingResults = VotesCounter().count(journalString) # Export result to html presentation html = generate_html(votingResults) export_html(html)