Exemplo n.º 1
0
        import thrift.python.converter
        python_types = importlib.import_module("module.thrift_types")
        return thrift.python.converter.to_python_struct(
            python_types.SecretStruct, self)

    def _to_py3(self):
        import importlib
        import thrift.py3.converter
        py3_types = importlib.import_module("module.types")
        return thrift.py3.converter.to_py3_struct(py3_types.SecretStruct, self)

    def _to_py_deprecated(self):
        return self


MyId = UnimplementedTypedef()
all_structs.append(MyStructNestedAnnotation)
MyStructNestedAnnotation.thrift_spec = (
    None,  # 0
    (
        1,
        TType.STRING,
        'name',
        True,
        None,
        2,
    ),  # 1
)

MyStructNestedAnnotation.thrift_struct_annotations = {}
MyStructNestedAnnotation.thrift_field_annotations = {}
Exemplo n.º 2
0
#  @generated
#

from __future__ import absolute_import
import sys
from thrift.util.Recursive import fix_spec
from thrift.Thrift import TType, TMessageType, TPriority, TRequestContext, TProcessorEventHandler, TServerInterface, TProcessor, TException, TApplicationException, UnimplementedTypedef
from thrift.protocol.TProtocol import TProtocolException

import pprint
import warnings
from thrift import Thrift
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.protocol import TCompactProtocol
from thrift.protocol import THeaderProtocol
fastproto = None
try:
    from thrift.protocol import fastproto
except ImportError:
    pass
all_structs = []
UTF8STRINGS = bool(0) or sys.version_info.major >= 3

__all__ = ['UTF8STRINGS', 'SomeMap', 'SomeListOfTypeMap']

SomeMap = UnimplementedTypedef()
SomeListOfTypeMap = UnimplementedTypedef()
fix_spec(all_structs)
del all_structs
Exemplo n.º 3
0
    return "%s(%s)" % (self.__class__.__name__, "\n" + ",\n".join(L) if L else '')

  def __eq__(self, other):
    if not isinstance(other, self.__class__):
      return False

    return self.__dict__ == other.__dict__ 

  def __ne__(self, other):
    return not (self == other)

  # Override the __hash__ function for Python3 - t10434117
  if not six.PY2:
    __hash__ = object.__hash__

SetWithAdapter = UnimplementedTypedef()
ListWithElemAdapter = UnimplementedTypedef()
StructWithAdapter = my.Adapter2.Type
all_structs.append(Foo)
Foo.thrift_spec = (
  None, # 0
  (1, TType.I32, 'intField', None, None, 2, ), # 1
  (2, TType.I32, 'optionalIntField', None, None, 1, ), # 2
  (3, TType.I32, 'intFieldWithDefault', None, 13, 2, ), # 3
  (4, TType.SET, 'setField', (TType.STRING,True), None, 2, ), # 4
  (5, TType.SET, 'optionalSetField', (TType.STRING,True), None, 1, ), # 5
  (6, TType.MAP, 'mapField', (TType.STRING,True,TType.LIST,(TType.STRING,True)), None, 2, ), # 6
  (7, TType.MAP, 'optionalMapField', (TType.STRING,True,TType.LIST,(TType.STRING,True)), None, 1, ), # 7
)

Foo.thrift_struct_annotations = {
Exemplo n.º 4
0
      u.write(oprot)
      oprot.writeFieldEnd()
    oprot.writeFieldStop()
    oprot.writeUnionEnd()
  
  def __eq__(self, other):
    if not isinstance(other, self.__class__):
      return False

    return self.__dict__ == other.__dict__

  def __ne__(self, other):
    return not (self == other)

MyCompany = Company
MyStringIdentifier = UnimplementedTypedef()
MyIntIdentifier = UnimplementedTypedef()
MyMapIdentifier = UnimplementedTypedef()
all_structs.append(Internship)
Internship.thrift_spec = (
  None, # 0
  (1, TType.I32, 'weeks', None, None, 0, ), # 1
  (2, TType.STRING, 'title', True, None, 2, ), # 2
  (3, TType.I32, 'employer', Company, None, 1, ), # 3
  (4, TType.DOUBLE, 'compensation', None, None, 1, ), # 4
  (5, TType.STRING, 'school', True, None, 1, ), # 5
)

Internship.thrift_struct_annotations = {
}
Internship.thrift_field_annotations = {
Exemplo n.º 5
0
                           "\n" + ",\n".join(L) if L else '')

    def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not (self == other)

    # Override the __hash__ function for Python3 - t10434117
    __hash__ = object.__hash__


IncludedInt64 = UnimplementedTypedef()
TransitiveFoo = transitive.ttypes.Foo
all_structs.append(Included)
Included.thrift_spec = (
    None,  # 0
    (
        1,
        TType.I64,
        'MyIntField',
        None,
        0,
        2,
    ),  # 1
    (
        2,
        TType.STRUCT,