#!/usr/bin/python # poll_server.py # --copyright-- Copyright 2010 (C) Tranzoa, Co. All rights reserved. Warranty: You're free and on your own here. This code is not necessarily up-to-date or of public quality. # --url-- http://www.tranzoa.net/tzpython/ # --email-- pycode is the name to send to. tranzoa.com is the place to send to. # --bodstamps-- # December 18, 2010 bar # December 24, 2010 bar # December 26, 2010 bar # December 27, 2010 bar your name form element # March 23, 2011 bar spin a_logger off to tz_server_logger.py # October 8, 2011 bar put the log in the current dir # October 11, 2011 bar and get rid of the .py in it # November 7, 2011 bar close log in main # November 29, 2011 bar pyflake cleanup # May 27, 2012 bar doxygen namespace # March 8, 2015 bar split out JAVASCRIPT # March 3, 2023 bar python3 # by default the main script logs to our name rather than the default for a logger # March 4, 2023 bar make how_long and log_file_name in that order to be consistent and probably what we want to do for tz_lib_test # --eodstamps-- ## \file # \namespace tzpython.poll_server # # # This is a web server for polling people about something. # # Extend a_poll_server() with routines to fill in the main page and the poll pages. # And put the application logic in the routines that respond to hits from clients. # # How it works: # # There's a "main page" that first timers and unknown clients get. # The main page contains N iframes, each with a "poll page" containing the poll questions and buttons for responses (or something that causes a server hit when the user says something). # The main page iframes come up in display:none style - they don't show and don't take space. # When the poll pages are loaded, they call a routine in the main page to let the main page know they are ready. # If the main page isn't showing any poll page, then it shows the ready poll page. Otherwise the poll page is queued up to be shown later. # When a poll page button is pressed (that is, at