Lines Matching refs:attr_spec
349 def _decode_enum(self, rsp, attr_spec): argument
350 raw = rsp[attr_spec['name']]
351 enum = self.consts[attr_spec['enum']]
352 i = attr_spec.get('value-start', 0)
353 if 'enum-as-flags' in attr_spec and attr_spec['enum-as-flags']:
362 rsp[attr_spec['name']] = value
368 attr_spec = attr_space.attrs_by_val[attr.type]
369 if attr_spec["type"] == 'nest':
370 subdict = self._decode(NlAttrs(attr.raw), attr_spec['nested-attributes'])
372 elif attr_spec['type'] == 'u8':
374 elif attr_spec['type'] == 'u32':
376 elif attr_spec['type'] == 'u64':
378 elif attr_spec["type"] == 'string':
380 elif attr_spec["type"] == 'binary':
382 elif attr_spec["type"] == 'flag':
387 if not attr_spec.is_multi:
388 rsp[attr_spec['name']] = decoded
389 elif attr_spec.name in rsp:
390 rsp[attr_spec.name].append(decoded)
392 rsp[attr_spec.name] = [decoded]
394 if 'enum' in attr_spec:
395 self._decode_enum(rsp, attr_spec)
400 attr_spec = attr_set.attrs_by_val[attr.type]
404 return '.' + attr_spec.name
409 if attr_spec['type'] != 'nest':
413 self.attr_sets[attr_spec['nested-attributes']],
417 return '.' + attr_spec.name + subpath