On 02/04/2007 1.30, Luis Miguel Morillas wrote:

[NOTE: I've CC: the PyInstaller list]

>> No, I'm afraid I haven't done anything in that regard. If you are 
>> interested
>> in it, I can try and provide you with instructions to take care of this
>> yourself, but I don't think I have time at the moment.
>>
> 
> Ok. I could try myself with your instructions.
> 
>> One thing though: would you please open a ticket about it? It would 
>> help me
>> not to forget about it...
> 
> I opened the ticket last summer:
> http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi/ticket/66
> and you did some initial analysis  ;-)

Oh well, I had forgotten :)

 From that ticket and this message:
http://lists.hpcf.upr.edu/pipermail/pyinstaller/2006-July/000420.html
I remember that 4Suite was importing modules without going through the import 
hooks.

 From the other link:
http://www.mail-archive.com/[email protected]/msg00268.html
there would seem there are problems with PkgResources not being supported.

I guess these two are different issues. I think we can try attacking the first 
issue first. So you should try this:

1) Write an import hook for Ft.Xml.XPath.XPathParserc (have a look at the 
files in the "hooks" directory and read the documentation). You need to tell 
PyInstaller that it has hiddenimports. Have a look at the C source code to 
find all the modules which are imported from it, and add them to the hidden 
import list.
You can verify that it is working by using ArchiveViewer and opening the .pyz 
file created during the build process. After the hook is written, the files 
which are imported by the C code should be there.

2) Now, you want PyInstaller to automatically import those hidden imports at 
application startup. We do so because the C code in 4Suite does not use import 
hooks: and without going through import hooks, there's no way Python can 
extract the modules from the frozen executable. So the trick I would like to 
attempt here is to tell PyInstaller to *automatically* import those modules 
when the application starts. This way, the C code will find those modules 
already imported, and everything should be fine.

To do this, write a rthook. A rthook (real-time hook) is a file which is 
automatically executed when the frozen application starts. rthooks are mostly 
undocumented (sorry!). You need to:
  a) create a new file support/rthooks/foursuite.py. It should just import 
those files and do nothing else.
  b) edit rthook.dat to register the new rthook you're creating. rthook.dat 
contains a Python dictionary: the key is the module "activating" the rthook. 
In your case, it should be Ft.Xml.XPath.XPathParserc.

To debug this, you should put a print in the rthook, and make sure the print 
appears when the frozen executable is run. If it does not appear, use 
ArchiveViewer over the frozen executable and check that the rthook is within 
the executable. If it's not there, you should debug through Build.py to see 
why it's not being included.

Let me know if everything is clear to you. Thanks for your offer to help!
-- 
Giovanni Bajo



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to