On 26/01/2007 21.44, Russell E. Owen wrote:

> In python 2.5 the email package (in the standard library) had some 
> significant renaming. It kept the old names available for backwards 
> compatibility but uses a lazy import mechanism for those that tends to 
> confuse packagers. As a result, for example, py2app has (or soon will 
> have) a recipe that includes all of email if any of it is imported.
 >
> Based on the warnings I see while trying to package my app using 
> pyinstaller, I suspect pyinstaller could use an import hook for the 
> email package.
> 
> The hook need only add hidden modules for Python 2.5 or later.
> 
> (Also, Python 2.5.x (x > 0) will not use the old email names in its 
> standard library. But the hook would still be useful for 3rd party code.)
> 
> So...speaking of such hooks, does one really need to name each module 
> separately even for a package, and if so, does one include the main 
> directory? For example package foo with subpackage bar, is this the 
> right list of hidden modules:
> foo
> foo.__init__.py
> foo.foomodule1.py
> ...
> foo.bar
> foo.bar.__init__.py
> foo.bar.barmodule1.py
> ...
> or does one elide some of this?

I *think* you could simply use wildcards here. Try adding a hook to the hooks 
directory, using something like:

hiddenimports = ['foo.*']

You can look at hook-time.py as an example of how to make this dependant on 
the Python version. And of course hiddenimports can be filled procedurally 
(but remember that hooks are executed at *build* time, not *run* time of 
course).

http://pyinstaller.python-hosting.com/file/trunk/doc/Manual.html?rev=latest&format=raw#hooks
 
should explain something about what a hook can do. Let me know if there's 
something missing. You can even have a look at source code (mf.py, line 406 
and following) to see how hooks are handled.
-- 
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