@@ -142,69 +142,6 @@ def __init__(self, pool=None):
142
142
"""Initializes a new factory."""
143
143
self .pool = pool or descriptor_pool .DescriptorPool ()
144
144
145
- def GetPrototype (self , descriptor ):
146
- """Obtains a proto2 message class based on the passed in descriptor.
147
-
148
- Passing a descriptor with a fully qualified name matching a previous
149
- invocation will cause the same class to be returned.
150
-
151
- Args:
152
- descriptor: The descriptor to build from.
153
-
154
- Returns:
155
- A class describing the passed in descriptor.
156
- """
157
- warnings .warn (
158
- 'MessageFactory class is deprecated. Please use '
159
- 'GetMessageClass() instead of MessageFactory.GetPrototype. '
160
- 'MessageFactory class will be removed after 2024.' ,
161
- stacklevel = 2 ,
162
- )
163
- return GetMessageClass (descriptor )
164
-
165
- def CreatePrototype (self , descriptor ):
166
- """Builds a proto2 message class based on the passed in descriptor.
167
-
168
- Don't call this function directly, it always creates a new class. Call
169
- GetMessageClass() instead.
170
-
171
- Args:
172
- descriptor: The descriptor to build from.
173
-
174
- Returns:
175
- A class describing the passed in descriptor.
176
- """
177
- warnings .warn (
178
- 'Directly call CreatePrototype is wrong. Please use '
179
- 'GetMessageClass() method instead. Directly use '
180
- 'CreatePrototype will raise error after July 2023.' ,
181
- stacklevel = 2 ,
182
- )
183
- return _InternalCreateMessageClass (descriptor )
184
-
185
- def GetMessages (self , files ):
186
- """Gets all the messages from a specified file.
187
-
188
- This will find and resolve dependencies, failing if the descriptor
189
- pool cannot satisfy them.
190
-
191
- Args:
192
- files: The file names to extract messages from.
193
-
194
- Returns:
195
- A dictionary mapping proto names to the message classes. This will include
196
- any dependent messages as well as any messages defined in the same file as
197
- a specified message.
198
- """
199
- warnings .warn (
200
- 'MessageFactory class is deprecated. Please use '
201
- 'GetMessageClassesForFiles() instead of '
202
- 'MessageFactory.GetMessages(). MessageFactory class '
203
- 'will be removed after 2024.' ,
204
- stacklevel = 2 ,
205
- )
206
- return GetMessageClassesForFiles (files , self .pool )
207
-
208
145
209
146
def GetMessages (file_protos , pool = None ):
210
147
"""Builds a dictionary of all the messages available in a set of files.
0 commit comments