Changeset 599:2f719a01af01
- Timestamp:
- 02/22/15 09:35:04 (10 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dcdatagen.py
r443 r599 244 244 ["Lack of and/or unserviceable ULD's or pallets", 245 245 "Üzemképes konténerek és raklapok hiánya"]]), 246 (DELAYCODE, FOR_MODERN | FOR_OT,246 (DELAYCODE, FOR_MODERN, 247 247 [None, "39", "GT", 248 248 ["TECHNICAL EQUIPMENT", "BERENDEZÉSEK"], … … 830 830 print >> dcdata, "CAPTION = 1" 831 831 print >> dcdata, "DELAYCODE = 2" 832 print >> dcdata 832 833 833 834 tableMask = 1 834 835 for i in range(0, len(tablePrefixes)): 836 print >> dcdata, "_%s_code2meaning = {" % (tablePrefixes[i],) 837 838 columnIndexes = [] 839 for j in range(0, len(headings)): 840 if ( (headingFlags[j]&tableMask)==tableMask ): 841 columnIndexes.append(j) 842 843 codeIndex = columnIndexes[0] 844 meaningIndex = columnIndexes[2] 845 846 rowIndex = 0 847 for (type, mask, columns) in rows: 848 if (mask&tableMask)!=tableMask: 849 continue 850 851 if type==DELAYCODE: 852 print >> dcdata, " \"%s\": \"%s\"," % \ 853 (str(columns[codeIndex]).strip(), columns[meaningIndex][0].replace("\n", "")) 854 855 print >> dcdata, "}" 856 print >> dcdata 857 858 tableMask <<= 1 859 860 print >> dcdata, "def _extract(table, row):" 861 print >> dcdata, " code = row[0].strip()" 862 print >> dcdata, " meaning = table[code] if code in table else None" 863 print >> dcdata, " return code + ((\" (\" + meaning + \")\") if meaning else \"\")" 864 print >> dcdata 865 866 tableMask = 1 867 for i in range(0, len(tablePrefixes)): 868 835 869 print >> dcdata, "_%s_data = (" % (tablePrefixes[i],) 836 print >> dcdata, " %s," % (extractor,) 870 print >> dcdata, " lambda row: _extract(_%s_code2meaning, row)," % \ 871 (tablePrefixes[i],) 837 872 print >> dcdata, " [", 838 873
Note:
See TracChangeset
for help on using the changeset viewer.