Ignore:
Timestamp:
Oct 2, 2017, 1:38:18 PM (2 years ago)
Author:
cameron
Message:

Multicolumn parsing support for UCD files - adding bpt property

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/UCD-scripts/UCD_parser.py

    r5658 r5661  
    232232    property_object.finalizeProperty()
    233233
     234def parse_multicolumn_property_data(pfile, property_object_map, property_lookup_map, prop_code_list):
     235    f = open(UCD_config.UCD_src_dir + "/" + pfile)
     236    props = []
     237    lines = f.readlines()
     238    for t in lines:
     239        if UCD_skip.match(t):
     240            continue
     241        else:
     242            (cp_lo, cp_hi, fields) = parse_data_record(t)
     243            if len(fields) != len(prop_code_list): raise Exception("Mutlicolumn field count mismatch, expecting %i: " % len(prop_code_list) + t)
     244            for i in range(len(fields)):
     245                if fields[i] != '':
     246                    property_object_map[prop_code_list[i]].addDataRecord(cp_lo, cp_hi, fields[i])
     247    for p in prop_code_list:
     248        property_object_map[p].finalizeProperty()
     249
    234250def parse_ScriptExtensions_txt(script_property_object):
    235251    filename_root = 'ScriptExtensions'
Note: See TracChangeset for help on using the changeset viewer.