Skip to content

Commit 1ecae9b

Browse files
author
Richard Jones
committed
more new property handling
1 parent e78d0ec commit 1ecae9b

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

roundup-admin

Lines changed: 5 additions & 2 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.45 2001-11-12 22:51:59 jhermann Exp $
19+
# $Id: roundup-admin,v 1.46 2001-11-21 03:40:54 richard Exp $
2020

2121
import sys
2222
if int(sys.version[0]) < 2:
@@ -349,7 +349,7 @@ Command help:
349349

350350
# TODO: handle > 1 argument
351351
# handle the propname=value argument
352-
if prop.find('=') == -1:
352+
if args[1].find('=') == -1:
353353
raise UsageError, 'argument "%s" not propname=value'%prop
354354
try:
355355
propname, value = args[1].split('=')
@@ -892,6 +892,9 @@ if __name__ == '__main__':
892892

893893
#
894894
# $Log: not supported by cvs2svn $
895+
# Revision 1.45 2001/11/12 22:51:59 jhermann
896+
# Fixed option & associated error handling
897+
#
895898
# Revision 1.44 2001/11/12 22:01:06 richard
896899
# Fixed issues with nosy reaction and author copies.
897900
#

roundup/htmltemplate.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: htmltemplate.py,v 1.41 2001-11-15 10:26:01 richard Exp $
18+
# $Id: htmltemplate.py,v 1.42 2001-11-21 03:40:54 richard Exp $
1919

2020
import os, re, StringIO, urllib, cgi, errno
2121

@@ -51,7 +51,18 @@ def do_plain(self, property, escape=0):
5151
return '[Field: not called from item]'
5252
propclass = self.properties[property]
5353
if self.nodeid:
54-
value = self.cl.get(self.nodeid, property)
54+
# make sure the property is a valid one
55+
# TODO: this tests, but we should handle the exception
56+
prop_test = self.cl.getprops()[property]
57+
58+
# get the value for this property
59+
try:
60+
value = self.cl.get(self.nodeid, property)
61+
except KeyError:
62+
# a KeyError here means that the node doesn't have a value
63+
# for the specified property
64+
if isinstance(propclass, hyperdb.Multilink): value = []
65+
else: value = ''
5566
else:
5667
# TODO: pull the value from the form
5768
if isinstance(propclass, hyperdb.Multilink): value = []
@@ -850,6 +861,9 @@ def render(self, form):
850861

851862
#
852863
# $Log: not supported by cvs2svn $
864+
# Revision 1.41 2001/11/15 10:26:01 richard
865+
# . missing "return" in filter_section (thanks Roch'e Compaan)
866+
#
853867
# Revision 1.40 2001/11/03 01:56:51 richard
854868
# More HTML compliance fixes. This will probably fix the Netscape problem
855869
# too.

roundup/hyperdb.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: hyperdb.py,v 1.32 2001-11-21 03:11:28 richard Exp $
18+
# $Id: hyperdb.py,v 1.33 2001-11-21 03:40:54 richard Exp $
1919

2020
# standard python modules
2121
import cPickle, re, string
@@ -305,6 +305,8 @@ class or a KeyError is raised.
305305
raise ValueError, 'node with key "%s" exists'%value
306306

307307
# this will raise the KeyError if the property isn't valid
308+
# ... we don't use getprops() here because we only care about
309+
# the writeable properties.
308310
prop = self.properties[key]
309311

310312
if isinstance(prop, Link):
@@ -847,6 +849,9 @@ def Choice(name, *options):
847849

848850
#
849851
# $Log: not supported by cvs2svn $
852+
# Revision 1.32 2001/11/21 03:11:28 richard
853+
# Better handling of new properties.
854+
#
850855
# Revision 1.31 2001/11/12 22:01:06 richard
851856
# Fixed issues with nosy reaction and author copies.
852857
#

0 commit comments

Comments
 (0)