On 27/04/2007 19.24, Don Dwiggins wrote:

>> Anyway, I would like this to be fixed automatically by PyInstaller. 
>> There is much infrastructure in place to pack trees of data files into 
>> the executable, unpack automatically them at startup, and let the 
>> package find them. This is the way the Tkinter support works, for instance.
> 
> Does this relate to the onefile description in the "Accessing Data 
> Files" section in the documentation?  If not, could you elaborate a bit? 
>   I may want to package some data files like that fairly soon.

Something like that. As you see, there's no uniform way to access data files 
in PyInstaller:

- For onedir distributions, data files can just be copied through COLLECT, and 
accessed using dirname(sys.executable) + "/data".

- For onefile distributions, you can either:
   - Cheat using BINARY (single files get auto-extracted, but not 
directories)... bleah! And use os.environ["_MEIPASS2"] to get them... bleah 
bleah bleah!
   - Use DATA + CArchive... bleah!

What I would like to do is something like this:

  - Provide an unified model to access data files (for both onedir and onefile)
  - Of course data files will be specified as DATA in spec.
  - In onefile, data files should be automatically extracted from the 
executable like support/unpackTK.py does. Basically, this TK-specific support 
would need to be generalized.
  - Once this framework is in place and working, it can be used for two 
different things:
    1) Users wanting to access application-specific data files.
    2) Import hooks for third-party Python libraries/extensions which have 
their own data files (like Matplotlib, Tkinter/Tix/T*, PyEnchant, etc.).
    2.1) Add support for the pkg_resource API which many third-party Python 
libraries use to access their data files.

Patches welcome, etc. :)
-- 
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