Changeset 7602
- Timestamp:
- 8 Feb 2012, 07:24:41 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/tools/fix_import_file.py
r7575 r7602 47 47 'entry_session': 'session', 48 48 'current_session': 'session', 49 'session_id': 'session', 49 50 'reg_state': 'reg_state', 50 51 'password': 'password', 51 52 'phone': 'phone', 53 'level': 'level', 54 'start_level': 'level', 55 'end_level': 'level', 56 'level_id': 'level', 57 'current_level': 'level', 58 'semester': 'semester', 59 'application_category': 'application_category', 52 60 } 53 61 … … 107 115 108 116 @classmethod 117 def level(self, value): 118 """ '000' --> '10' 119 """ 120 try: 121 number = int(value) 122 except ValueError: 123 return 9999 124 if number == 0: 125 return 10 126 return number 127 128 @classmethod 129 def semester(self, value): 130 """ '0' --> '9' 131 """ 132 try: 133 number = int(value) 134 except ValueError: 135 return 9999 136 if number == 0: 137 return 9 138 return number 139 140 @classmethod 141 def application_category(self, value): 142 """ '' --> 'no' 143 """ 144 if value == '': 145 return 'no' 146 return value 147 148 149 @classmethod 109 150 def session(self, value): 110 151 """ '08' --> '2008' … … 113 154 number = int(value) 114 155 except ValueError: 156 #import pdb; pdb.set_trace() 115 157 return 9999 116 158 if number < 14: … … 220 262 continue 221 263 row[key] = converter(row[key]) 222 writer.writerow(row) 264 try: 265 writer.writerow(row) 266 except: 267 print row['student_id'] 223 268 224 269 print "Output written to %s" % output_file
Note: See TracChangeset for help on using the changeset viewer.