From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1H14k6-0000KE-RG for garchives@archives.gentoo.org; Sun, 31 Dec 2006 17:45:07 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.8/8.13.8) with SMTP id kBVHfe6W028206; Sun, 31 Dec 2006 17:41:40 GMT Received: from sccrmhc14.comcast.net (sccrmhc14.comcast.net [204.127.200.84]) by robin.gentoo.org (8.13.8/8.13.8) with ESMTP id kBVHc8KD030134 for ; Sun, 31 Dec 2006 17:38:08 GMT Received: from spinner (c-69-249-7-96.hsd1.nj.comcast.net[69.249.7.96]) by comcast.net (sccrmhc14) with ESMTP id <200612311738060140044jk1e>; Sun, 31 Dec 2006 17:38:06 +0000 From: Jerry McBride Organization: TEAM-GENTOO To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Documentation Index Date: Sun, 31 Dec 2006 12:38:06 -0500 User-Agent: KMail/1.9.5 References: <9acccfe50612301603k15644cu3b2a7777ad975b30@mail.gmail.com> <20061230230424.78745540@osage.osagesoftware.com> <9acccfe50612302100h2cae0dc8t301b3ea522808df5@mail.gmail.com> In-Reply-To: <9acccfe50612302100h2cae0dc8t301b3ea522808df5@mail.gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200612311238.06348.mcbrides9@comcast.net> X-Archives-Salt: f76432b5-b7d2-4228-b41c-3c34780fd4be X-Archives-Hash: 2c8759d6fa264d8e0eb7e6357106b4bc On Sunday 31 December 2006 00:00, Kevin O'Gorman wrote: > Hey, Jerry, wanna make a project team? I woulda done Python if I had > thought it was gonna get big. It now seems like that would be a good idea. > Care to: > 1) share your code? > 2) start a sourceforge project? > 3) just tantalize us with your results? > It's far, far from being finished or polished... here it is: #!/usr/bin/python # try: import psyco psyco.full() except ImportError: print "Non-Fatal error importing PSYCO" pass # try: import readline except ImportError: print "Fatal Error importing readline" sys.exit(1) # try: import struct except ImportError: print "Fatal Error importing struct" sys.exit(1) # try: import string except ImportError: print "Fatal Error importing string" sys.exit(1) # try: import sys except ImportError: print "Fatal Error imporing sys" sys.exit(1) # try: import os except ImportError: print "Fatal Error imporing os" sys.exit(1) al="array.list" il="index.list" ni="/var/www/localhost/htdocs/index2.html" z=0 rightNow="today!" version="1.0" print "Every Damn Index - version ",version print "" print 'Scanning hard drive and creating list of all discovered files.' print "" os.system('tree -fixn --noreport -o '+il+' /') print 'Construction of index list completed!' print "" print"Reading text from: ", il print "" # # read index.list and create new array list # input=open(il,'r') output=open(al,'w') for line in input.readlines(): # strip off leading and trailing spaces line = string.strip(line, " ") # stip off CR's line = string.rstrip(line,chr(10)) words=string.split(line,"/") steps=len(words) if words[steps-1]=="index.html": output.writelines(line+chr(10)) words=string.split(line,".") steps=len(words) if words[steps-1]=="pdf": output.writelines(line+chr(10)) words=string.split(line,".") steps=len(words) if words[steps-1]=="chm": output.writelines(line+chr(10)) z=z+1 if z > 2000: print ".", z=0 print"" print "Successfully processed ",il print"" input.close() output.close() print"Reading text from: "+al+" and building new "+ni print"" input=open(al,'r') output=open(ni,'w') output.writelines(''+chr(10)) output.writelines(""+chr(10)) output.writelines(""+chr(10)) output.writelines("Evey Damn Index "+version+"- copyright Jerome D. McBride - 2006"+chr(10)) output.writelines(''+chr(10)) output.writelines(''+chr(10)) #output.writelines(''+chr(10)) output.writelines(""+chr(10)) output.writelines(""+chr(10)) output.writelines("
"+chr(10)) output.writelines(" Every Damn Index - Version "+version+" "+chr(10)) output.writelines("
"+chr(10)) output.writelines("This page conatins a list of all available html indexes, .pdf and .chm files"+chr(10)) output.writelines("created "+rightNow+chr(10)) output.writelines("
"+chr(10)) output.writelines("
"+chr(10)) z=0 for line in input.readlines(): # strip off leading and trailing spaces line = string.strip(line, " ") # strip off leading and trailing slashes line = string.strip(line, "/") # stip off CR's line = string.rstrip(line,chr(10)) print 'Looking for package info for:', line #clean up previous info.dat file os.system("rm info.dat 2>/dev/null 1>/dev/null") os.system('/usr/bin/equery belongs '+line+' >info.dat') inputData=open('info.dat','r') infoText=inputData.read() inputData.close() if len(infoText)==0: infoText="PNA/PNA" words=string.split(infoText,"/") steps=len(words) groupName=words[0] packageName=words[1] output.writelines('
--'+packageName+'-- documentation found at '+line+'
'+chr(10)) output.writelines("
"+chr(10)) output.writelines("The end..."+chr(10)) output.writelines("
"+chr(10)) output.writelines(""+chr(10)) output.writelines(""+chr(10)) print "New index2.html written to ",ni,"." print "" print "Program successfully shutdown." print "" input.close() output.close() os.system("rm "+al+" 2>/dev/null 1>/dev/null") os.system("rm "+il+" 2>/dev/null 1>/dev/null") os.system("rm info.dat 2>/dev/null 1>/dev/null") sys.exit(0) As for manning a project... time hasn't allowed me the pleasure of a decent day off from work. I would, however, contribute as I can. Cheers all and enjoy -- Jerry McBride -- gentoo-user@gentoo.org mailing list