@@ -238,24 +238,32 @@ def set_map_properties(props, map):
238
238
for key in props :
239
239
if key in ['version' ]:
240
240
continue ;
241
- elif key == 'srcs' :
242
- srcs = props [key ]
243
- i = 0
244
- for srcProps in srcs :
245
- # find src slot index
246
- src = map .source (i )
247
- for srcKey in srcProps :
248
- if srcKey in ['name' , 'type' , 'length' , 'num_instances' ]:
249
- continue
250
- src .set_property (srcKey , srcProps [srcKey ])
251
- i = i + 1
252
- elif key == 'dst' :
253
- dstProps = props [key ]
254
- dst = map .destination ()
255
- for dstKey in dstProps :
256
- if dstKey in ['name' , 'type' , 'length' , 'num_instances' ]:
257
- continue
258
- dst .set_property (dstKey , dstProps [dstKey ])
241
+ elif key .startswith ('src' ):
242
+ srcidx = - 1
243
+ argidx = - 1
244
+ if key [3 ] == '[' and key [5 :6 ] == '].' :
245
+ srcidx = int (key [4 ])
246
+ argidx = 7
247
+ elif key [3 ] == '.' :
248
+ srcidx = 0
249
+ argidx = 4
250
+ else :
251
+ continue
252
+ subkey = key [argidx :]
253
+ value = props [key ]
254
+ if subkey == 'min' or subkey == 'max' :
255
+ value = as_number (value )
256
+ elif subkey == 'bound_min' or subkey == 'bound_max' :
257
+ value = boundaryStrings [value ]
258
+ map .source (srcidx ).set_property (subkey , value )
259
+ elif key .startswith ('dst.' ):
260
+ subkey = key [4 :]
261
+ value = props [key ]
262
+ if subkey == 'min' or subkey == 'max' :
263
+ value = as_number (value )
264
+ elif subkey == 'bound_min' or subkey == 'bound_max' :
265
+ value = boundaryStrings [value ]
266
+ map .destination ().set_property (subkey , value )
259
267
elif key == 'mode' :
260
268
if props ['mode' ] == 'linear' :
261
269
map .mode = mapper .MODE_LINEAR
0 commit comments