if you're just using 'import' to import your thubanstart.py, you should
do something like:

import sys
sys.path.insert(0, 'c:\\Documents and settings\username 
\ApplicationData\thuban\')
import thubanstart

Then you can include a base thubanstart in your distribution, but  
since you're
prepending sys.path with the user's directory in the import path, the  
users'
custom one will be imported before the base one, when there is one.

Another alternative (assuming you're using import) would be to not  
include
a base one, and do

try:
     import thubanstart
except:
     # you can set a 'loaded custom module' flag here, or
     # possibly do some exception handling for the user's
     # custom module
     pass

You'll still need to add the users' app data directory to sys.path  
though.

-Hal
On Apr 29, 2007, at  3:34 AM, Didrik Pinte wrote:

> Hi,
>
> I'm using pysinstaller to build an executable for Thuban
> (http://thuban.intevation.org/).
>
> It works great but I have a little problem.
>
> Thuban allows the user to have a user module to load the extensions he
> wants. This is done using a thubanstart.py file stored in c:\Documents
> and settings\username\Application Data\thuban\
>
> If I had this path to the Analysis in the spec, the exe containts the
> thubanstart.py file and I cannot modify it anymore or take into  
> account
> the fact that the user has another file.
>
> If I do not add the path to the thubanstart.py file to the Analysis in
> the spec, the application does not load the file when starting.
>
> How can I keep a user file in c:\Documents and settings\username
> \Application Data\thuban\ while using the exe built with pyinstaller ?
>
> Thanks
>
> Didrik


--
Hal Schechner
[EMAIL PROTECTED]




--~--~---------~--~----~------------~-------~--~----~
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