Changeset 2979 for WAeUP_SRP/base/skins/waeup_utilities/fix_lgas.py
- Timestamp:
- 5 Jan 2008, 15:01:33 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_utilities/fix_lgas.py
r2978 r2979 66 66 logger.info("found %d students" % total) 67 67 count = 0 68 commit_after = 5069 logger.info('started to fix %d lga' % total)68 commit_after = 100 69 logger.info('started to fix %d records in students_catalog' % total) 70 70 d,states,lgas = getLGAs() 71 71 d = {} … … 76 76 continue 77 77 if student_record.lga.startswith('no state'): 78 logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id)) 78 79 continue 79 80 #rwrite("%s: %s" % (student_record.id,student_record.lga)) 80 81 sl = student_record.lga.split('/') 81 82 if len(sl) != 2: 83 logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id)) 82 84 #rwrite("wrong size %s: %s" % (student_record.id,sl)) 83 85 continue … … 85 87 lga = sl[1].lower().strip() 86 88 if not lga or not state: 89 logger.info("found invalid lga %s of %s" % (student_record.lga,student_record.id)) 87 90 continue 88 91 count += 1 89 92 if len(d) and not len(d) % commit_after: 90 logger.info("found %d correct of %d sofar" % (len(d),count))93 logger.info("found %d correct of %d so far" % (len(d),count)) 91 94 state_lga = state + '_' + lga 92 95 if state in states: … … 101 104 break 102 105 if found: 103 msg = "found %s for %s" % (state_lga,student_record.id)106 #msg = "found %s for %s" % (state_lga,student_record.id) 104 107 d[student_record.id] = state_lga 105 else:106 msg = "no '%s' '%s' for %s" % (state,lga,student_record.id)108 #else: 109 #msg = "no '%s' '%s' for %s" % (state,lga,student_record.id) 107 110 #rwrite(msg) 108 else:109 msg = "no state '%s' '%s' for %s" % (state,lga,student_record.id)111 #else: 112 #msg = "no state '%s' '%s' for %s" % (state,lga,student_record.id) 110 113 #rwrite(msg) 111 114 # if count > 150:
Note: See TracChangeset for help on using the changeset viewer.