[C++-sig] Way to insert code in _main.cpp in pyste

Nicodemus nicodemus at globalite.com.br
Wed Sep 24 00:16:40 CEST 2003


Niall Douglas wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On 22 Sep 2003 at 20:45, Nicodemus wrote:
>
>  
>
>>declaration_code('void Export_TnFOX_Python_FXFile();\n')
>>module_code('    Export_TnFOX_Python_FXFile();\n')
>>
>>But I see you want it inside _main.cpp... there's currently no way to
>>do that explicitly, but you can put it inside any other Pyste file and
>>the effect will be the same, since inside BOOST_PYTHON_MODULE your
>>Export_MyPysteFile() will called, which will then call your
>>ExportExceptionTrans(), for example. Try that and see if it works.
>>    
>>
>
>Hmm. Still not as nice as specifying the registrants on the command 
>line when generating _main.cpp. The modules shouldn't have to worry 
>about this, plus also it's likely I'll foul up not putting it into 
>the first module being compiled in. 
>
>I suppose I could go for a dummy 
>module starting with the letter A?
>

Sure, that would do. You could also create a Pyste file named 
OtherExports.pyste and put this code there... seems good enough.

Regards,
Nicodemus.





More information about the Cplusplus-sig mailing list