comparison roundup/admin.py @ 2793:fcd76e1e97af

open CSV files in "universal newline" mode
author Richard Jones <richard@users.sourceforge.net>
date Wed, 20 Oct 2004 04:45:01 +0000
parents dea26f113e6f
children adec352e2ce0
comparison
equal deleted inserted replaced
2792:7131b106a389 2793:fcd76e1e97af
14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
18 # 18 #
19 # $Id: admin.py,v 1.82 2004-10-19 09:15:32 a1s Exp $ 19 # $Id: admin.py,v 1.83 2004-10-20 04:45:01 richard Exp $
20 20
21 '''Administration commands for maintaining Roundup trackers. 21 '''Administration commands for maintaining Roundup trackers.
22 ''' 22 '''
23 __docformat__ = 'restructuredtext' 23 __docformat__ = 'restructuredtext'
24 24
1106 continue 1106 continue
1107 1107
1108 cl = self.get_class(classname) 1108 cl = self.get_class(classname)
1109 1109
1110 # ensure that the properties and the CSV file headings match 1110 # ensure that the properties and the CSV file headings match
1111 f = open(os.path.join(dir, file)) 1111 f = open(os.path.join(dir, file), 'rU')
1112 reader = rcsv.reader(f, rcsv.colon_separated) 1112 reader = rcsv.reader(f, rcsv.colon_separated)
1113 file_props = None 1113 file_props = None
1114 maxid = 1 1114 maxid = 1
1115 # loop through the file and create a node for each entry 1115 # loop through the file and create a node for each entry
1116 for r in reader: 1116 for r in reader:
1124 maxid = max(maxid, nodeid) 1124 maxid = max(maxid, nodeid)
1125 1125
1126 f.close() 1126 f.close()
1127 1127
1128 # import the journals 1128 # import the journals
1129 f = open(os.path.join(args[0], classname + '-journals.csv')) 1129 f = open(os.path.join(args[0], classname + '-journals.csv'), 'rU')
1130 reader = rcsv.reader(f, rcsv.colon_separated) 1130 reader = rcsv.reader(f, rcsv.colon_separated)
1131 cl.import_journals(reader) 1131 cl.import_journals(reader)
1132 f.close() 1132 f.close()
1133 1133
1134 # set the id counter 1134 # set the id counter

Roundup Issue Tracker: http://roundup-tracker.org/