#!/usr/bin/env python # # Autogenerated by Thrift # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # @generated # from __future__ import print_function from __future__ import absolute_import import os import sys if (not sys.argv[0].endswith("par") and not sys.argv[0].endswith("xar") and os.getenv('PAR_UNPACK_TMP') == None): f = open(sys.argv[0], "r") f.readline() # This will be #!/bin/bash line = f.readline() f.close() # The par generator tool always has '# This par was made' as the # second line. See fbcode/tools/make_par/make_par.py if (not line.startswith('# This par was made')): print("""WARNING You are trying to run *-remote.py which is incorrect as the paths are not set up correctly. Instead, you should generate your thrift file with thrift_library and then run the resulting *-remote.par. For more information, please read http://fburl.com/python-remotes""") exit() from . import MyService from . import ttypes from thrift.util.remote import Function from thrift.remote import Remote FUNCTIONS = { 'ping': Function('ping', 'MyService', 'void', []), 'getRandomData': Function('getRandomData', 'MyService', 'string', []), 'sink': Function('sink', 'MyService', 'void', [('i64', 'sink', 'i64')]), 'putDataById': Function('putDataById', 'MyService', 'void', [('i64', 'id', 'i64'), ('string', 'data', 'string')]), 'hasDataById': Function('hasDataById', 'MyService', 'bool', [('i64', 'id', 'i64')]), 'getDataById': Function('getDataById', 'MyService', 'string', [('i64', 'id', 'i64')]), 'deleteDataById': Function('deleteDataById', 'MyService', 'void', [('i64', 'id', 'i64')]), 'lobDataById': Function('lobDataById', 'MyService', None, [('i64', 'id', 'i64'), ('string', 'data', 'string')]), 'invalid_return_for_hack': Function('invalid_return_for_hack', 'MyService', 'set', []), 'rpc_skipped_codegen': Function('rpc_skipped_codegen', 'MyService', 'void', []), } SERVICE_NAMES = ['MyService', ] if __name__ == '__main__': Remote.run(FUNCTIONS, SERVICE_NAMES, MyService, ttypes, sys.argv, default_port=9090)