#!/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 urllib import socket # for debugging #import cgitb; cgitb.enable() # Globals OCS_KITPATH = '/var/www/html/kits' BASE_URL = 'http://localhost/cgi-bin' LIST_KITS_CGI = 'list_kits.cgi' LIST_GUIDES_CGI = 'list_guides.cgi' LIST_MANPAGES_CGI = 'list_manpages.cgi' LIST_HOSTINFO_CGI = 'list_hostinfo.cgi' LIST_USEFUL_CGI = 'list_useful.cgi' # Helpers def outputURL(cgi): url = urllib.URLopener() fp = url.open('%s/%s' % (BASE_URL,cgi)) for line in fp.readlines(): print line[:-1] fp.close() def headContents(): print '
' print ' | ' outputURL(LIST_HOSTINFO_CGI) print ' | ' print '
'
print 'Table of Contents: ' print 'Useful Links ' print 'Installed Kits ' print 'Guides ' print 'Platform OCS Tools Man Pages ' print ' |
'
print header + ' ' print ' |
A collection of links to web GUIs of installed applications and support sites:
' outputURL(LIST_USEFUL_CGI) sectionFooter() # List kit links sectionHeader('Installed Kits') print 'The following kits are available on this cluster:
' outputURL(LIST_KITS_CGI) sectionFooter() # List guide links sectionHeader('Guides') print 'Refer to the following guides for detailed instructions:
' outputURL(LIST_GUIDES_CGI) sectionFooter() # List manpage links sectionHeader('Platform OCS Tools Man Pages') print 'Refer to the following man pages for detailed command-line usage:
' outputURL(LIST_MANPAGES_CGI) sectionFooter() endBody() endHTML()