Made a small python programm to collate the manual to print it more easily.
May be of help for some.
And I’m new to 3D, Panda3D and this group, so I hope I’m not doing anythingf wrong here.
have a good day.
jm
PS Preview seem to indicate that indentation is getting ripped off - don’t know why, still posting it - re-indenting shouldn’t be to daunting !
#**** python code follows
“”"
QuickNDirty tool to collate html help files from Panda3D Manual into one document
for easy printing.
It’s not pretty code, and its produces a html doc full of anomalies.
If it is usefull for anyone good for you: it was for me 
NOTES
This program uses the index file’s href to find the documents and collate them all into one document.
Exceptions: the two entries from wiki (‘jam-o-drum’ and ‘debugging and performance tuning’ ) where
omitted as they where causing formatting problems (that I didn’t have the time or will to correct.
ALSO Modified the title of file
A_Panda_%22Hello_World%22.1.html
to
A_Panda_%2522Hello_World%2522.1.html
Jean-Marc Deschamps, 12 november 2006
“”"
import tkFileDialog as tf
import os.path,os
##global variables
reper=""
def stripForm(monindex):
“”" Takes the first form tag block out, use as often as required"""
b=monindex.find("<form")
c=monindex.find("</form",b+1)
debut= monindex[:b]
fin= monindex[c+7:]
return debut+fin
def splitHeader(monindex):
“”" Assumes that the starting table for content is the fourth one"""
a=0
for i in range(4):
a=monindex.find("<table",a+1)
return (monindex[:a],monindex[a:])
def splitFooter(monindex):
“”" Assumes that the starting table for the footer is the second one"""
a=0
for i in range(2):
a=monindex.find("<table",a+1)
return (monindex[:a],monindex[a:])
def getContenu(fiche,titre):
“”“read the files and grab the content only (well, mainly!)”""
if fiche[1:5] ==“http”:
return “
”+titre+" ( Omitted section )"+"
"
else:
fic=reper+"/"+fiche[1:-1]
print fic
ledoc=file(fic)
lecontenu=ledoc.read()
ledoc.close()
head,main=splitHeader(lecontenu)
main=stripForm(main)
doc="
"+titre+"
"+main
return doc
def getContent(main):
“”“Main funcgtion going through the TOC and pulling the hrefs to get the files and titles”""
contenu=""
ref="<a href="
lref=len(ref)
a=1
a=main.find(ref)
while a>-1:
b=main.find(" “,a+lref)
fiche=main[a+lref:b]
c=main.find(”>",b-1)
d=main.find("</a",c)
titre=main[c+1:d]
contenu = contenu + getContenu(fiche,titre)
a=main.find(ref,a+1)
return contenu
def myMain():
global reper
mondir=os.getcwd()
if os.path.exists(mondir+"/index.html"):
reper=mondir
else:
reper=tf.askdirectory()
if reper:
fiches=os.listdir(reper)
monindexfile=file(reper+"/index.html")
monindex=monindexfile.read()
monindexfile.close()
mondoc=""
monindex= stripForm(monindex)
monindex= stripForm(monindex)
header,main= splitHeader(monindex)
main,footer=splitFooter(main)
fulldoc= getContent(main)
doccomplet=header+fulldoc+footer
ff=file(“pandafull.html”,“w”)
ff.write(header+main+doccomplet+footer)
ff.close()
print “END”
if name==“main”:
myMain()
#**** END