mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Finally rid of capital Sirupsen??
This commit is contained in:
@@ -2820,6 +2820,8 @@ void t_csharp_generator::generate_csharp_property(ofstream& out,
|
||||
}
|
||||
if (ttype->is_base_type()) {
|
||||
use_nullable = ((t_base_type*)ttype)->get_base() != t_base_type::TYPE_STRING;
|
||||
} else if (ttype->is_enum()) {
|
||||
use_nullable = true;
|
||||
}
|
||||
}
|
||||
indent(out) << "return " << fieldPrefix + tfield->get_name() << ";" << endl;
|
||||
|
||||
74
vendor/github.com/apache/thrift/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
generated
vendored
74
vendor/github.com/apache/thrift/compiler/cpp/src/thrift/generate/t_delphi_generator.cc
generated
vendored
@@ -2023,13 +2023,13 @@ void t_delphi_generator::generate_service_client(t_service* tservice) {
|
||||
indent_impl(s_service_impl) << "var" << endl;
|
||||
indent_up_impl();
|
||||
indent_impl(s_service_impl) << argsvar << " : " << args_intfnm << ";" << endl;
|
||||
indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.IMessage;" << endl;
|
||||
indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.TThriftMessage;" << endl;
|
||||
indent_down_impl();
|
||||
indent_impl(s_service_impl) << "begin" << endl;
|
||||
indent_up_impl();
|
||||
|
||||
indent_impl(s_service_impl) << "seqid_ := seqid_ + 1;" << endl;
|
||||
indent_impl(s_service_impl) << msgvar << " := Thrift.Protocol.TMessageImpl.Create('" << funname
|
||||
indent_impl(s_service_impl) << "Thrift.Protocol.Init( " << msgvar << ", '" << funname
|
||||
<< "', " << ((*f_iter)->is_oneway() ? "TMessageType.Oneway"
|
||||
: "TMessageType.Call")
|
||||
<< ", seqid_);" << endl;
|
||||
@@ -2076,7 +2076,7 @@ void t_delphi_generator::generate_service_client(t_service* tservice) {
|
||||
indent_impl(s_service_impl) << function_signature(&recv_function, full_cls) << endl;
|
||||
indent_impl(s_service_impl) << "var" << endl;
|
||||
indent_up_impl();
|
||||
indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.IMessage;" << endl;
|
||||
indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.TThriftMessage;" << endl;
|
||||
if (xceptions.size() > 0) {
|
||||
indent_impl(s_service_impl) << exceptvar << " : Exception;" << endl;
|
||||
}
|
||||
@@ -2234,7 +2234,7 @@ void t_delphi_generator::generate_service_server(t_service* tservice) {
|
||||
;
|
||||
indent_impl(s_service_impl) << "var" << endl;
|
||||
indent_up_impl();
|
||||
indent_impl(s_service_impl) << "msg : Thrift.Protocol.IMessage;" << endl;
|
||||
indent_impl(s_service_impl) << "msg : Thrift.Protocol.TThriftMessage;" << endl;
|
||||
indent_impl(s_service_impl) << "fn : TProcessFunction;" << endl;
|
||||
indent_impl(s_service_impl) << "x : TApplicationException;" << endl;
|
||||
if (events_) {
|
||||
@@ -2257,7 +2257,7 @@ void t_delphi_generator::generate_service_server(t_service* tservice) {
|
||||
"TApplicationExceptionUnknownMethod.Create("
|
||||
"'Invalid method name: ''' + msg.Name + '''');" << endl;
|
||||
indent_impl(s_service_impl)
|
||||
<< "msg := Thrift.Protocol.TMessageImpl.Create(msg.Name, TMessageType.Exception, msg.SeqID);"
|
||||
<< "Thrift.Protocol.Init( msg, msg.Name, TMessageType.Exception, msg.SeqID);"
|
||||
<< endl;
|
||||
indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg);" << endl;
|
||||
indent_impl(s_service_impl) << "x.Write(oprot);" << endl;
|
||||
@@ -2373,7 +2373,7 @@ void t_delphi_generator::generate_process_function(t_service* tservice, t_functi
|
||||
indent_up_impl();
|
||||
indent_impl(s_service_impl) << "args: " << args_intfnm << ";" << endl;
|
||||
if (!tfunction->is_oneway()) {
|
||||
indent_impl(s_service_impl) << "msg: Thrift.Protocol.IMessage;" << endl;
|
||||
indent_impl(s_service_impl) << "msg: Thrift.Protocol.TThriftMessage;" << endl;
|
||||
indent_impl(s_service_impl) << "ret: " << result_intfnm << ";" << endl;
|
||||
indent_impl(s_service_impl) << "appx : TApplicationException;" << endl;
|
||||
}
|
||||
@@ -2459,7 +2459,7 @@ void t_delphi_generator::generate_process_function(t_service* tservice, t_functi
|
||||
if(events_) {
|
||||
indent_impl(s_service_impl) << "if events <> nil then events.PreWrite;" << endl;
|
||||
}
|
||||
indent_impl(s_service_impl) << "msg := Thrift.Protocol.TMessageImpl.Create('"
|
||||
indent_impl(s_service_impl) << "Thrift.Protocol.Init( msg, '"
|
||||
<< tfunction->get_name() << "', TMessageType.Exception, seqid);"
|
||||
<< endl;
|
||||
indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg);" << endl;
|
||||
@@ -2487,7 +2487,7 @@ void t_delphi_generator::generate_process_function(t_service* tservice, t_functi
|
||||
if (events_) {
|
||||
indent_impl(s_service_impl) << "if events <> nil then events.PreWrite;" << endl;
|
||||
}
|
||||
indent_impl(s_service_impl) << "msg := Thrift.Protocol.TMessageImpl.Create('"
|
||||
indent_impl(s_service_impl) << "Thrift.Protocol.Init( msg, '"
|
||||
<< tfunction->get_name() << "', TMessageType.Reply, seqid); "
|
||||
<< endl;
|
||||
indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg); " << endl;
|
||||
@@ -2619,11 +2619,11 @@ void t_delphi_generator::generate_deserialize_container(ostream& out,
|
||||
}
|
||||
|
||||
if (ttype->is_map()) {
|
||||
local_var = obj + ": IMap;";
|
||||
local_var = obj + ": TThriftMap;";
|
||||
} else if (ttype->is_set()) {
|
||||
local_var = obj + ": ISet;";
|
||||
local_var = obj + ": TThriftSet;";
|
||||
} else if (ttype->is_list()) {
|
||||
local_var = obj + ": IList;";
|
||||
local_var = obj + ": TThriftList;";
|
||||
}
|
||||
local_vars << " " << local_var << endl;
|
||||
counter = tmp("_i");
|
||||
@@ -2803,23 +2803,23 @@ void t_delphi_generator::generate_serialize_container(ostream& out,
|
||||
string obj;
|
||||
if (ttype->is_map()) {
|
||||
obj = tmp("map");
|
||||
local_vars << " " << obj << " : IMap;" << endl;
|
||||
indent_impl(out) << obj << " := TMapImpl.Create( "
|
||||
local_vars << " " << obj << " : TThriftMap;" << endl;
|
||||
indent_impl(out) << "Thrift.Protocol.Init( " << obj << ", "
|
||||
<< type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
|
||||
<< type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << prefix
|
||||
<< ".Count);" << endl;
|
||||
indent_impl(out) << "oprot.WriteMapBegin( " << obj << ");" << endl;
|
||||
} else if (ttype->is_set()) {
|
||||
obj = tmp("set_");
|
||||
local_vars << " " << obj << " : ISet;" << endl;
|
||||
indent_impl(out) << obj << " := TSetImpl.Create("
|
||||
local_vars << " " << obj << " : TThriftSet;" << endl;
|
||||
indent_impl(out) << "Thrift.Protocol.Init( " << obj << ", "
|
||||
<< type_to_enum(((t_set*)ttype)->get_elem_type()) << ", " << prefix
|
||||
<< ".Count);" << endl;
|
||||
indent_impl(out) << "oprot.WriteSetBegin( " << obj << ");" << endl;
|
||||
} else if (ttype->is_list()) {
|
||||
obj = tmp("list_");
|
||||
local_vars << " " << obj << " : IList;" << endl;
|
||||
indent_impl(out) << obj << " := TListImpl.Create("
|
||||
local_vars << " " << obj << " : TThriftList;" << endl;
|
||||
indent_impl(out) << "Thrift.Protocol.Init( " << obj << ", "
|
||||
<< type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << prefix
|
||||
<< ".Count);" << endl;
|
||||
indent_impl(out) << "oprot.WriteListBegin( " << obj << ");" << endl;
|
||||
@@ -3548,7 +3548,7 @@ void t_delphi_generator::generate_delphi_struct_reader_impl(ostream& out,
|
||||
<< ") then begin" << endl;
|
||||
indent_up_impl();
|
||||
|
||||
generate_deserialize_field(code_block, is_exception, *f_iter, "", local_vars);
|
||||
generate_deserialize_field(code_block, is_exception, *f_iter, "Self.", local_vars);
|
||||
|
||||
// required field?
|
||||
if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
|
||||
@@ -3617,8 +3617,8 @@ void t_delphi_generator::generate_delphi_struct_reader_impl(ostream& out,
|
||||
<< endl;
|
||||
indent_impl(out) << "var" << endl;
|
||||
indent_up_impl();
|
||||
indent_impl(out) << "field_ : IField;" << endl;
|
||||
indent_impl(out) << "struc : IStruct;" << endl;
|
||||
indent_impl(out) << "field_ : TThriftField;" << endl;
|
||||
indent_impl(out) << "struc : TThriftStruct;" << endl;
|
||||
indent_down_impl();
|
||||
out << local_vars.str() << endl;
|
||||
out << code_block.str();
|
||||
@@ -3642,11 +3642,11 @@ void t_delphi_generator::generate_delphi_struct_result_writer_impl(ostream& out,
|
||||
indent_impl(local_vars) << "tracker : IProtocolRecursionTracker;" << endl;
|
||||
indent_impl(code_block) << "tracker := oprot.NextRecursionLevel;" << endl;
|
||||
|
||||
indent_impl(code_block) << "struc := TStructImpl.Create('" << name << "');" << endl;
|
||||
indent_impl(code_block) << "Thrift.Protocol.Init( struc, '" << name << "');" << endl;
|
||||
indent_impl(code_block) << "oprot.WriteStructBegin(struc);" << endl;
|
||||
|
||||
if (fields.size() > 0) {
|
||||
indent_impl(code_block) << "field_ := TFieldImpl.Create;" << endl;
|
||||
indent_impl(code_block) << "Thrift.Protocol.Init( field_);" << endl;
|
||||
for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
|
||||
indent_impl(code_block) << "if (__isset_" << prop_name(*f_iter, is_exception) << ") then"
|
||||
<< endl;
|
||||
@@ -3657,7 +3657,7 @@ void t_delphi_generator::generate_delphi_struct_result_writer_impl(ostream& out,
|
||||
<< endl;
|
||||
indent_impl(code_block) << "field_.ID := " << (*f_iter)->get_key() << ";" << endl;
|
||||
indent_impl(code_block) << "oprot.WriteFieldBegin(field_);" << endl;
|
||||
generate_serialize_field(code_block, is_exception, *f_iter, "", local_vars);
|
||||
generate_serialize_field(code_block, is_exception, *f_iter, "Self.", local_vars);
|
||||
indent_impl(code_block) << "oprot.WriteFieldEnd();" << endl;
|
||||
indent_down_impl();
|
||||
}
|
||||
@@ -3677,10 +3677,10 @@ void t_delphi_generator::generate_delphi_struct_result_writer_impl(ostream& out,
|
||||
<< endl;
|
||||
indent_impl(out) << "var" << endl;
|
||||
indent_up_impl();
|
||||
indent_impl(out) << "struc : IStruct;" << endl;
|
||||
indent_impl(out) << "struc : TThriftStruct;" << endl;
|
||||
|
||||
if (fields.size() > 0) {
|
||||
indent_impl(out) << "field_ : IField;" << endl;
|
||||
indent_impl(out) << "field_ : TThriftField;" << endl;
|
||||
}
|
||||
|
||||
out << local_vars.str();
|
||||
@@ -3706,11 +3706,11 @@ void t_delphi_generator::generate_delphi_struct_writer_impl(ostream& out,
|
||||
indent_impl(local_vars) << "tracker : IProtocolRecursionTracker;" << endl;
|
||||
indent_impl(code_block) << "tracker := oprot.NextRecursionLevel;" << endl;
|
||||
|
||||
indent_impl(code_block) << "struc := TStructImpl.Create('" << name << "');" << endl;
|
||||
indent_impl(code_block) << "Thrift.Protocol.Init( struc, '" << name << "');" << endl;
|
||||
indent_impl(code_block) << "oprot.WriteStructBegin(struc);" << endl;
|
||||
|
||||
if (fields.size() > 0) {
|
||||
indent_impl(code_block) << "field_ := TFieldImpl.Create;" << endl;
|
||||
indent_impl(code_block) << "Thrift.Protocol.Init( field_);" << endl;
|
||||
}
|
||||
|
||||
for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
|
||||
@@ -3720,13 +3720,13 @@ void t_delphi_generator::generate_delphi_struct_writer_impl(ostream& out,
|
||||
bool has_isset = (!is_required);
|
||||
if (is_required && null_allowed) {
|
||||
null_allowed = false;
|
||||
indent_impl(code_block) << "if (" << fieldname << " = nil)" << endl;
|
||||
indent_impl(code_block) << "if (Self." << fieldname << " = nil)" << endl;
|
||||
indent_impl(code_block) << "then raise TProtocolExceptionInvalidData.Create("
|
||||
<< "'required field " << fieldname << " not set');"
|
||||
<< endl;
|
||||
}
|
||||
if (null_allowed) {
|
||||
indent_impl(code_block) << "if (" << fieldname << " <> nil)";
|
||||
indent_impl(code_block) << "if (Self." << fieldname << " <> nil)";
|
||||
if (has_isset) {
|
||||
code_block << " and __isset_" << fieldname;
|
||||
}
|
||||
@@ -3743,7 +3743,7 @@ void t_delphi_generator::generate_delphi_struct_writer_impl(ostream& out,
|
||||
<< endl;
|
||||
indent_impl(code_block) << "field_.ID := " << (*f_iter)->get_key() << ";" << endl;
|
||||
indent_impl(code_block) << "oprot.WriteFieldBegin(field_);" << endl;
|
||||
generate_serialize_field(code_block, is_exception, *f_iter, "", local_vars);
|
||||
generate_serialize_field(code_block, is_exception, *f_iter, "Self.", local_vars);
|
||||
indent_impl(code_block) << "oprot.WriteFieldEnd();" << endl;
|
||||
if (null_allowed || has_isset) {
|
||||
indent_down_impl();
|
||||
@@ -3765,9 +3765,9 @@ void t_delphi_generator::generate_delphi_struct_writer_impl(ostream& out,
|
||||
<< endl;
|
||||
indent_impl(out) << "var" << endl;
|
||||
indent_up_impl();
|
||||
indent_impl(out) << "struc : IStruct;" << endl;
|
||||
indent_impl(out) << "struc : TThriftStruct;" << endl;
|
||||
if (fields.size() > 0) {
|
||||
indent_impl(out) << "field_ : IField;" << endl;
|
||||
indent_impl(out) << "field_ : TThriftField;" << endl;
|
||||
}
|
||||
out << local_vars.str();
|
||||
indent_down_impl();
|
||||
@@ -3825,7 +3825,7 @@ void t_delphi_generator::generate_delphi_struct_tostring_impl(ostream& out,
|
||||
bool null_allowed = type_can_be_null((*f_iter)->get_type());
|
||||
bool is_optional = ((*f_iter)->get_req() != t_field::T_REQUIRED);
|
||||
if (null_allowed) {
|
||||
indent_impl(out) << "if (" << prop_name((*f_iter), is_exception) << " <> nil)";
|
||||
indent_impl(out) << "if (Self." << prop_name((*f_iter), is_exception) << " <> nil)";
|
||||
if (is_optional) {
|
||||
out << " and __isset_" << prop_name(*f_iter, is_exception);
|
||||
}
|
||||
@@ -3857,14 +3857,14 @@ void t_delphi_generator::generate_delphi_struct_tostring_impl(ostream& out,
|
||||
}
|
||||
|
||||
if (ttype->is_xception() || ttype->is_struct()) {
|
||||
indent_impl(out) << "if (" << prop_name((*f_iter), is_exception) << " = nil) then " << tmp_sb
|
||||
<< ".Append('<null>') else " << tmp_sb << ".Append("
|
||||
indent_impl(out) << "if (Self." << prop_name((*f_iter), is_exception) << " = nil) then " << tmp_sb
|
||||
<< ".Append('<null>') else " << tmp_sb << ".Append( Self."
|
||||
<< prop_name((*f_iter), is_exception) << ".ToString());" << endl;
|
||||
} else if (ttype->is_enum()) {
|
||||
indent_impl(out) << tmp_sb << ".Append(Integer(" << prop_name((*f_iter), is_exception)
|
||||
indent_impl(out) << tmp_sb << ".Append(Integer( Self." << prop_name((*f_iter), is_exception)
|
||||
<< "));" << endl;
|
||||
} else {
|
||||
indent_impl(out) << tmp_sb << ".Append(" << prop_name((*f_iter), is_exception) << ");"
|
||||
indent_impl(out) << tmp_sb << ".Append( Self." << prop_name((*f_iter), is_exception) << ");"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
38
vendor/github.com/apache/thrift/compiler/cpp/src/thrift/generate/t_py_generator.cc
generated
vendored
38
vendor/github.com/apache/thrift/compiler/cpp/src/thrift/generate/t_py_generator.cc
generated
vendored
@@ -58,6 +58,7 @@ public:
|
||||
gen_dynbase_ = false;
|
||||
gen_slots_ = false;
|
||||
gen_tornado_ = false;
|
||||
gen_zope_interface_ = false;
|
||||
gen_twisted_ = false;
|
||||
gen_dynamic_ = false;
|
||||
coding_ = "";
|
||||
@@ -105,8 +106,11 @@ public:
|
||||
} else if( iter->first.compare("dynimport") == 0) {
|
||||
gen_dynbase_ = true;
|
||||
import_dynbase_ = (iter->second);
|
||||
} else if( iter->first.compare("zope.interface") == 0) {
|
||||
gen_zope_interface_ = true;
|
||||
} else if( iter->first.compare("twisted") == 0) {
|
||||
gen_twisted_ = true;
|
||||
gen_zope_interface_ = true;
|
||||
} else if( iter->first.compare("tornado") == 0) {
|
||||
gen_tornado_ = true;
|
||||
} else if( iter->first.compare("coding") == 0) {
|
||||
@@ -290,6 +294,11 @@ private:
|
||||
|
||||
std::string copy_options_;
|
||||
|
||||
/**
|
||||
* True if we should generate code for use with zope.interface.
|
||||
*/
|
||||
bool gen_zope_interface_;
|
||||
|
||||
/**
|
||||
* True if we should generate Twisted-friendly RPC services.
|
||||
*/
|
||||
@@ -425,7 +434,7 @@ string t_py_generator::py_imports() {
|
||||
<< endl
|
||||
<< "from thrift.protocol.TProtocol import TProtocolException"
|
||||
<< endl
|
||||
<< "from thrift.TRecursive import fix_spec"
|
||||
<< "from thrift.TRecursive import fix_spec"
|
||||
<< endl;
|
||||
|
||||
if (gen_utf8strings_) {
|
||||
@@ -623,10 +632,10 @@ string t_py_generator::render_const_value(t_type* type, t_const_value* value) {
|
||||
return out.str();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Generates the "forward declarations" for python structs.
|
||||
* These are actually full class definitions so that calls to generate_struct
|
||||
* can add the thrift_spec field. This is needed so that all thrift_spec
|
||||
* can add the thrift_spec field. This is needed so that all thrift_spec
|
||||
* definitions are grouped at the end of the file to enable co-recursive structs.
|
||||
*/
|
||||
void t_py_generator::generate_forward_declaration(t_struct* tstruct) {
|
||||
@@ -1091,10 +1100,12 @@ void t_py_generator::generate_service(t_service* tservice) {
|
||||
<< "from thrift.Thrift import TProcessor" << endl
|
||||
<< "from thrift.transport import TTransport" << endl
|
||||
<< import_dynbase_;
|
||||
if (gen_zope_interface_) {
|
||||
f_service_ << "from zope.interface import Interface, implementer" << endl;
|
||||
}
|
||||
|
||||
if (gen_twisted_) {
|
||||
f_service_ << "from zope.interface import Interface, implementer" << endl
|
||||
<< "from twisted.internet import defer" << endl
|
||||
f_service_ << "from twisted.internet import defer" << endl
|
||||
<< "from thrift.transport import TTwisted" << endl;
|
||||
} else if (gen_tornado_) {
|
||||
f_service_ << "from tornado import gen" << endl;
|
||||
@@ -1171,7 +1182,7 @@ void t_py_generator::generate_service_interface(t_service* tservice) {
|
||||
extends = type_name(tservice->get_extends());
|
||||
extends_if = "(" + extends + ".Iface)";
|
||||
} else {
|
||||
if (gen_twisted_) {
|
||||
if (gen_zope_interface_) {
|
||||
extends_if = "(Interface)";
|
||||
} else if (gen_newstyle_ || gen_dynamic_ || gen_tornado_) {
|
||||
extends_if = "(object)";
|
||||
@@ -1214,20 +1225,20 @@ void t_py_generator::generate_service_client(t_service* tservice) {
|
||||
string extends_client = "";
|
||||
if (tservice->get_extends() != NULL) {
|
||||
extends = type_name(tservice->get_extends());
|
||||
if (gen_twisted_) {
|
||||
if (gen_zope_interface_) {
|
||||
extends_client = "(" + extends + ".Client)";
|
||||
} else {
|
||||
extends_client = extends + ".Client, ";
|
||||
}
|
||||
} else {
|
||||
if (gen_twisted_ && (gen_newstyle_ || gen_dynamic_)) {
|
||||
if (gen_zope_interface_ && (gen_newstyle_ || gen_dynamic_)) {
|
||||
extends_client = "(object)";
|
||||
}
|
||||
}
|
||||
|
||||
f_service_ << endl << endl;
|
||||
|
||||
if (gen_twisted_) {
|
||||
if (gen_zope_interface_) {
|
||||
f_service_ << "@implementer(Iface)" << endl
|
||||
<< "class Client" << extends_client << ":" << endl
|
||||
<< endl;
|
||||
@@ -1767,7 +1778,7 @@ void t_py_generator::generate_service_server(t_service* tservice) {
|
||||
f_service_ << endl << endl;
|
||||
|
||||
// Generate the header portion
|
||||
if (gen_twisted_) {
|
||||
if (gen_zope_interface_) {
|
||||
f_service_ << "@implementer(Iface)" << endl
|
||||
<< "class Processor(" << extends_processor << "TProcessor):" << endl;
|
||||
} else {
|
||||
@@ -1779,7 +1790,7 @@ void t_py_generator::generate_service_server(t_service* tservice) {
|
||||
indent(f_service_) << "def __init__(self, handler):" << endl;
|
||||
indent_up();
|
||||
if (extends.empty()) {
|
||||
if (gen_twisted_) {
|
||||
if (gen_zope_interface_) {
|
||||
f_service_ << indent() << "self._handler = Iface(handler)" << endl;
|
||||
} else {
|
||||
f_service_ << indent() << "self._handler = handler" << endl;
|
||||
@@ -1787,7 +1798,7 @@ void t_py_generator::generate_service_server(t_service* tservice) {
|
||||
|
||||
f_service_ << indent() << "self._processMap = {}" << endl;
|
||||
} else {
|
||||
if (gen_twisted_) {
|
||||
if (gen_zope_interface_) {
|
||||
f_service_ << indent() << extends << ".Processor.__init__(self, Iface(handler))" << endl;
|
||||
} else {
|
||||
f_service_ << indent() << extends << ".Processor.__init__(self, handler)" << endl;
|
||||
@@ -2536,7 +2547,7 @@ string t_py_generator::function_signature(t_function* tfunction, bool interface)
|
||||
vector<string> post;
|
||||
string signature = tfunction->get_name() + "(";
|
||||
|
||||
if (!(gen_twisted_ && interface)) {
|
||||
if (!(gen_zope_interface_ && interface)) {
|
||||
pre.push_back("self");
|
||||
}
|
||||
|
||||
@@ -2680,6 +2691,7 @@ string t_py_generator::type_to_spec_args(t_type* ttype) {
|
||||
THRIFT_REGISTER_GENERATOR(
|
||||
py,
|
||||
"Python",
|
||||
" zope.interface: Generate code for use with zope.interface.\n"
|
||||
" twisted: Generate Twisted-friendly RPC services.\n"
|
||||
" tornado: Generate code for use with Tornado.\n"
|
||||
" no_utf8strings: Do not Encode/decode strings using utf8 in the generated code. Basically no effect for Python 3.\n"
|
||||
|
||||
Reference in New Issue
Block a user