#!/usr/bin/python import cgi import time import os import sys import shelve try: dailys = shelve.open("dailys") b = dailys['1/1'] except: z = open("dailys.txt").read().split("\n") for i in range (len(z)): try: (l,r) = z[i].split("#") dailys[l] = r except: i=i form = cgi.FieldStorage() try: x = form['date'].value (m,d) = x.split("/") month = int(m) day = int(d) except: tm = time.localtime(time.time()) month = int(tm[1]) day = int(tm[2]) key = "%d/%d" % (month,day) todays = dailys[key] nextday = shelve.open("nextday") prevday = shelve.open("prevday") theNextDays = nextday[key] theLastDays = prevday[key] u = todays.split("-") x = "" if (len(u) == 1): u.append(str(int(u[0]) )) for i in range (int(u[0]),1 + int(u[1])): a = open("el.%03d.html" % i) z = "
Elpis Israel Page %d index Yesterday Tomorrow
" % (i,theLastDays,theNextDays) + a.read() x = x + "\n" + z s = x print "Content-type: text/html\n\n" print "" print "" print "Elpis Israel - by John Thomas" print "" print "" print "" print "
" print " Sight Impaired Version
" print "
" print s print "
" print "

Date

" print "
"