From e2036bbf8446c3fcc1dfe6f0cc5bdff7148f4850 Mon Sep 17 00:00:00 2001 From: Curt Hash Date: Mon, 25 Jan 2010 16:04:40 -0700 Subject: [PATCH] pollster now writes the date and time the page was generated, so that clients can calculate how long it has been since the last poll. --- pollster/pollster.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pollster/pollster.py b/pollster/pollster.py index fd535e2..d06169f 100755 --- a/pollster/pollster.py +++ b/pollster/pollster.py @@ -176,7 +176,6 @@ POLLS = { } ip_re = re.compile('(\d{1,3}\.){3}\d{1,3}') -poll_no = 0 # loop forever while True: @@ -237,8 +236,16 @@ while True: if DEBUG is True: print('+-----------------------------------------+') - out.write('

Poll number: %d

' % poll_no) - poll_no += 1 + time_str = time.strftime('%a, %d %b %Y %H:%M:%S %Z') + out.write(''' +

This page was generated on %s. That was ? seconds ago.

+ + ''' % (time_str, time.time()*1000)) t_end = time.time() exec_time = int(t_end - t_start)