Skip to content

Commit e57554f

Browse files
author
Richard Jones
committed
Features and fixes.
Feature: . Added INSTANCE_NAME to configuration - used in web and email to identify the instance. . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup signature info in e-mails. . Some more flexibility in the mail gateway and more error handling. . Login now takes you to the page you back to the were denied access to. Fixed: . Lots of bugs, thanks Roch�nd others on the devel mailing list!
1 parent 4cbee40 commit e57554f

File tree

14 files changed

+421
-165
lines changed

14 files changed

+421
-165
lines changed

CHANGES.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
This file contains the changes to the Roundup system over time. The entries
22
are given with the most recent entry first.
33

4-
2001-10-?? - 0.3.0
4+
2001-11-?? - 0.3.1
5+
Feature:
6+
. Added INSTANCE_NAME to configuration - used in web and email to identify
7+
the instance.
8+
. Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup
9+
signature info in e-mails.
10+
. Some more flexibility in the mail gateway and more error handling.
11+
. Login now takes you to the page you back to the were denied access to.
12+
13+
Fixed:
14+
. Lots of bugs, thanks Roch� and others on the devel mailing list!
15+
16+
17+
2001-11-23 - 0.3.0
518
Feature:
619
. #467129 ] Lossage when username=e-mail-address
720
. #473123 ] Change message generation for author

cgi-bin/roundup.cgi

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundup.cgi,v 1.19 2001-11-22 00:25:10 richard Exp $
19+
# $Id: roundup.cgi,v 1.20 2001-11-26 22:55:56 richard Exp $
2020

2121
# python version check
2222
import sys
@@ -133,22 +133,32 @@ def main(out, err):
133133
os.environ['PATH_INFO'] = string.join(path[2:], '/')
134134
request = RequestWrapper(out)
135135
if ROUNDUP_INSTANCE_HOMES.has_key(instance):
136-
instance_home = ROUNDUP_INSTANCE_HOMES[instance]
137-
instance = roundup.instance.open(instance_home)
138-
from roundup import cgi_client
139-
client = instance.Client(instance, request, os.environ)
140-
try:
141-
client.main()
142-
except cgi_client.Unauthorised:
143-
request.send_response(403)
144-
request.send_header('Content-Type', 'text/html')
136+
# redirect if we need a trailing '/'
137+
if len(path) == 2:
138+
request.send_response(301)
139+
absolute_url = 'http://%s%s/'%(os.environ['HTTP_HOST'],
140+
os.environ['REQUEST_URI'])
141+
request.send_header('Location', absolute_url)
145142
request.end_headers()
146-
out.write('Unauthorised')
147-
except cgi_client.NotFound:
148-
request.send_response(404)
149-
request.send_header('Content-Type', 'text/html')
150-
request.end_headers()
151-
out.write('Not found: %s'%client.path)
143+
out.write('Moved Permanently')
144+
else:
145+
instance_home = ROUNDUP_INSTANCE_HOMES[instance]
146+
instance = roundup.instance.open(instance_home)
147+
from roundup import cgi_client
148+
client = instance.Client(instance, request, os.environ)
149+
try:
150+
client.main()
151+
except cgi_client.Unauthorised:
152+
request.send_response(403)
153+
request.send_header('Content-Type', 'text/html')
154+
request.end_headers()
155+
out.write('Unauthorised')
156+
except cgi_client.NotFound:
157+
request.send_response(404)
158+
request.send_header('Content-Type', 'text/html')
159+
request.end_headers()
160+
out.write('Not found: %s'%client.path)
161+
152162
else:
153163
import urllib
154164
request.send_response(200)
@@ -190,6 +200,9 @@ LOG.close()
190200

191201
#
192202
# $Log: not supported by cvs2svn $
203+
# Revision 1.19 2001/11/22 00:25:10 richard
204+
# quick fix for file uploads on windows in roundup.cgi
205+
#
193206
# Revision 1.18 2001/11/06 22:10:11 jhermann
194207
# Added env config; fixed request wrapper & index list; sort list by key
195208
#

roundup-admin

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundup-admin,v 1.46 2001-11-21 03:40:54 richard Exp $
19+
# $Id: roundup-admin,v 1.47 2001-11-26 22:55:56 richard Exp $
2020

2121
import sys
2222
if int(sys.version[0]) < 2:
@@ -306,24 +306,24 @@ Command help:
306306

307307
properties = cl.getprops()
308308
for key, value in props.items():
309-
type = properties[key]
310-
if isinstance(type, hyperdb.String):
309+
proptype = properties[key]
310+
if isinstance(proptype, hyperdb.String):
311311
continue
312-
elif isinstance(type, hyperdb.Password):
312+
elif isinstance(proptype, hyperdb.Password):
313313
props[key] = password.Password(value)
314-
elif isinstance(type, hyperdb.Date):
314+
elif isinstance(proptype, hyperdb.Date):
315315
try:
316316
props[key] = date.Date(value)
317317
except ValueError, message:
318318
raise UsageError, '"%s": %s'%(value, message)
319-
elif isinstance(type, hyperdb.Interval):
319+
elif isinstance(proptype, hyperdb.Interval):
320320
try:
321321
props[key] = date.Interval(value)
322322
except ValueError, message:
323323
raise UsageError, '"%s": %s'%(value, message)
324-
elif isinstance(type, hyperdb.Link):
324+
elif isinstance(proptype, hyperdb.Link):
325325
props[key] = value
326-
elif isinstance(type, hyperdb.Multilink):
326+
elif isinstance(proptype, hyperdb.Multilink):
327327
props[key] = value.split(',')
328328

329329
# try the set
@@ -369,7 +369,7 @@ Command help:
369369

370370
# make sure it's a link
371371
if (not isinstance(property, hyperdb.Link) and not
372-
isinstance(type, hyperdb.Multilink)):
372+
isinstance(proptype, hyperdb.Multilink)):
373373
raise UsageError, 'You may only "find" link properties'
374374

375375
# get the linked-to class and look up the key property
@@ -469,23 +469,23 @@ Command help:
469469
for key in props.keys():
470470
# get the property
471471
try:
472-
type = properties[key]
472+
proptype = properties[key]
473473
except KeyError:
474474
raise UsageError, '%s has no property "%s"'%(classname, key)
475475

476-
if isinstance(type, hyperdb.Date):
476+
if isinstance(proptype, hyperdb.Date):
477477
try:
478478
props[key] = date.Date(value)
479479
except ValueError, message:
480480
raise UsageError, '"%s": %s'%(value, message)
481-
elif isinstance(type, hyperdb.Interval):
481+
elif isinstance(proptype, hyperdb.Interval):
482482
try:
483483
props[key] = date.Interval(value)
484484
except ValueError, message:
485485
raise UsageError, '"%s": %s'%(value, message)
486-
elif isinstance(type, hyperdb.Password):
486+
elif isinstance(proptype, hyperdb.Password):
487487
props[key] = password.Password(value)
488-
elif isinstance(type, hyperdb.Multilink):
488+
elif isinstance(proptype, hyperdb.Multilink):
489489
props[key] = value.split(',')
490490

491491
# check for the key property
@@ -666,14 +666,14 @@ Command help:
666666
properties = cl.properties.items()
667667
for nodeid in cl.list():
668668
l = []
669-
for prop, type in properties:
669+
for prop, proptype in properties:
670670
value = cl.get(nodeid, prop)
671671
# convert data where needed
672-
if isinstance(type, hyperdb.Date):
672+
if isinstance(proptype, hyperdb.Date):
673673
value = value.get_tuple()
674-
elif isinstance(type, hyperdb.Interval):
674+
elif isinstance(proptype, hyperdb.Interval):
675675
value = value.get_tuple()
676-
elif isinstance(type, hyperdb.Password):
676+
elif isinstance(proptype, hyperdb.Password):
677677
value = str(value)
678678
l.append(repr(value))
679679

@@ -712,6 +712,7 @@ Command help:
712712
from roundup import hyperdb
713713

714714
# ensure that the properties and the CSV file headings match
715+
classname = args[0]
715716
try:
716717
cl = self.db.getclass(classname)
717718
except KeyError:
@@ -745,13 +746,13 @@ Command help:
745746
value = eval(l[i])
746747
# Figure the property for this column
747748
key = file_props[i]
748-
type = cl.properties[key]
749+
proptype = cl.properties[key]
749750
# Convert for property type
750-
if isinstance(type, hyperdb.Date):
751+
if isinstance(proptype, hyperdb.Date):
751752
value = date.Date(value)
752-
elif isinstance(type, hyperdb.Interval):
753+
elif isinstance(proptype, hyperdb.Interval):
753754
value = date.Interval(value)
754-
elif isinstance(type, hyperdb.Password):
755+
elif isinstance(proptype, hyperdb.Password):
755756
pwd = password.Password()
756757
pwd.unpack(value)
757758
value = pwd
@@ -892,6 +893,9 @@ if __name__ == '__main__':
892893

893894
#
894895
# $Log: not supported by cvs2svn $
896+
# Revision 1.46 2001/11/21 03:40:54 richard
897+
# more new property handling
898+
#
895899
# Revision 1.45 2001/11/12 22:51:59 jhermann
896900
# Fixed option & associated error handling
897901
#

roundup-server

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
2121
Based on CGIHTTPServer in the Python library.
2222
23-
$Id: roundup-server,v 1.19 2001-11-12 22:51:04 jhermann Exp $
23+
$Id: roundup-server,v 1.20 2001-11-26 22:55:56 richard Exp $
2424
2525
"""
2626
import sys
@@ -247,8 +247,8 @@ def main():
247247
except SystemExit:
248248
raise
249249
except:
250-
type, value = sys.exc_info()[:2]
251-
usage('%s: %s'%(type, value))
250+
exc_type, exc_value = sys.exc_info()[:2]
251+
usage('%s: %s'%(exc_type, exc_value))
252252

253253
# we don't want the cgi module interpreting the command-line args ;)
254254
sys.argv = sys.argv[:1]
@@ -262,6 +262,9 @@ if __name__ == '__main__':
262262

263263
#
264264
# $Log: not supported by cvs2svn $
265+
# Revision 1.19 2001/11/12 22:51:04 jhermann
266+
# Fixed option & associated error handling
267+
#
265268
# Revision 1.18 2001/11/01 22:04:37 richard
266269
# Started work on supporting a pop3-fetching server
267270
# Fixed bugs:

0 commit comments

Comments
 (0)