Changeset 9019 for main/waeup.kofa/trunk/tools
- Timestamp:
- 18 Jul 2012, 14:16:21 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/tools/fix_import_file.py
r9009 r9019 184 184 """Replace input fieldnames by fieldnames of COLNAME_MAPPING. 185 185 """ 186 header = dict([(name, name) for name in fieldnames])187 186 # Remove whitespaces 188 for key in header: 189 header[key] = key.strip() 187 header = dict([(name, name.strip()) for name in fieldnames]) 190 188 for in_name, out_name in COLNAME_MAPPING.items(): 191 if in_name not in header :189 if in_name not in header.values(): 192 190 continue 193 header[in_name] = out_name 191 # Inverse dictionary lookup 192 key = [key for key,value in header.items() if value==in_name][0] 193 header[key] = out_name 194 194 return header 195 195
Note: See TracChangeset for help on using the changeset viewer.