Changeset 3267
- Timestamp:
- 4 Mar 2008, 08:36:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/WAeUPTool.py
r3264 r3267 1431 1431 return em 1432 1432 import_source_fn = os.path.split(import_source_path)[1] 1433 info['imported_from'] = import_source_fn 1433 if not pending_only: 1434 info['imported_from'] = import_source_fn 1434 1435 attrs = csv.reader(open(import_source_path,"rb")).next() 1435 1436 if "import_mode" not in attrs: … … 1508 1509 error = results[1] 1509 1510 mapping = results[2] 1511 # 1512 # restore some values 1513 # 1510 1514 for k in empty_value_keys: 1511 1515 mapping[k] = EMPTY 1512 1516 if mapping.has_key('sex'): 1513 1517 #import pdb;pdb.set_trace() 1514 if mapping['sex'] :1518 if mapping['sex'] == True: 1515 1519 mapping['sex'] = 'F' 1516 el se:1520 elif mapping['sex'] == False: 1517 1521 mapping['sex'] = 'M' 1522 if pending_only: 1523 info['imported_from'] = item['imported_from'] 1518 1524 data_string = ", ".join("%s: %s" % (k,v) for k,v in mapping.items()) 1519 1525 info['error'] = error … … 1572 1578 logger.info(msg) 1573 1579 elapse = time.time() - elapse 1580 copy2(pending_path,pending_backup) 1574 1581 copy2(pending_tmp,pending_path) 1575 1582 msg = "finished importing from %(import_source_fn)s in %(elapse).2f seconds, " % vars()
Note: See TracChangeset for help on using the changeset viewer.