Blame Automation/Python/centos-web/cgi-bin/centos-web.cgi

Alain Reguera Delgado 8f60cb
#!/usr/bin/python
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# centos-web.cgi -- This script is an effort to organize The CentOS
Alain Reguera Delgado 8f60cb
# Project information in XHTML format for its publication on the
Alain Reguera Delgado 8f60cb
# Internet. The script is organized in a package named `Apps' which,
Alain Reguera Delgado 8f60cb
# in turn, is subdivided in other packages (e.g., `Home', `Sponsors',
Alain Reguera Delgado 8f60cb
# etc.) to cover each web application the organization demands.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# Notice that some of the web applications demanded (e.g., Wiki,
Alain Reguera Delgado 8f60cb
# Lists, Forums, Bugs, etc.) are not included in this script, but
Alain Reguera Delgado 8f60cb
# linked to their own locations. Moreover, in order to provide
Alain Reguera Delgado 8f60cb
# accessability among all different web applications, they need to be
Alain Reguera Delgado 8f60cb
# redesigned to share one unique visual style and one unique top-level
Alain Reguera Delgado 8f60cb
# navigation bar so the current web application can be remarked.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# Copyright (C) 2011 Alain Reguera Delgado
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# This program is free software; you can redistribute it and/or modify
Alain Reguera Delgado 8f60cb
# it under the terms of the GNU General Public License as published by
Alain Reguera Delgado 8f60cb
# the Free Software Foundation; either version 2 of the License, or
Alain Reguera Delgado 8f60cb
# (at your option) any later version.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# This program is distributed in the hope that it will be useful, but
Alain Reguera Delgado 8f60cb
# WITHOUT ANY WARRANTY; without even the implied warranty of
Alain Reguera Delgado 8f60cb
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Alain Reguera Delgado 8f60cb
# General Public License for more details.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# You should have received a copy of the GNU General Public License
Alain Reguera Delgado 8f60cb
# along with this program; if not, write to the Free Software
Alain Reguera Delgado 8f60cb
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Alain Reguera Delgado 8f60cb
#
Alain Reguera Delgado 8f60cb
# ------------------------------------------------------------------
Alain Reguera Delgado 8f60cb
# $Id$
Alain Reguera Delgado 8f60cb
# ------------------------------------------------------------------
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
import cgi
Alain Reguera Delgado 8f60cb
import cgitb; cgitb.enable()
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
def main():
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    qs = cgi.parse()
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    if 'app' in qs:
Alain Reguera Delgado 8f60cb
        app = qs['app'][0].lower()
Alain Reguera Delgado 8f60cb
    else:
Alain Reguera Delgado 8f60cb
        app = 'home'
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
    if app == 'home':
Alain Reguera Delgado 8f60cb
        from Apps.Home import page
Alain Reguera Delgado 8f60cb
    elif app == 'sponsors':
Alain Reguera Delgado 8f60cb
        from Apps.Sponsors import page
Alain Reguera Delgado 8f60cb
    else:
Alain Reguera Delgado 8f60cb
        from Apps.Unknown import page
Alain Reguera Delgado 8f60cb
    
Alain Reguera Delgado 8f60cb
    print 'Content-type: text/html' + "\n"
Alain Reguera Delgado 8f60cb
    print page.main()
Alain Reguera Delgado 8f60cb
Alain Reguera Delgado 8f60cb
if __name__ == '__main__': main()