webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Public Member Functions | |
def | __init__ (self, pool=None) |
def | RegisterMessage (self, message) |
def | RegisterEnumDescriptor (self, enum_descriptor) |
def | RegisterFileDescriptor (self, file_descriptor) |
def | GetSymbol (self, symbol) |
def | GetPrototype (self, descriptor) |
def | GetMessages (self, files) |
Public Attributes | |
pool | |
A database of Python generated symbols. SymbolDatabase also models message_factory.MessageFactory. The symbol database can be used to keep a global registry of all protocol buffer types used within a program.
def google.protobuf.symbol_database.SymbolDatabase.__init__ | ( | self, | |
pool = None |
|||
) |
Constructor.
def google.protobuf.symbol_database.SymbolDatabase.GetMessages | ( | self, | |
files | |||
) |
Gets all the messages from a specified file. This will find and resolve dependencies, failing if they are not registered in the symbol database. Args: files: The file names to extract messages from. Returns: A dictionary mapping proto names to the message classes. This will include any dependent messages as well as any messages defined in the same file as a specified message. Raises: KeyError: if a file could not be found.
def google.protobuf.symbol_database.SymbolDatabase.GetPrototype | ( | self, | |
descriptor | |||
) |
Builds a proto2 message class based on the passed in descriptor. Passing a descriptor with a fully qualified name matching a previous invocation will cause the same class to be returned. Args: descriptor: The descriptor to build from. Returns: A class describing the passed in descriptor.
def google.protobuf.symbol_database.SymbolDatabase.GetSymbol | ( | self, | |
symbol | |||
) |
Tries to find a symbol in the local database. Currently, this method only returns message.Message instances, however, if may be extended in future to support other symbol types. Args: symbol: A str, a protocol buffer symbol. Returns: A Python class corresponding to the symbol. Raises: KeyError: if the symbol could not be found.
def google.protobuf.symbol_database.SymbolDatabase.RegisterEnumDescriptor | ( | self, | |
enum_descriptor | |||
) |
Registers the given enum descriptor in the local database. Args: enum_descriptor: a descriptor.EnumDescriptor. Returns: The provided descriptor.
def google.protobuf.symbol_database.SymbolDatabase.RegisterFileDescriptor | ( | self, | |
file_descriptor | |||
) |
Registers the given file descriptor in the local database. Args: file_descriptor: a descriptor.FileDescriptor. Returns: The provided descriptor.
def google.protobuf.symbol_database.SymbolDatabase.RegisterMessage | ( | self, | |
message | |||
) |
Registers the given message type in the local database. Args: message: a message.Message, to be registered. Returns: The provided message.
google.protobuf.symbol_database.SymbolDatabase.pool |