#!/usr/bin/env python # # Copyright (C) 2007 Platform Computing Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA import os import sys import cgi import re # for debugging #import cgitb; cgitb.enable() OCS_KITPATH = '/var/www/html/kits' FIND = '/usr/bin/find' print "Content-Type: text/html" print # Does the kits docs dir exist? if (not os.path.exists(OCS_KITPATH) or not os.path.isdir(OCS_KITPATH)): OCS_KITPATH = '/srv/www/htdocs/kits' if (not os.path.exists(OCS_KITPATH) or not os.path.isdir(OCS_KITPATH)): print "Could not find kit documentation directory" sys.exit(1) # Find path to index.html for all kits cmd = 'cd %s ; %s -L . -maxdepth 3 -name index.html' % (OCS_KITPATH,FIND) (f_out,f_in) = os.popen4(cmd) f_out.close() # Output links to kit docs print '' f_in.close()