thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "meng" <mengmengm...@f-road.com.cn>
Subject a problem about thrift nested struct in python
Date Fri, 10 Jun 2016 08:52:01 GMT
Hello everyone,

     I'm a new user of thrift.  There is a "nested struct in thrift
file"issue block me. Maybe somebody could give me some advicesJ

 

Firstly, this is my thrift file 

  struct DeliverInfoVo {

                   .

                   }

struct GetOrderDetailByBankManageVoRes { .

                       19:DeliverInfoVo deliverInfoVo,

                          }

 

Then I compiled it as a python by "thrift -r -gen " and it generated
"constants.py, ttypes.py".

 

Finally, a issue appeared when I run client code:

(18, TType.STRUCT, 'deliverInfoVo', (DeliverInfoVo,
DeliverInfoVo.thrift_spec), None, ), # 18

NameError: name 'DeliverInfoVo' is not defined

 

     I found 'DeliverInfoVo' is a class in ttypes.py, not a module. As I
know, there is OK if generate java package. 

 

     I would appreciate it very much if anyone help me.

 

 

Thanks,

Meng

 

 

 

 

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message