Skip to content

Commit 8d1b6a8

Browse files
author
Richard Jones
committed
Fixed the roundup CGI script for updates to cgi_client.py
1 parent caeafe9 commit 8d1b6a8

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

CHANGES

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@
5858
. Major reshuffle of code to allow multiple roundup instances and a
5959
single, site-packages -based installation. Also allows multiple database
6060
back-ends.
61-
61+
. moved the bin/ proggies into the top dir, so that it all works
62+
out-of-the-box

cgi-bin/roundup.cgi

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
# $Id: roundup.cgi,v 1.1 2001-07-22 11:47:07 richard Exp $
3+
# $Id: roundup.cgi,v 1.2 2001-07-23 04:31:40 richard Exp $
44

55
# python version check
66
import sys
@@ -14,7 +14,7 @@ if int(sys.version[0]) < 2:
1414

1515
# This indicates where the Roundup instance lives
1616
ROUNDUPS = {
17-
'test': '/tmp/roundup_test',
17+
'roundup_test': '/tmp/',
1818
}
1919

2020
# Where to log debugging information to. Use an instance of DevNull if you
@@ -49,6 +49,7 @@ def main(instance, out):
4949
auth = os.environ.get("HTTP_CGI_AUTHORIZATION", None)
5050
message = 'Unauthorised'
5151
if auth:
52+
import binascii
5253
l = binascii.a2b_base64(auth.split(' ')[1]).split(':')
5354
user = l[0]
5455
password = None
@@ -71,7 +72,7 @@ def main(instance, out):
7172
keys.sort()
7273
out.write(message)
7374
return
74-
client = instance.Client(out, os.environ, user)
75+
client = instance.Client(out, db, os.environ, user)
7576
try:
7677
client.main()
7778
except cgi_client.Unauthorised:
@@ -86,7 +87,9 @@ out, err = sys.stdout, sys.stderr
8687
try:
8788
sys.stdout = sys.stderr = LOG
8889
import os, string
89-
instance = string.split(os.environ['PATH_INFO'], '/')[1]
90+
path = string.split(os.environ['PATH_INFO'], '/')
91+
instance = path[1]
92+
os.environ['PATH_INFO'] = string.join(path[2:], '/')
9093
if ROUNDUPS.has_key(instance):
9194
instance_home = ROUNDUPS[instance]
9295
sys.path.insert(0, instance_home)
@@ -106,4 +109,7 @@ sys.stdout, sys.stderr = out, err
106109

107110
#
108111
# $Log: not supported by cvs2svn $
112+
# Revision 1.1 2001/07/22 11:47:07 richard
113+
# More Grande Splite
114+
#
109115
#

0 commit comments

Comments
 (0)