[Pythonmac-SIG] Trying to make an app
Steven Palm
n9yty at n9yty.com
Wed Oct 6 18:44:46 CEST 2004
On Oct 6, 2004, at 10:59 AM, Bob Ippolito wrote:
> On Oct 6, 2004, at 11:39 AM, Steven Palm wrote:
>> Even though the `resource` files are where they are supposed to be,
>> I still get an error on running the program about recursion errors
>> and that it cannot find it's resource files.
>
> This is probably a bug in your program.. without any more information
> I can't help you. The current directory of a py2app bundle is the
> Resources folder, so open('resources/mydatafile') will just work
> unless you do a chdir.
Hmmm... Here is where it's looking... It initially does this when one
of the modules loads:
# Where to find bitmaps etc
p=sys.path[0]
if os.path.isfile(p): # zip importer in action
p=os.path.dirname(p)
resourcedirectory=os.path.abspath(os.path.join(p, 'resources'))
And then later when trying to load them it uses:
os.path.join(resourcedirectory, filename)
So the difference in invocation between the bundlebuuilder-built
application bundle and the py2app-built application bundle is causing a
problem with finding the path where we are being run from, at least in
the way that BitPim is trying to find it in the above code. Anyway,
that's something for me to worry about. ;^)
Thanks!
More information about the Pythonmac-SIG
mailing list