Skip to content

Commit 1a2d77c

Browse files
author
Richard Jones
committed
Importing wasn't setting None values explicitly when it should have been
1 parent 6689ce5 commit 1a2d77c

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

CHANGES.txt

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

44
2003-08-?? 0.6.1
5+
Fixed:
56
- Add note about installing cgi-bin with a different interpreter
7+
- Importing wasn't setting None values explicitly when it should have been
68

79

810
2003-08-08 0.6.0

roundup/admin.py

Lines changed: 1 addition & 11 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: admin.py,v 1.55 2003-06-23 08:05:30 neaj Exp $
19+
# $Id: admin.py,v 1.56 2003-08-26 00:06:55 richard Exp $
2020

2121
'''Administration commands for maintaining Roundup trackers.
2222
'''
@@ -1144,16 +1144,6 @@ class to import.
11441144
p = csv.parser(field_sep=':')
11451145
file_props = p.parse(f.readline())
11461146

1147-
# XXX we don't _really_ need to do this...
1148-
# properties = cl.getprops()
1149-
# propnames = properties.keys()
1150-
# propnames.sort()
1151-
# m = file_props[:]
1152-
# m.sort()
1153-
# if m != propnames:
1154-
# raise UsageError, _('Import file doesn\'t define the same '
1155-
# 'properties as "%(arg0)s".')%{'arg0': args[0]}
1156-
11571147
# loop through the file and create a node for each entry
11581148
maxid = 1
11591149
while 1:

roundup/backends/back_anydbm.py

Lines changed: 2 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: back_anydbm.py,v 1.122 2003-08-12 01:49:30 richard Exp $
18+
#$Id: back_anydbm.py,v 1.123 2003-08-26 00:06:55 richard Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -963,7 +963,7 @@ def import_list(self, propnames, proplist):
963963
d[self.db.RETIRED_FLAG] = 1
964964
continue
965965
elif value is None:
966-
# don't set Nones
966+
d[propname] = None
967967
continue
968968

969969
prop = properties[propname]

roundup/backends/back_metakit.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: back_metakit.py,v 1.47 2003-05-09 01:47:50 richard Exp $
1+
# $Id: back_metakit.py,v 1.48 2003-08-26 00:06:56 richard Exp $
22
'''
33
Metakit backend for Roundup, originally by Gordon McMillan.
44
@@ -1209,6 +1209,9 @@ def import_list(self, propnames, proplist):
12091209
if int(value):
12101210
d['_isdel'] = 1
12111211
continue
1212+
elif value is None:
1213+
d[propname] = None
1214+
continue
12121215

12131216
prop = properties[propname]
12141217
if isinstance(prop, hyperdb.Date):

roundup/backends/rdbms_common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.58 2003-08-12 02:18:46 richard Exp $
1+
# $Id: rdbms_common.py,v 1.59 2003-08-26 00:06:56 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -1123,6 +1123,9 @@ def import_list(self, propnames, proplist):
11231123
if int(value):
11241124
retire = 1
11251125
continue
1126+
elif value is None:
1127+
d[propname] = None
1128+
continue
11261129

11271130
prop = properties[propname]
11281131
if value is None:

0 commit comments

Comments
 (0)