Changeset 9007 for main/waeup.kofa/trunk
- Timestamp:
- 17 Jul 2012, 04:36:27 (12 years ago)
- Location:
- main/waeup.kofa/trunk/tools
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/tools/fix_import_file.py
r8945 r9007 103 103 'date': 'date', 104 104 'category': 'p_category', 105 'reg_transition': 'reg_state', # we completely change this column, 106 # since reg_state import is usually intended 107 'transition': 'reg_transition', 105 108 } 106 109 … … 109 112 # base data 110 113 'reg_state': 'state', 114 'reg_transition': 'state', 111 115 'jamb_reg_no': 'reg_number', 112 116 'matric_no': 'matric_number', … … 165 169 'courses_registered': 'courses registered', 166 170 'courses_validated': 'courses validated', 171 'admit': 'admitted', 172 'return': 'returning' 167 173 } 168 174 … … 193 199 """ 194 200 if len(value) == 7: 195 return ' E' + value201 return 'B' + value 196 202 return value 197 203 … … 201 207 """ 202 208 return REGSTATE_MAPPING.get(value,value) 209 210 @classmethod 211 def reg_transition(self, value): 212 if value == "admitted": 213 return "admit" 214 if value == "returning": 215 return "return" 216 return value 203 217 204 218 @classmethod … … 421 435 if not value: 422 436 return 437 value = value.strip('#') 423 438 value = value.replace('-', '') 424 439 value = value.replace('/', '') 425 440 match = RE_PHONE.match(value) 426 441 phone = match.groups()[0] 427 value = '-%s' % phone 442 if value.startswith('234'): 443 value = '+' + value[:3] + '-' + value[3:] 444 else: 445 value = '-%s' % phone 428 446 return value + '#' 429 447 … … 437 455 return [(i[0].lower(),i[1]) for i in liste] 438 456 return 457 439 458 440 459 def main():
Note: See TracChangeset for help on using the changeset viewer.