Skip to content

Commit 5d93cfc

Browse files
author
Richard Jones
committed
applied patch fixing some form handling issues in ZRoundup
(thanks Chris Withers)
1 parent f591945 commit 5d93cfc

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Fixed:
88
- loosened the detection of issue cross-references in messages
99
- open CSV files in "universal newline" mode
1010
- s/Modifed/Modified (thanks donfu)
11+
- applied patch fixing some form handling issues in ZRoundup (thanks Chris
12+
Withers)
1113

1214

1315
2004-10-15 0.7.8

frontends/ZRoundup/ZRoundup.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1515
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1616
#
17-
# $Id: ZRoundup.py,v 1.17.2.1 2004-07-21 04:48:41 richard Exp $
17+
# $Id: ZRoundup.py,v 1.17.2.2 2004-11-05 04:41:19 richard Exp $
1818
#
1919
''' ZRoundup module - exposes the roundup web interface to Zope
2020
@@ -75,18 +75,14 @@ def __init__(self, value):
7575
self.value = value
7676
if hasattr(self.value, 'filename'):
7777
self.filename = self.value.filename
78-
self.file = self.value
78+
self.value = self.value.read()
7979

8080
class FormWrapper:
8181
'''Make a Zope form dict look like a cgi.py one
8282
'''
8383
def __init__(self, form):
8484
self.form = form
85-
self.value = []
8685
def __getitem__(self, item):
87-
for entry in self.value:
88-
if entry.name == item:
89-
return entry
9086
entry = self.form[item]
9187
if isinstance(entry, type([])):
9288
entry = map(FormItem, entry)
@@ -97,18 +93,11 @@ def getvalue(self, key, default=None):
9793
if self.form.has_key(key):
9894
return self.form[key]
9995
else:
100-
return default
96+
return default
10197
def has_key(self, item):
102-
for entry in self.value:
103-
if entry.name == item:
104-
return 1
10598
return self.form.has_key(item)
10699
def keys(self):
107-
l = [e.name for e in self.value]
108-
for name in self.form.keys():
109-
if name not in l:
110-
l.append(name)
111-
return l
100+
return self.form.keys():
112101

113102
class ZRoundup(Item, PropertyManager, Implicit, Persistent):
114103
'''An instance of this class provides an interface between Zope and

0 commit comments

Comments
 (0)