Changeset 7526 for main/waeup.sirp/trunk/tools
- Timestamp:
- 27 Jan 2012, 18:26:20 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/tools/fix_import_file.py
r7518 r7526 55 55 'entry_session': 'session', 56 56 'current_session': 'session', 57 'reg_state': 'reg_state', 58 'password': 'password', 57 59 } 58 60 … … 61 63 'jamb_reg_no': 'reg_number', 62 64 'birthday': 'date_of_birth', 65 'clr_ac_pin': 'clr_code', 63 66 } 67 68 # Mapping input regh_state --> output reg_state 69 REGSTATE_MAPPING = { 70 'student_created': 'created', 71 'admitted': 'admitted', 72 'clearance_pin_entered': 'clearance started', 73 'clearance_requested': 'clearance requested', 74 'cleared_and_validated': 'cleared', 75 'school_fee_paid': 'school fee paid', 76 'returning': 'returning', 77 'courses_registered': 'courses registered', 78 'courses_validated': 'courses validated', 79 } 80 64 81 ## 65 82 ## END OF CONFIG … … 83 100 """Converters to turn old-style values into new ones. 84 101 """ 102 103 @classmethod 104 def reg_state(self, value): 105 """ 'courses_validated' --> 'courses validated' 106 """ 107 return REGSTATE_MAPPING.get(value,value) 108 109 85 110 @classmethod 86 111 def session(self, value): … … 112 137 @classmethod 113 138 def gender(self, value): 114 """ 'True'/'False' --> 'f emale'/'male'139 """ 'True'/'False' --> 'f'/'m' 115 140 """ 116 141 if value == 'True': 117 value = 'f emale'142 value = 'f' 118 143 elif value == 'False': 119 value = 'm ale'144 value = 'm' 120 145 else: 121 146 value = '' … … 152 177 #print "OUT: ", value 153 178 return value 179 180 @classmethod 181 def password(self, value): 182 if value == "not set": 183 return "" 184 return value 185 154 186 155 187 reader = csv.DictReader(open(INPUT_FILE, 'rb'))
Note: See TracChangeset for help on using the changeset viewer.