webviewvc.in 1.66 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/local/bin/python
# -*-python-*-
#
# Copyright (C) 1999-2002 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewCVS
# distribution or at http://viewcvs.sourceforge.net/license-1.html.
#
# Contact information:
#   Greg Stein, PO Box 760, Palo Alto, CA, 94302
#   gstein@lyra.org, http://viewcvs.sourceforge.net/
#

LIBRARY_DIR = r"/usr/testbed/viewcvs-1.0/lib"
CONF_PATHNAME = r"/usr/testbed/viewcvs-1.0/viewcvs.conf"

#########################################################################
#
# Adjust sys.path to include our library directory
#
import sys
import os
import re

sys.path.insert(0, LIBRARY_DIR)

#
# We must get a -repo argument.
#
if len(sys.argv) != 3:
    sys.exit(1)
    pass

if sys.argv[1] != "-repo":
    sys.exit(1)
    pass
repodir = sys.argv[2]

# go do the work
import sapi
import viewcvs

viewcvs._legal_params['exptidx'] = viewcvs._re_validate_number
viewcvs._sticky_vars.append('exptidx')
viewcvs._legal_params['eid'] = re.compile('^[-_a-zA-Z0-9]+$')
viewcvs._sticky_vars.append('eid')
viewcvs._legal_params['pid'] = viewcvs._re_validate_number
viewcvs._sticky_vars.append('pid')

server = sapi.CgiServer()
cfg = viewcvs.load_config(CONF_PATHNAME, server)

cfg.general.default_root = 'svn'
cfg.general.svn_roots    = {'svn' : repodir}
Leigh B. Stoller's avatar
Leigh B. Stoller committed
56
cfg.general.cvs_roots    = {}
57
cfg.options.docroot      = "/cvsweb/viewvc"
Leigh B. Stoller's avatar
Leigh B. Stoller committed
58
59
cfg.options.http_expiration_time = 10
cfg.options.generate_etags = 1
60
cfg.options.use_localtime  = 1
Leigh B. Stoller's avatar
Leigh B. Stoller committed
61
cfg.general.address      = "<a href='mailto:@TBOPSEMAIL_NOSLASH@'>@TBOPSEMAIL_NOSLASH@</a>"
62
63

viewcvs.main(server, cfg)