Nb? d Z ddlZddlmZ ddlmZ ddlmZ G d d Z e ej Z d ZdS ) aS A database of Python protocol buffer generated symbols. SymbolDatabase is the MessageFactory for messages generated at compile time, and makes it easy to create new instances of a registered type, given only the type's protocol buffer symbol name. Example usage:: db = symbol_database.SymbolDatabase() # Register symbols of interest, from one or multiple files. db.RegisterFileDescriptor(my_proto_pb2.DESCRIPTOR) db.RegisterMessage(my_proto_pb2.MyMessage) db.RegisterEnumDescriptor(my_proto_pb2.MyEnum.DESCRIPTOR) # The database can be used as a MessageFactory, to generate types based on # their name: types = db.GetMessages(['my_proto.proto']) my_message_instance = types['MyMessage']() # The database's underlying descriptor pool can be queried, so it's not # necessary to know a type's filename to be able to generate it: filename = db.pool.FindFileContainingSymbol('MyMessage') my_message_instance = db.GetMessages([filename])['MyMessage']() # This functionality is also provided directly via a convenience method: my_message_instance = db.GetSymbol('MyMessage')() N)api_implementation)descriptor_pool)message_factoryc Z e Zd ZdZi ZddZd Zd Zd Zd Z d Z d Zd Zd Z d Zd ZdS )SymbolDatabasez'A database of Python generated symbols.Nc : |pt j | _ dS )z!Initializes a new SymbolDatabase.N)r DescriptorPoolpool)selfr s /builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib64/python3.11/site-packages/google/protobuf/symbol_database.py__init__zSymbolDatabase.__init__I s 8688DIII c R t j d t j | S )NzSymbolDatabase.GetPrototype() is deprecated. Please use message_factory.GetMessageClass() instead. SymbolDatabase.GetPrototype() will be removed soon.)warningswarnr GetMessageClassr descriptors r GetPrototypezSymbolDatabase.GetPrototypeM s2 M H I I I *:666r c R t j d t j | S )NzDirectly call CreatePrototype() is wrong. Please use message_factory.GetMessageClass() instead. SymbolDatabase.CreatePrototype() will be removed soon.)r r r _InternalCreateMessageClassr s r CreatePrototypezSymbolDatabase.CreatePrototypeS s2 M K L L L 6zBBBr c ^ t j d t j || j S )NzSymbolDatabase.GetMessages() is deprecated. Please use message_factory.GetMessageClassedForFiles() instead. SymbolDatabase.GetMessages() will be removed soon.)r r r GetMessageClassedForFilesr )r filess r GetMessageszSymbolDatabase.GetMessagesY s6 M G H H H 4UDIFFFr c R |j }|| j |<