#!/home3/zenmagic/python/bin/python import cgi import cgitb; cgitb.enable() import urllib import re import os import glob import sys themarkdhtml="default" doit=1 s="" if (doit == 1) : f='' f = urllib.urlopen("http://zenmagiclove.com/zml/markd/mobi/markd.html") if f != '' : themarkdhtml = f.read() f.close() s=s.replace("


","") gp=s.split("{{") if (gp[0] == "") : gp[0]="hello world92}}" print 'Content-type: text/html\n\n' #wherestop=0 #for x in range(0,len(gp)) : # wherestop=gp[x].find("}}") # if (wherestop > -1) : # print str(x).zfill(3)+" -- "+gp[x][0:wherestop]+"
" gpagenumfield="1" gpagenamefield="1" gpagenum=1 gpagename="1" gpagenums="1" thedirectory="jvine" form=cgi.FieldStorage() if 'gpagenumfield' in form : gpagenums=str(form['gpagenumfield'].value) if 'gpagenamefield' in form : gpagename=str(form['gpagenamefield'].value) gpagenum=int(gpagenums) action="none" if 'next' in form: gpagenum=gpagenum+1 action="next" if 'prev' in form: gpagenum=gpagenum-1 action="prev" if 'toggle' in form: action="toggle" if 'nextg' in form: gpagenum=gpagenum+1 action="next" if 'prevg' in form: gpagenum=gpagenum-1 action="prev" if 'toggleg' in form: action="toggle" if 'plusone' in form: gpagenum=gpagenum+1 action="plusone" if 'minusone' in form: gpagenum=gpagenum-1 action="minusone" if 'tohome' in form: gpagenum=1 action="tohome" if 'toend' in form: gpagenum=len(gp)-1 action="toend" if (gpagenum > len(gp)-1) : gpagenum=1 if (gpagenum <= 0) : gpagenum=len(gp)-1 s="hi" if (s != "hi") : s=re.sub('\r\n','\n',s) s=re.sub('\r\n','\n',s) s=re.sub('\r','\n',s) s=re.sub('\r','\n',s) s=re.sub(' \n','\n',s) s=re.sub(' \n','\n',s) s=re.sub(' \n','\n',s) s=re.sub(' \n','\n',s) s=re.sub(' \n','\n',s) html5=""" viewer19.py """ #s=s.strip('\n') #s=s.rstrip() #s='\n\n\n\n\n'+s # #s=re.sub('\n\n\n\n\n\n\n\n\n\n','\n\n\n\n\n',s) #s=re.sub('\n\n\n\n\n\n\n\n\n','\n\n\n\n\n',s) #s=re.sub('\n\n\n\n\n\n\n\n','\n\n\n\n\n',s) #s=re.sub('\n\n\n\n\n\n\n','\n\n\n\n\n',s) #s=re.sub('\n\n\n\n\n\n','\n\n\n\n\n',s) print html5 # print theform thebody="""




""" theform="""




#warms = we are revolutionizing modern society,
with a simple html5/css/javascript e-book format
which d.i.y. e-book authors and readers can use.

so, of course, this demo requires javascript,
and you seem to have disallowed it currently.

so you will need to turn it on to use this demo.

(and if you're already allowing javascript, then
please file a bug-report. thank you very much.)

""" gpagenums=str(gpagenum) if (int(gpagenums) < 1) : gpagenums="1" gpagenum=1 if (int(gpagenums) > len(gp)-1) : gpagenums=str(len(gp)-1) gpagenum=len(gp)-1 theform=theform.replace("11111",str(gpagenums)) theform=theform.replace("22222",str(gpagename)) thebody=thebody.replace("themarkdhtml",themarkdhtml) theform=theform.replace("themarkdhtml",themarkdhtml) print thebody print theform thejavascript=""" """ print thejavascript for x in range(gpagenum,gpagenum+1) : ## in range(1,len(gp)-1) : sx=str(x).strip() wherestop=gp[x].find("}") print '

' print '' print '' print '' print '' mouseturd=""" <form> Defines an HTML form for user input <input> Defines an input control <textarea> Defines a multiline input control (text area) <label> Defines a label for an element <fieldset> Groups related elements in a form <legend> Defines a caption for a
element <select> Defines a drop-down list <optgroup> Defines a group of related options in a drop-down list <option> Defines an option in a drop-down list <button> """