[Tutor] webmgr part 1 thus far
Kirk Bailey
deliberatus@my995internet.com
Wed, 26 Dec 2001 23:15:06 -0500
ok, take a look and tell me where I am wrong:
-----------------------------------------------------------------------
ns# list TLwebmgr.py
Listing of file TLwebmgr.py in
directory:/www/www.howlermonkey.net/cgi-bin
#!/usr/local/bin/python
#
# You must define the next lien for the WEB path to your server's web
directory!
# ALL web scripts must live in the cgi-bin UNDER this dir!
# THAT IS WHERE TL LIVES! /lists lives UNDER that dir in the tree!
#
webpath="http://www.howlermonkey.net"
import string, sys, os, fnmatch, cgi
#
forminput=sys.stdin
f1=open('html.header','r')
header=string.join(f1.readlines())
f1.close()
f1=open('html.footer','r')
footer=string.join(f1.readlines())
f1.close()
filelist=[]
print "<html><head>Content-Type: text/html" # HTML is following
print header
#
CRLF="\r\n"
#
def descriptor(filename): # Read 1st line in file named.
f1=open('./lists/'+filename,'r') #open the file named,
info=string.strip(f1.readline()) # read the first line in
the file
f1.close() # close the file
return info # and exit returning the
1 line read
#
files=os.listdir('./lists/') # this creates a raw dir listing
filelist=[] # create an empty list
fnmatch.filter(filelist, "*.info") # return the subset of list
which match!
print filelist # testcode, remove later
index=0 # we will now strip any
whitespaces
for x in filelist: # filelist lists all the
available info files
print "<a href="+\"+webpath+"/cgi-bin/commander.py?list=" + x +
\" + ">" + x + "</a> ",
descriptor(x)+"<P>"
print "<P><br>Please click a name to read the entire description and to"
print " access the form to subscribe or subscribe.<P><br>"
print footer
ns#
-----------------------------------------------------------------------
--
Respectfully,
-Kirk D Bailey (C)2001
Addme! icq #27840081
end
Within the sweep of his sword, Each man is an Ubar.
http://www.howlermonkey.net/
http://www.sacredelectron.org/