Try putting
namespace py aaa
at the top of the .thrift file that defines AaaService.

This will result in all of the files generated for that IDL being placed
under gen-py/aaa.  It should import the structs and exceptions properly
if you do the proper includes in the IDL files.

HTH.

--David

Tomer Shiran wrote:
> I was wondering if there was any way to get Thrift to output files in
> different packages. Here are a few more details:
> 
> 1) I'm using Python
> 2) I want to have the following directory structure:
> 
> aaa/AaaService.py # the service in the IDL would be called AaaService and
> would be generated in package aaa
> bbb/BbbService.py # the service in the IDL would be called BbbService and
> would be generated in package bbb
> types/ttypes.py # the types file
> 
> Right now Thrift's output is in one flat directory, and I can't just copy
> the files to different directories because the 'import' statements (eg,
> AaaService.py imports the ttypes module) assume the files are in the same
> package/directory.
> 
> Is there anything I can do about this? I don't want all the services in our
> system to be in a single package. Ideally, I would define different IDLs for
> each service and within the IDL I would import the IDL for the structs and
> exceptions...
> 
> Thanks,
> Tomer
> 

Reply via email to