"Fossies" - the Fresh Open Source Software Archive

Member "viewvc-1.2.1/bin/wsgi/viewvc.wsgi" (26 Mar 2020, 1271 Bytes) of package /linux/misc/viewvc-1.2.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "viewvc.wsgi": 1.1.28_vs_1.2.1.

    1 #!/usr/bin/python
    2 # -*-python-*-
    3 #
    4 # Copyright (C) 1999-2020 The ViewCVS Group. All Rights Reserved.
    5 #
    6 # By using this file, you agree to the terms and conditions set forth in
    7 # the LICENSE.html file which can be found at the top level of the ViewVC
    8 # distribution or at http://viewvc.org/license-1.html.
    9 #
   10 # For more information, visit http://viewvc.org/
   11 #
   12 # -----------------------------------------------------------------------
   13 #
   14 # viewvc: View CVS/SVN repositories via a web browser
   15 #
   16 # -----------------------------------------------------------------------
   17 #
   18 # This is a wsgi entry point for the main ViewVC app. It's appropriate
   19 # for use with mod_wsgi. It defines a single application function that
   20 # is a valid wsgi entry point.
   21 #
   22 # -----------------------------------------------------------------------
   23 
   24 import sys, os
   25 
   26 LIBRARY_DIR = None
   27 CONF_PATHNAME = None
   28 
   29 if LIBRARY_DIR:
   30   sys.path.insert(0, LIBRARY_DIR)
   31 else:
   32   sys.path.insert(0, os.path.abspath(os.path.join(sys.argv[0],
   33                                                   "../../../lib")))
   34 
   35 import sapi
   36 import viewvc
   37 
   38 def application(environ, start_response):
   39   server = sapi.WsgiServer(environ, start_response)
   40   cfg = viewvc.load_config(CONF_PATHNAME, server)
   41   viewvc.main(server, cfg)
   42   return []