Lines Matching refs:desc
343 def __init__(self, names, desc, enum_options, index, comments): argument
359 self.values = [(names + x.name, x.number) for x in desc.value]
361 self.values = [(base_name + x.name, x.number) for x in desc.value]
363 self.value_longnames = [self.names + x.name for x in desc.value]
468 def __init__(self, struct_name, desc, field_options): argument
470 self.tag = desc.number
473 self.name = desc.name
499 if desc.type == FieldD.TYPE_STRING and field_options.HasField("max_length"):
506 if desc.HasField('default_value'):
507 self.default = desc.default_value
511 if desc.label == FieldD.LABEL_REPEATED:
521 if desc.type == FieldD.TYPE_MESSAGE and not field_options.proto3_singular_msgs:
525 elif hasattr(desc, "proto3_optional") and desc.proto3_optional:
531 elif desc.label == FieldD.LABEL_REQUIRED:
533 elif desc.label == FieldD.LABEL_OPTIONAL:
536 raise NotImplementedError(desc.label)
540 if desc.type == FieldD.TYPE_STRING and self.max_size is None:
543 if desc.type == FieldD.TYPE_BYTES and self.max_size is None:
571 desc.type = field_options.type_override
574 if desc.type in datatypes:
575 self.ctype, self.pbtype, self.enc_size, self.data_item_size = datatypes[desc.type]
578 if (desc.type, field_options.int_size) in datatypes:
579 …self.ctype, self.pbtype, self.enc_size, self.data_item_size = datatypes[(desc.type, field_options.…
580 elif desc.type == FieldD.TYPE_ENUM:
583 self.ctype = names_from_type_name(desc.type_name)
587 elif desc.type == FieldD.TYPE_STRING:
596 elif desc.type == FieldD.TYPE_BYTES:
613 elif desc.type == FieldD.TYPE_MESSAGE:
615 self.ctype = self.submsgname = names_from_type_name(desc.type_name)
620 raise NotImplementedError(desc.type)
964 def __init__(self, fullname, desc, field_options): argument
966 self.extendee_name = names_from_type_name(desc.extendee)
967 Field.__init__(self, self.fullname + "extmsg", desc, field_options)
1128 def __init__(self, names, desc, message_options, index, comments): argument
1133 self.desc = desc
1141 if desc is not None:
1142 self.load_fields(desc, message_options)
1153 def load_fields(self, desc, message_options): argument
1158 if hasattr(desc, 'oneof_decl'):
1159 for i, f in enumerate(desc.oneof_decl):
1160 oneof_options = get_nanopb_suboptions(desc, message_options, self.name + f.name)
1171 for f in desc.field:
1197 if len(desc.extension_range) > 0:
1198 field_options = get_nanopb_suboptions(desc, message_options, self.name + 'extensions')
1199 range_start = min([r.start for r in desc.extension_range])
1414 if not self.desc:
1417 if self.desc.options.map_entry:
1420 optional_only = copy.deepcopy(self.desc)
1465 desc = google.protobuf.descriptor.MakeDescriptor(optional_only)
1466 msg = reflection.MakeClass(desc)()
1487 def iterate_messages(desc, flatten = False, names = Names()): argument
1489 if hasattr(desc, 'message_type'):
1490 submsgs = desc.message_type
1492 submsgs = desc.nested_type
1504 def iterate_extensions(desc, flatten = False, names = Names()): argument
1508 for extension in desc.extension:
1511 for subname, subdesc in iterate_messages(desc, flatten, names):