protobuf 5.29.0rc3__py3-none-any.whl → 6.33.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of protobuf might be problematic. Click here for more details.

Files changed (45) hide show
  1. google/protobuf/__init__.py +1 -1
  2. google/protobuf/any.py +15 -1
  3. google/protobuf/any_pb2.py +5 -5
  4. google/protobuf/api_pb2.py +15 -11
  5. google/protobuf/compiler/plugin_pb2.py +5 -5
  6. google/protobuf/descriptor.py +413 -248
  7. google/protobuf/descriptor_database.py +22 -4
  8. google/protobuf/descriptor_pb2.py +320 -120
  9. google/protobuf/descriptor_pool.py +31 -13
  10. google/protobuf/duration_pb2.py +5 -5
  11. google/protobuf/empty_pb2.py +5 -5
  12. google/protobuf/field_mask_pb2.py +5 -5
  13. google/protobuf/internal/api_implementation.py +0 -6
  14. google/protobuf/internal/builder.py +4 -3
  15. google/protobuf/internal/containers.py +13 -0
  16. google/protobuf/internal/decoder.py +163 -133
  17. google/protobuf/internal/extension_dict.py +3 -3
  18. google/protobuf/internal/field_mask.py +6 -4
  19. google/protobuf/internal/python_edition_defaults.py +1 -1
  20. google/protobuf/internal/python_message.py +86 -70
  21. google/protobuf/internal/testing_refleaks.py +11 -2
  22. google/protobuf/internal/type_checkers.py +52 -5
  23. google/protobuf/internal/well_known_types.py +63 -46
  24. google/protobuf/json_format.py +113 -71
  25. google/protobuf/message.py +26 -0
  26. google/protobuf/message_factory.py +16 -63
  27. google/protobuf/proto.py +38 -1
  28. google/protobuf/proto_text.py +129 -0
  29. google/protobuf/reflection.py +0 -49
  30. google/protobuf/runtime_version.py +9 -29
  31. google/protobuf/source_context_pb2.py +5 -5
  32. google/protobuf/struct_pb2.py +5 -5
  33. google/protobuf/symbol_database.py +0 -18
  34. google/protobuf/text_format.py +49 -29
  35. google/protobuf/timestamp_pb2.py +5 -5
  36. google/protobuf/type_pb2.py +5 -5
  37. google/protobuf/unknown_fields.py +3 -4
  38. google/protobuf/wrappers_pb2.py +5 -5
  39. {protobuf-5.29.0rc3.dist-info → protobuf-6.33.3.dist-info}/METADATA +3 -3
  40. protobuf-6.33.3.dist-info/RECORD +58 -0
  41. google/protobuf/internal/_parameterized.py +0 -420
  42. google/protobuf/service.py +0 -213
  43. protobuf-5.29.0rc3.dist-info/RECORD +0 -59
  44. {protobuf-5.29.0rc3.dist-info → protobuf-6.33.3.dist-info}/LICENSE +0 -0
  45. {protobuf-5.29.0rc3.dist-info → protobuf-6.33.3.dist-info}/WHEEL +0 -0
@@ -1,420 +0,0 @@
1
- #! /usr/bin/env python
2
- #
3
- # Protocol Buffers - Google's data interchange format
4
- # Copyright 2008 Google Inc. All rights reserved.
5
- #
6
- # Use of this source code is governed by a BSD-style
7
- # license that can be found in the LICENSE file or at
8
- # https://developers.google.com/open-source/licenses/bsd
9
-
10
- """Adds support for parameterized tests to Python's unittest TestCase class.
11
-
12
- A parameterized test is a method in a test case that is invoked with different
13
- argument tuples.
14
-
15
- A simple example:
16
-
17
- class AdditionExample(_parameterized.TestCase):
18
- @_parameterized.parameters(
19
- (1, 2, 3),
20
- (4, 5, 9),
21
- (1, 1, 3))
22
- def testAddition(self, op1, op2, result):
23
- self.assertEqual(result, op1 + op2)
24
-
25
-
26
- Each invocation is a separate test case and properly isolated just
27
- like a normal test method, with its own setUp/tearDown cycle. In the
28
- example above, there are three separate testcases, one of which will
29
- fail due to an assertion error (1 + 1 != 3).
30
-
31
- Parameters for individual test cases can be tuples (with positional parameters)
32
- or dictionaries (with named parameters):
33
-
34
- class AdditionExample(_parameterized.TestCase):
35
- @_parameterized.parameters(
36
- {'op1': 1, 'op2': 2, 'result': 3},
37
- {'op1': 4, 'op2': 5, 'result': 9},
38
- )
39
- def testAddition(self, op1, op2, result):
40
- self.assertEqual(result, op1 + op2)
41
-
42
- If a parameterized test fails, the error message will show the
43
- original test name (which is modified internally) and the arguments
44
- for the specific invocation, which are part of the string returned by
45
- the shortDescription() method on test cases.
46
-
47
- The id method of the test, used internally by the unittest framework,
48
- is also modified to show the arguments. To make sure that test names
49
- stay the same across several invocations, object representations like
50
-
51
- >>> class Foo(object):
52
- ... pass
53
- >>> repr(Foo())
54
- '<__main__.Foo object at 0x23d8610>'
55
-
56
- are turned into '<__main__.Foo>'. For even more descriptive names,
57
- especially in test logs, you can use the named_parameters decorator. In
58
- this case, only tuples are supported, and the first parameters has to
59
- be a string (or an object that returns an apt name when converted via
60
- str()):
61
-
62
- class NamedExample(_parameterized.TestCase):
63
- @_parameterized.named_parameters(
64
- ('Normal', 'aa', 'aaa', True),
65
- ('EmptyPrefix', '', 'abc', True),
66
- ('BothEmpty', '', '', True))
67
- def testStartsWith(self, prefix, string, result):
68
- self.assertEqual(result, strings.startswith(prefix))
69
-
70
- Named tests also have the benefit that they can be run individually
71
- from the command line:
72
-
73
- $ testmodule.py NamedExample.testStartsWithNormal
74
- .
75
- --------------------------------------------------------------------
76
- Ran 1 test in 0.000s
77
-
78
- OK
79
-
80
- Parameterized Classes
81
- =====================
82
- If invocation arguments are shared across test methods in a single
83
- TestCase class, instead of decorating all test methods
84
- individually, the class itself can be decorated:
85
-
86
- @_parameterized.parameters(
87
- (1, 2, 3)
88
- (4, 5, 9))
89
- class ArithmeticTest(_parameterized.TestCase):
90
- def testAdd(self, arg1, arg2, result):
91
- self.assertEqual(arg1 + arg2, result)
92
-
93
- def testSubtract(self, arg2, arg2, result):
94
- self.assertEqual(result - arg1, arg2)
95
-
96
- Inputs from Iterables
97
- =====================
98
- If parameters should be shared across several test cases, or are dynamically
99
- created from other sources, a single non-tuple iterable can be passed into
100
- the decorator. This iterable will be used to obtain the test cases:
101
-
102
- class AdditionExample(_parameterized.TestCase):
103
- @_parameterized.parameters(
104
- c.op1, c.op2, c.result for c in testcases
105
- )
106
- def testAddition(self, op1, op2, result):
107
- self.assertEqual(result, op1 + op2)
108
-
109
-
110
- Single-Argument Test Methods
111
- ============================
112
- If a test method takes only one argument, the single argument does not need to
113
- be wrapped into a tuple:
114
-
115
- class NegativeNumberExample(_parameterized.TestCase):
116
- @_parameterized.parameters(
117
- -1, -3, -4, -5
118
- )
119
- def testIsNegative(self, arg):
120
- self.assertTrue(IsNegative(arg))
121
- """
122
-
123
- __author__ = 'tmarek@google.com (Torsten Marek)'
124
-
125
- import functools
126
- import re
127
- import types
128
- import unittest
129
- import uuid
130
-
131
- try:
132
- # Since python 3
133
- import collections.abc as collections_abc
134
- except ImportError:
135
- # Won't work after python 3.8
136
- import collections as collections_abc
137
-
138
- ADDR_RE = re.compile(r'\<([a-zA-Z0-9_\-\.]+) object at 0x[a-fA-F0-9]+\>')
139
- _SEPARATOR = uuid.uuid1().hex
140
- _FIRST_ARG = object()
141
- _ARGUMENT_REPR = object()
142
-
143
-
144
- def _CleanRepr(obj):
145
- return ADDR_RE.sub(r'<\1>', repr(obj))
146
-
147
-
148
- # Helper function formerly from the unittest module, removed from it in
149
- # Python 2.7.
150
- def _StrClass(cls):
151
- return '%s.%s' % (cls.__module__, cls.__name__)
152
-
153
-
154
- def _NonStringIterable(obj):
155
- return (isinstance(obj, collections_abc.Iterable) and
156
- not isinstance(obj, str))
157
-
158
-
159
- def _FormatParameterList(testcase_params):
160
- if isinstance(testcase_params, collections_abc.Mapping):
161
- return ', '.join('%s=%s' % (argname, _CleanRepr(value))
162
- for argname, value in testcase_params.items())
163
- elif _NonStringIterable(testcase_params):
164
- return ', '.join(map(_CleanRepr, testcase_params))
165
- else:
166
- return _FormatParameterList((testcase_params,))
167
-
168
-
169
- class _ParameterizedTestIter(object):
170
- """Callable and iterable class for producing new test cases."""
171
-
172
- def __init__(self, test_method, testcases, naming_type):
173
- """Returns concrete test functions for a test and a list of parameters.
174
-
175
- The naming_type is used to determine the name of the concrete
176
- functions as reported by the unittest framework. If naming_type is
177
- _FIRST_ARG, the testcases must be tuples, and the first element must
178
- have a string representation that is a valid Python identifier.
179
-
180
- Args:
181
- test_method: The decorated test method.
182
- testcases: (list of tuple/dict) A list of parameter
183
- tuples/dicts for individual test invocations.
184
- naming_type: The test naming type, either _NAMED or _ARGUMENT_REPR.
185
- """
186
- self._test_method = test_method
187
- self.testcases = testcases
188
- self._naming_type = naming_type
189
-
190
- def __call__(self, *args, **kwargs):
191
- raise RuntimeError('You appear to be running a parameterized test case '
192
- 'without having inherited from parameterized.'
193
- 'TestCase. This is bad because none of '
194
- 'your test cases are actually being run.')
195
-
196
- def __iter__(self):
197
- test_method = self._test_method
198
- naming_type = self._naming_type
199
-
200
- def MakeBoundParamTest(testcase_params):
201
- @functools.wraps(test_method)
202
- def BoundParamTest(self):
203
- if isinstance(testcase_params, collections_abc.Mapping):
204
- test_method(self, **testcase_params)
205
- elif _NonStringIterable(testcase_params):
206
- test_method(self, *testcase_params)
207
- else:
208
- test_method(self, testcase_params)
209
-
210
- if naming_type is _FIRST_ARG:
211
- # Signal the metaclass that the name of the test function is unique
212
- # and descriptive.
213
- BoundParamTest.__x_use_name__ = True
214
- BoundParamTest.__name__ += str(testcase_params[0])
215
- testcase_params = testcase_params[1:]
216
- elif naming_type is _ARGUMENT_REPR:
217
- # __x_extra_id__ is used to pass naming information to the __new__
218
- # method of TestGeneratorMetaclass.
219
- # The metaclass will make sure to create a unique, but nondescriptive
220
- # name for this test.
221
- BoundParamTest.__x_extra_id__ = '(%s)' % (
222
- _FormatParameterList(testcase_params),)
223
- else:
224
- raise RuntimeError('%s is not a valid naming type.' % (naming_type,))
225
-
226
- BoundParamTest.__doc__ = '%s(%s)' % (
227
- BoundParamTest.__name__, _FormatParameterList(testcase_params))
228
- if test_method.__doc__:
229
- BoundParamTest.__doc__ += '\n%s' % (test_method.__doc__,)
230
- return BoundParamTest
231
- return (MakeBoundParamTest(c) for c in self.testcases)
232
-
233
-
234
- def _IsSingletonList(testcases):
235
- """True iff testcases contains only a single non-tuple element."""
236
- return len(testcases) == 1 and not isinstance(testcases[0], tuple)
237
-
238
-
239
- def _ModifyClass(class_object, testcases, naming_type):
240
- assert not getattr(class_object, '_id_suffix', None), (
241
- 'Cannot add parameters to %s,'
242
- ' which already has parameterized methods.' % (class_object,))
243
- class_object._id_suffix = id_suffix = {}
244
- # We change the size of __dict__ while we iterate over it,
245
- # which Python 3.x will complain about, so use copy().
246
- for name, obj in class_object.__dict__.copy().items():
247
- if (name.startswith(unittest.TestLoader.testMethodPrefix)
248
- and isinstance(obj, types.FunctionType)):
249
- delattr(class_object, name)
250
- methods = {}
251
- _UpdateClassDictForParamTestCase(
252
- methods, id_suffix, name,
253
- _ParameterizedTestIter(obj, testcases, naming_type))
254
- for name, meth in methods.items():
255
- setattr(class_object, name, meth)
256
-
257
-
258
- def _ParameterDecorator(naming_type, testcases):
259
- """Implementation of the parameterization decorators.
260
-
261
- Args:
262
- naming_type: The naming type.
263
- testcases: Testcase parameters.
264
-
265
- Returns:
266
- A function for modifying the decorated object.
267
- """
268
- def _Apply(obj):
269
- if isinstance(obj, type):
270
- _ModifyClass(
271
- obj,
272
- list(testcases) if not isinstance(testcases, collections_abc.Sequence)
273
- else testcases,
274
- naming_type)
275
- return obj
276
- else:
277
- return _ParameterizedTestIter(obj, testcases, naming_type)
278
-
279
- if _IsSingletonList(testcases):
280
- assert _NonStringIterable(testcases[0]), (
281
- 'Single parameter argument must be a non-string iterable')
282
- testcases = testcases[0]
283
-
284
- return _Apply
285
-
286
-
287
- def parameters(*testcases): # pylint: disable=invalid-name
288
- """A decorator for creating parameterized tests.
289
-
290
- See the module docstring for a usage example.
291
- Args:
292
- *testcases: Parameters for the decorated method, either a single
293
- iterable, or a list of tuples/dicts/objects (for tests
294
- with only one argument).
295
-
296
- Returns:
297
- A test generator to be handled by TestGeneratorMetaclass.
298
- """
299
- return _ParameterDecorator(_ARGUMENT_REPR, testcases)
300
-
301
-
302
- def named_parameters(*testcases): # pylint: disable=invalid-name
303
- """A decorator for creating parameterized tests.
304
-
305
- See the module docstring for a usage example. The first element of
306
- each parameter tuple should be a string and will be appended to the
307
- name of the test method.
308
-
309
- Args:
310
- *testcases: Parameters for the decorated method, either a single
311
- iterable, or a list of tuples.
312
-
313
- Returns:
314
- A test generator to be handled by TestGeneratorMetaclass.
315
- """
316
- return _ParameterDecorator(_FIRST_ARG, testcases)
317
-
318
-
319
- class TestGeneratorMetaclass(type):
320
- """Metaclass for test cases with test generators.
321
-
322
- A test generator is an iterable in a testcase that produces callables. These
323
- callables must be single-argument methods. These methods are injected into
324
- the class namespace and the original iterable is removed. If the name of the
325
- iterable conforms to the test pattern, the injected methods will be picked
326
- up as tests by the unittest framework.
327
-
328
- In general, it is supposed to be used in conjunction with the
329
- parameters decorator.
330
- """
331
-
332
- def __new__(mcs, class_name, bases, dct):
333
- dct['_id_suffix'] = id_suffix = {}
334
- for name, obj in dct.copy().items():
335
- if (name.startswith(unittest.TestLoader.testMethodPrefix) and
336
- _NonStringIterable(obj)):
337
- iterator = iter(obj)
338
- dct.pop(name)
339
- _UpdateClassDictForParamTestCase(dct, id_suffix, name, iterator)
340
-
341
- return type.__new__(mcs, class_name, bases, dct)
342
-
343
-
344
- def _UpdateClassDictForParamTestCase(dct, id_suffix, name, iterator):
345
- """Adds individual test cases to a dictionary.
346
-
347
- Args:
348
- dct: The target dictionary.
349
- id_suffix: The dictionary for mapping names to test IDs.
350
- name: The original name of the test case.
351
- iterator: The iterator generating the individual test cases.
352
- """
353
- for idx, func in enumerate(iterator):
354
- assert callable(func), 'Test generators must yield callables, got %r' % (
355
- func,)
356
- if getattr(func, '__x_use_name__', False):
357
- new_name = func.__name__
358
- else:
359
- new_name = '%s%s%d' % (name, _SEPARATOR, idx)
360
- assert new_name not in dct, (
361
- 'Name of parameterized test case "%s" not unique' % (new_name,))
362
- dct[new_name] = func
363
- id_suffix[new_name] = getattr(func, '__x_extra_id__', '')
364
-
365
-
366
- class TestCase(unittest.TestCase, metaclass=TestGeneratorMetaclass):
367
- """Base class for test cases using the parameters decorator."""
368
-
369
- def _OriginalName(self):
370
- return self._testMethodName.split(_SEPARATOR)[0]
371
-
372
- def __str__(self):
373
- return '%s (%s)' % (self._OriginalName(), _StrClass(self.__class__))
374
-
375
- def id(self): # pylint: disable=invalid-name
376
- """Returns the descriptive ID of the test.
377
-
378
- This is used internally by the unittesting framework to get a name
379
- for the test to be used in reports.
380
-
381
- Returns:
382
- The test id.
383
- """
384
- return '%s.%s%s' % (_StrClass(self.__class__),
385
- self._OriginalName(),
386
- self._id_suffix.get(self._testMethodName, ''))
387
-
388
-
389
- def CoopTestCase(other_base_class):
390
- """Returns a new base class with a cooperative metaclass base.
391
-
392
- This enables the TestCase to be used in combination
393
- with other base classes that have custom metaclasses, such as
394
- mox.MoxTestBase.
395
-
396
- Only works with metaclasses that do not override type.__new__.
397
-
398
- Example:
399
-
400
- import google3
401
- import mox
402
-
403
- from google.protobuf.internal import _parameterized
404
-
405
- class ExampleTest(parameterized.CoopTestCase(mox.MoxTestBase)):
406
- ...
407
-
408
- Args:
409
- other_base_class: (class) A test case base class.
410
-
411
- Returns:
412
- A new class object.
413
- """
414
- metaclass = type(
415
- 'CoopMetaclass',
416
- (other_base_class.__metaclass__,
417
- TestGeneratorMetaclass), {})
418
- return metaclass(
419
- 'CoopTestCase',
420
- (other_base_class, TestCase), {})
@@ -1,213 +0,0 @@
1
- # Protocol Buffers - Google's data interchange format
2
- # Copyright 2008 Google Inc. All rights reserved.
3
- #
4
- # Use of this source code is governed by a BSD-style
5
- # license that can be found in the LICENSE file or at
6
- # https://developers.google.com/open-source/licenses/bsd
7
-
8
- """DEPRECATED: Declares the RPC service interfaces.
9
-
10
- This module declares the abstract interfaces underlying proto2 RPC
11
- services. These are intended to be independent of any particular RPC
12
- implementation, so that proto2 services can be used on top of a variety
13
- of implementations. Starting with version 2.3.0, RPC implementations should
14
- not try to build on these, but should instead provide code generator plugins
15
- which generate code specific to the particular RPC implementation. This way
16
- the generated code can be more appropriate for the implementation in use
17
- and can avoid unnecessary layers of indirection.
18
- """
19
-
20
- __author__ = 'petar@google.com (Petar Petrov)'
21
-
22
- import warnings
23
-
24
- warnings.warn(
25
- 'google.protobuf.service module is deprecated. RPC implementations '
26
- 'should provide code generator plugins which generate code specific to '
27
- 'the RPC implementation. service.py will be removed in Jan 2025',
28
- stacklevel=2,
29
- )
30
-
31
- class RpcException(Exception):
32
- """Exception raised on failed blocking RPC method call."""
33
- pass
34
-
35
-
36
- class Service(object):
37
-
38
- """Abstract base interface for protocol-buffer-based RPC services.
39
-
40
- Services themselves are abstract classes (implemented either by servers or as
41
- stubs), but they subclass this base interface. The methods of this
42
- interface can be used to call the methods of the service without knowing
43
- its exact type at compile time (analogous to the Message interface).
44
- """
45
-
46
- def GetDescriptor():
47
- """Retrieves this service's descriptor."""
48
- raise NotImplementedError
49
-
50
- def CallMethod(self, method_descriptor, rpc_controller,
51
- request, done):
52
- """Calls a method of the service specified by method_descriptor.
53
-
54
- If "done" is None then the call is blocking and the response
55
- message will be returned directly. Otherwise the call is asynchronous
56
- and "done" will later be called with the response value.
57
-
58
- In the blocking case, RpcException will be raised on error.
59
-
60
- Preconditions:
61
-
62
- * method_descriptor.service == GetDescriptor
63
- * request is of the exact same classes as returned by
64
- GetRequestClass(method).
65
- * After the call has started, the request must not be modified.
66
- * "rpc_controller" is of the correct type for the RPC implementation being
67
- used by this Service. For stubs, the "correct type" depends on the
68
- RpcChannel which the stub is using.
69
-
70
- Postconditions:
71
-
72
- * "done" will be called when the method is complete. This may be
73
- before CallMethod() returns or it may be at some point in the future.
74
- * If the RPC failed, the response value passed to "done" will be None.
75
- Further details about the failure can be found by querying the
76
- RpcController.
77
- """
78
- raise NotImplementedError
79
-
80
- def GetRequestClass(self, method_descriptor):
81
- """Returns the class of the request message for the specified method.
82
-
83
- CallMethod() requires that the request is of a particular subclass of
84
- Message. GetRequestClass() gets the default instance of this required
85
- type.
86
-
87
- Example:
88
- method = service.GetDescriptor().FindMethodByName("Foo")
89
- request = stub.GetRequestClass(method)()
90
- request.ParseFromString(input)
91
- service.CallMethod(method, request, callback)
92
- """
93
- raise NotImplementedError
94
-
95
- def GetResponseClass(self, method_descriptor):
96
- """Returns the class of the response message for the specified method.
97
-
98
- This method isn't really needed, as the RpcChannel's CallMethod constructs
99
- the response protocol message. It's provided anyway in case it is useful
100
- for the caller to know the response type in advance.
101
- """
102
- raise NotImplementedError
103
-
104
-
105
- class RpcController(object):
106
-
107
- """An RpcController mediates a single method call.
108
-
109
- The primary purpose of the controller is to provide a way to manipulate
110
- settings specific to the RPC implementation and to find out about RPC-level
111
- errors. The methods provided by the RpcController interface are intended
112
- to be a "least common denominator" set of features which we expect all
113
- implementations to support. Specific implementations may provide more
114
- advanced features (e.g. deadline propagation).
115
- """
116
-
117
- # Client-side methods below
118
-
119
- def Reset(self):
120
- """Resets the RpcController to its initial state.
121
-
122
- After the RpcController has been reset, it may be reused in
123
- a new call. Must not be called while an RPC is in progress.
124
- """
125
- raise NotImplementedError
126
-
127
- def Failed(self):
128
- """Returns true if the call failed.
129
-
130
- After a call has finished, returns true if the call failed. The possible
131
- reasons for failure depend on the RPC implementation. Failed() must not
132
- be called before a call has finished. If Failed() returns true, the
133
- contents of the response message are undefined.
134
- """
135
- raise NotImplementedError
136
-
137
- def ErrorText(self):
138
- """If Failed is true, returns a human-readable description of the error."""
139
- raise NotImplementedError
140
-
141
- def StartCancel(self):
142
- """Initiate cancellation.
143
-
144
- Advises the RPC system that the caller desires that the RPC call be
145
- canceled. The RPC system may cancel it immediately, may wait awhile and
146
- then cancel it, or may not even cancel the call at all. If the call is
147
- canceled, the "done" callback will still be called and the RpcController
148
- will indicate that the call failed at that time.
149
- """
150
- raise NotImplementedError
151
-
152
- # Server-side methods below
153
-
154
- def SetFailed(self, reason):
155
- """Sets a failure reason.
156
-
157
- Causes Failed() to return true on the client side. "reason" will be
158
- incorporated into the message returned by ErrorText(). If you find
159
- you need to return machine-readable information about failures, you
160
- should incorporate it into your response protocol buffer and should
161
- NOT call SetFailed().
162
- """
163
- raise NotImplementedError
164
-
165
- def IsCanceled(self):
166
- """Checks if the client cancelled the RPC.
167
-
168
- If true, indicates that the client canceled the RPC, so the server may
169
- as well give up on replying to it. The server should still call the
170
- final "done" callback.
171
- """
172
- raise NotImplementedError
173
-
174
- def NotifyOnCancel(self, callback):
175
- """Sets a callback to invoke on cancel.
176
-
177
- Asks that the given callback be called when the RPC is canceled. The
178
- callback will always be called exactly once. If the RPC completes without
179
- being canceled, the callback will be called after completion. If the RPC
180
- has already been canceled when NotifyOnCancel() is called, the callback
181
- will be called immediately.
182
-
183
- NotifyOnCancel() must be called no more than once per request.
184
- """
185
- raise NotImplementedError
186
-
187
-
188
- class RpcChannel(object):
189
-
190
- """Abstract interface for an RPC channel.
191
-
192
- An RpcChannel represents a communication line to a service which can be used
193
- to call that service's methods. The service may be running on another
194
- machine. Normally, you should not use an RpcChannel directly, but instead
195
- construct a stub {@link Service} wrapping it. Example:
196
-
197
- Example:
198
- RpcChannel channel = rpcImpl.Channel("remotehost.example.com:1234")
199
- RpcController controller = rpcImpl.Controller()
200
- MyService service = MyService_Stub(channel)
201
- service.MyMethod(controller, request, callback)
202
- """
203
-
204
- def CallMethod(self, method_descriptor, rpc_controller,
205
- request, response_class, done):
206
- """Calls the method identified by the descriptor.
207
-
208
- Call the given method of the remote service. The signature of this
209
- procedure looks the same as Service.CallMethod(), but the requirements
210
- are less strict in one important way: the request object doesn't have to
211
- be of any specific class as long as its descriptor is method.input_type.
212
- """
213
- raise NotImplementedError
@@ -1,59 +0,0 @@
1
- google/protobuf/__init__.py,sha256=dA8ohNES_Wq_IuYUaH14I_EQ-_PWbhFxNSk8PXmfxhs,349
2
- google/protobuf/any.py,sha256=AZuOL26Bo8AFFUjHLhh_OQP2ceUJEgOUTqImjxXAJkc,975
3
- google/protobuf/compiler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- google/protobuf/descriptor.py,sha256=xM9LaJQJbyt0fxMdJwZdSzCS8tZK4LvHw5Yd2F9KgKU,52253
5
- google/protobuf/descriptor_database.py,sha256=GDiSu-vBZBZ-L1YHQXSTsbsJMRNY-20icb6pj3ER8E8,5444
6
- google/protobuf/descriptor_pool.py,sha256=DA5XTv-jmRCJ1O4b_Yswg93KzmFpzaWOPofRGzhXeBY,48430
7
- google/protobuf/duration.py,sha256=vQTwVyiiyGm3Wy3LW8ohA3tkGkrUKoTn_p4SdEBU8bM,2672
8
- google/protobuf/internal/__init__.py,sha256=8d_k1ksNWIuqPDEEEtOjgC3Xx8kAXD2-04R7mxJlSbs,272
9
- google/protobuf/internal/_parameterized.py,sha256=_LLIH2kmUrI1hZfUlIF8OBcBbbQXgRnm39uB9TpzaHU,14073
10
- google/protobuf/internal/api_implementation.py,sha256=Qnq9L9thCvgdxlhnGsaNrSCVXmMq_wCZ7-ooRNLVtzs,4787
11
- google/protobuf/internal/builder.py,sha256=2veSGrr1WphCBOGE3wNXKbVPBkY1-LlSCsKOQH2Nudk,4015
12
- google/protobuf/internal/containers.py,sha256=CQ0R54YddBf2uWnDqMUnaevr79BdBb1fYM33qsnYSxY,21722
13
- google/protobuf/internal/decoder.py,sha256=7nDfjyHd67pwky4hNyO_gZKm0IggiAkHF2IfUlO_gMY,36727
14
- google/protobuf/internal/encoder.py,sha256=Vujp3bU10dLBasUnRaGZKD-ZTLq7zEGA8wKh7mVLR-g,27297
15
- google/protobuf/internal/enum_type_wrapper.py,sha256=PNhK87a_NP1JIfFHuYFibpE4hHdHYawXwqZxMEtvsvo,3747
16
- google/protobuf/internal/extension_dict.py,sha256=7bT-5iqa_qw4wkk3QNtCPzGlfPU2h9FDyc5TjF2wiTo,7225
17
- google/protobuf/internal/field_mask.py,sha256=Ek2eDU8mY1Shj-V2wRmOggXummBv_brbL3XOEVFR6c0,10416
18
- google/protobuf/internal/message_listener.py,sha256=uh8viU_MvWdDe4Kl14CromKVFAzBMPlMzFZ4vew_UJc,2008
19
- google/protobuf/internal/python_edition_defaults.py,sha256=72ruAhyM3WEiE8I29ZJZIRp_dOLJoZuBDedecOAW7aQ,434
20
- google/protobuf/internal/python_message.py,sha256=GkE2xJ3KuVKA3jZonHTgaxOijVzPSQdHMZQTfH10Xzk,58179
21
- google/protobuf/internal/testing_refleaks.py,sha256=Pp-e8isZv-IwZDOzPaLo9WujUXj_XghNrbV-rHswvL4,4080
22
- google/protobuf/internal/type_checkers.py,sha256=1W7k9lfyeWML2Hl461xGsKCFJiN63uKBT6vyIKKz9go,15471
23
- google/protobuf/internal/well_known_types.py,sha256=dv8F2oJXfU2hlBaVbfJ3bWs97bEm1FfKzWHr1-nazSM,22705
24
- google/protobuf/internal/wire_format.py,sha256=EbAXZdb23iCObCZxNgaMx8-VRF2UjgyPrBCTtV10Rx8,7087
25
- google/protobuf/json_format.py,sha256=d-27JdC0vA_-A1V3yTuRqR70e4xuXUHy3nbJWs-oLc8,37260
26
- google/protobuf/message.py,sha256=usc6ma5tUR66le_XDFC6ce7VRX3VvQlrRFCvjshxI-k,14042
27
- google/protobuf/message_factory.py,sha256=hsMGMC6BJ3ik5vjGGeIG57WLInAf1Vt8G1528XKBprc,8262
28
- google/protobuf/proto.py,sha256=R-vAuadXJgPhWCeU9nHOQPmAlCvAgnkHIny7DzkkyXo,3500
29
- google/protobuf/proto_builder.py,sha256=pGU2L_pPEYkylZkrvHMCUH2PFWvc9wI-awwT7F5i740,4203
30
- google/protobuf/proto_json.py,sha256=fUy0Vb4m_831-oabn7JbzmyipcoJpQWtBdgTMoj8Yp4,3094
31
- google/protobuf/pyext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
- google/protobuf/pyext/cpp_message.py,sha256=8uSrWX9kD3HPRhntvTPc4bgnfQ2BzX9FPC73CgifXAw,1715
33
- google/protobuf/reflection.py,sha256=aC4b3fcWr0rYi9DAk29dX3-WW0QxrRUOErzUOywxjsg,2893
34
- google/protobuf/runtime_version.py,sha256=JP2SWIGqBuZcit6jFuc4xaBkbehPuM9HHm8kUdOIiG4,3915
35
- google/protobuf/service.py,sha256=kUIqNfRgjGawY_Pcotc3DoS56tALMxHzqUUFNd-nn7w,8055
36
- google/protobuf/service_reflection.py,sha256=WHElGnPgywDtn3X8xKVNsZZOCgJOTzgpAyTd-rmCKGU,10058
37
- google/protobuf/symbol_database.py,sha256=ruKrtrkuxmFe7uzbJGMgOD7D6Qs2g6jFIRC3aS9NNvU,6709
38
- google/protobuf/testdata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- google/protobuf/text_encoding.py,sha256=Ao1Q6OP8i4p8VDtvpe8uW1BjX7aQZvkJggvhFYYrB7w,3621
40
- google/protobuf/text_format.py,sha256=L-gxTX1L6OEHoVNuFJI2Qtp5QQvsYkJkedCNMtsm55M,63477
41
- google/protobuf/timestamp.py,sha256=s23LWq6hDiFIeAtVUn8LwfEc5aRM7WAwTz_hCaOVndk,3133
42
- google/protobuf/unknown_fields.py,sha256=RVMDxyiZcObbb40dMK-xXCAvc5pkyLNSL1y2qzPAUbA,3127
43
- google/protobuf/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
- google/protobuf/any_pb2.py,sha256=2vHRgDWJHsYaqzt-Bwq9rJg05RRQNJo9fcTbPsadSw0,1733
45
- google/protobuf/api_pb2.py,sha256=7M_tA6dRw-q7QhbmtgJgCvbvD76blI3pgJGCHuYlM4k,3153
46
- google/protobuf/compiler/plugin_pb2.py,sha256=6HDiNDYcHsNbS7sDzUvLGA2UsBpA4h9MZzKUvWa_NNk,3805
47
- google/protobuf/descriptor_pb2.py,sha256=ShmYu2_bpA98eLQ0l_fbfYRpkXsL2blnsFUI28Ccxpo,343373
48
- google/protobuf/duration_pb2.py,sha256=AWdp7NZBhL40Lt3wxjDe1VDP1nHneaYK3onmdrcz-0g,1813
49
- google/protobuf/empty_pb2.py,sha256=WizuylUoDsq-ho7Qsf6fY6HNUh_sHP84vxDzEkQoi_M,1677
50
- google/protobuf/field_mask_pb2.py,sha256=NlRHTo9CM634I0J9CMF5GjEJx5_6QJcivXf_pavybnQ,1773
51
- google/protobuf/source_context_pb2.py,sha256=S85tavbFPhCRXOLX1v1hDj96lNN-zzBNlzMXSFq9pqw,1799
52
- google/protobuf/struct_pb2.py,sha256=FNehFdlTaTtx6lkBEDtKuBbCjT573XGXQiD-ZPjtfYo,3069
53
- google/protobuf/timestamp_pb2.py,sha256=yWOLOkHlkB3xtsQlkO2IT0Q_fvVxRalUXzPqVM8UIlY,1823
54
- google/protobuf/type_pb2.py,sha256=l2j03ApBu0OXUMNTeVOoVJoCmrdpu5VPdIvoVGrkTB0,5446
55
- google/protobuf/wrappers_pb2.py,sha256=SBnRbn3w4382f_Bk0TnBYbn8hcMM8yq4Z5fFE2TZzYI,3045
56
- protobuf-5.29.0rc3.dist-info/WHEEL,sha256=sobxWSyDDkdg_rinUth-jxhXHqoNqlmNMJY3aTZn2Us,91
57
- protobuf-5.29.0rc3.dist-info/METADATA,sha256=q_5JDiIVT8dUedzZKbu7yIwEEdbT9FoX7xemeJPWOow,595
58
- protobuf-5.29.0rc3.dist-info/LICENSE,sha256=bl4RcySv2UTc9n82zzKYQ7wakiKajNm7Vz16gxMP6n0,1732
59
- protobuf-5.29.0rc3.dist-info/RECORD,,