Project

General

Profile

« Previous | Next » 

Revision 6402

db_xml.py: put(): Added _setDefault() built-in function, which adds an entry to col_defaults

View differences:

lib/db_xml.py
52 52

  
53 53
input_col_prefix = xml_func.var_name_prefix
54 54

  
55
put_special_funcs = set(['_simplifyPath'])
55
put_special_funcs = set(['_setDefault', '_simplifyPath'])
56 56

  
57 57
no_parent_ids_loc = object() # tells put() there is no parent_ids_loc
58 58

  
......
98 98
    except dicts.KeyExistsError, e: wrap_e(e)
99 99
    
100 100
    # Special handling for structural XML functions
101
    if out_table == '_simplifyPath':
101
    if out_table == '_setDefault':
102 102
        # Parse args
103 103
        try:
104
            col = row['col']
105
            value = row['value']
106
            path = row['path']
107
        except KeyError, e: wrap_e(e)
108
        
109
        col_defaults[col] = put_(value) # modifies outer col_defaults var
110
        return put_(path)
111
    elif out_table == '_simplifyPath':
112
        # Parse args
113
        try:
104 114
            next = row['next'] # modifies outer next var used by put_()
105 115
            path = row['path']
106 116
        except KeyError, e: wrap_e(e)

Also available in: Unified diff