Skip to content

Commit da3bc8b

Browse files
committed
Varia
1 parent 0bf3427 commit da3bc8b

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ are given with the most recent entry first.
33

44
2007-??-??
55
Feature:
6+
- Roundup has a new xmlrpc frontend that gives access to a tracker using XMLRPC.
67
- Dates can now be in the year-range 1-9999 except for metakit which is
78
still limited to 1970-2038.
89
- Add simple anti-spam recipe to docs

doc/features.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ from Ka-Ping Yee in the Software Carpentry "Track" design competition.
102102
- a variety of sample shell scripts are provided (weekly reports, issue
103103
generation, ...)
104104

105+
*xmlrpc interface*
106+
- simple remote tracker interface with basic HTTP authentication
107+
- provides same access to tracker as roundup-admin, but based on
108+
XMLRPC calls
109+
105110
.. _sqlite: http://www.hwaci.com/sw/sqlite/
106111
.. _metakit: http://www.equi4.com/metakit/
107112
.. _mysql: http://sourceforge.net/projects/mysql-python

roundup/scripts/roundup_xmlrpc_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#
33
# Copyright (C) 2007 Stefan Seefeld
44
# All rights reserved.
5-
# Licensed to the public under the terms of the GNU LGPL (>= 2),
6-
# see the file COPYING for details.
5+
# For license terms see the file COPYING.txt.
76
#
7+
88
import getopt, os, sys, socket
99
from roundup.xmlrpc import RoundupServer, RoundupRequestHandler
1010
from roundup.instance import TrackerError

roundup/xmlrpc.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
#
22
# Copyright (C) 2007 Stefan Seefeld
33
# All rights reserved.
4-
# Licensed to the public under the terms of the GNU LGPL (>= 2),
5-
# see the file COPYING for details.
4+
# For license terms see the file COPYING.txt.
65
#
76

8-
97
import base64
108
import roundup.instance
119
from roundup import hyperdb
@@ -59,7 +57,7 @@ def __init__(self, tracker, username, password):
5957
raise Unauthorised, 'Invalid user.'
6058
self.db.setCurrentUser(username)
6159

62-
def __del__(self):
60+
def close(self):
6361
"""Close the database, after committing any changes, if needed."""
6462

6563
if getattr(self, 'db'):
@@ -118,7 +116,9 @@ def list(self, username, password, classname, propname = None):
118116
cl = r.get_class(classname)
119117
if not propname:
120118
propname = cl.labelprop()
121-
return [cl.get(id, propname) for id in cl.list()]
119+
result = [cl.get(id, propname) for id in cl.list()]
120+
r.close()
121+
return result
122122

123123
def display(self, username, password, designator, *properties):
124124

@@ -127,8 +127,9 @@ def display(self, username, password, designator, *properties):
127127
cl = r.get_class(classname)
128128
props = properties and list(properties) or cl.properties.keys()
129129
props.sort()
130-
return dict([(property, cl.get(nodeid, property))
131-
for property in props])
130+
result = [(property, cl.get(nodeid, property)) for property in props]
131+
r.close()
132+
return dict(result)
132133

133134
def create(self, username, password, classname, *args):
134135

@@ -145,9 +146,12 @@ def create(self, username, password, classname, *args):
145146

146147
# do the actual create
147148
try:
148-
return cl.create(**props)
149+
result = cl.create(**props)
149150
except (TypeError, IndexError, ValueError), message:
150151
raise UsageError, message
152+
finally:
153+
r.close()
154+
return result
151155

152156
def set(self, username, password, designator, *args):
153157

@@ -161,5 +165,6 @@ def set(self, username, password, designator, *args):
161165
cl.set(itemid, **props)
162166
except (TypeError, IndexError, ValueError), message:
163167
raise UsageError, message
164-
168+
finally:
169+
r.close()
165170

test/test_xmlrpc.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#
22
# Copyright (C) 2007 Stefan Seefeld
33
# All rights reserved.
4-
# Licensed to the public under the terms of the GNU LGPL (>= 2),
5-
# see the file COPYING for details.
4+
# For license terms see the file COPYING.txt.
65
#
76

87
import unittest, os, shutil, errno, sys, difflib, cgi, re

0 commit comments

Comments
 (0)