Changeset 2112
- Timestamp:
- 17 Aug 2007, 06:25:25 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTables.py
r2099 r2112 184 184 total = 0 185 185 iname = "%s" % filename 186 if schema is None:187 em = 'No schema specified'188 logger.error(em)189 return em190 if layout is None:191 em = 'No layout specified'192 logger.error(em)193 return em194 validators = {}195 for widget in layout.keys():196 validators[widget] = layout[widget].validate197 # if mode == 'edit':198 # importer = self.importEdit199 # elif mode == 'add':200 # importer = self.importAdd201 # else:202 # importer = None203 186 not_imported = [] 204 187 imported = [] … … 214 197 d['imported_fn'] = imported_fn 215 198 d['not_imported_fn'] = not_imported_fn 199 if schema is None: 200 em = 'No schema specified' 201 logger.error(em) 202 return d 203 if layout is None: 204 em = 'No layout specified' 205 logger.error(em) 206 return d 207 validators = {} 208 for widget in layout.keys(): 209 try: 210 validators[widget] = layout[widget].validate 211 except AttributeError: 212 logger.info('%s has no validate attribute' % widget) 213 return d 214 # if mode == 'edit': 215 # importer = self.importEdit 216 # elif mode == 'add': 217 # importer = self.importAdd 218 # else: 219 # importer = None 216 220 try: 217 221 items = csv.DictReader(open(import_fn,"rb"))
Note: See TracChangeset for help on using the changeset viewer.