Lines Matching refs:attr_spec

475     def _decode_enum(self, raw, attr_spec):  argument
476 enum = self.consts[attr_spec['enum']]
477 if 'enum-as-flags' in attr_spec and attr_spec['enum-as-flags']:
489 def _decode_binary(self, attr, attr_spec): argument
490 if attr_spec.struct_name:
491 members = self.consts[attr_spec.struct_name]
496 elif attr_spec.sub_type:
497 decoded = attr.as_c_array(attr_spec.sub_type)
500 if attr_spec.display_hint:
501 decoded = NlAttr.formatted_string(decoded, attr_spec.display_hint)
504 def _decode_array_nest(self, attr, attr_spec): argument
511 subattrs = self._decode(NlAttrs(item.raw), attr_spec['nested-attributes'])
520 attr_spec = attr_space.attrs_by_val[attr.type]
523 if attr_spec["type"] == 'nest':
524 subdict = self._decode(NlAttrs(attr.raw), attr_spec['nested-attributes'])
526 elif attr_spec["type"] == 'string':
528 elif attr_spec["type"] == 'binary':
529 decoded = self._decode_binary(attr, attr_spec)
530 elif attr_spec["type"] == 'flag':
532 elif attr_spec["type"] in NlAttr.type_formats:
533 decoded = attr.as_scalar(attr_spec['type'], attr_spec.byte_order)
534 elif attr_spec["type"] == 'array-nest':
535 decoded = self._decode_array_nest(attr, attr_spec)
539 if 'enum' in attr_spec:
540 decoded = self._decode_enum(decoded, attr_spec)
542 if not attr_spec.is_multi:
543 rsp[attr_spec['name']] = decoded
544 elif attr_spec.name in rsp:
545 rsp[attr_spec.name].append(decoded)
547 rsp[attr_spec.name] = [decoded]
554 attr_spec = attr_set.attrs_by_val[attr.type]
560 return '.' + attr_spec.name
565 if attr_spec['type'] != 'nest':
569 self.attr_sets[attr_spec['nested-attributes']],
573 return '.' + attr_spec.name + subpath