Re: [Pyobjc-dev] py2app: unable to load nib-file
Brought to you by:
ronaldoussoren
From: Johan R. <joh...@gm...> - 2009-04-14 06:55:13
|
Odd, because I've seen people just add English.lproj to data_files. For example, look at /Developer/Examples/Python/PyObjC/Cocoa/AppKit/Todo/setup.py. Thanks for your code example. On Tue, Apr 14, 2009 at 2:57 AM, Ian Beck <ia...@on...> wrote: > Hey Johan, > > The problem is likely with your data_files declaration. You can't > just toss data_files a folder and have it intelligently include > everything in it. You have to give it a complete file list of > everything you want included in your project. > > Here's the code that I'm using to automatically populate data_files; > it may have issues (probably should be modified to exclude .svn > folders if you're using SVN, for instance), but at least it's an > example of the kind of thing you'll need to do: > > import os > > # Sets what directory to crawl for files to include > # Relative to location of setup.py; leave off trailing slash > includes_dir = 'src' > > # Set the root directory for included files > # Relative to the bundle's Resources folder, so '../../' targets > bundle root > includes_target = '../../' > > # Initialize an empty list so we can use list.append() > includes = [] > > # Walk the includes directory and include all the files > for root, dirs, filenames in os.walk(includes_dir): > if root is includes_dir: > final = includes_target > else: > final = includes_target + root[len(includes_dir)+1:] + '/' > files = [] > for file in filenames: > if (file[0] != '.'): > files.append(os.path.join(root, file)) > includes.append((final, files)) > > setup( > name='Foo', > app = ['main.py'], > data_files = includes, > ) > > Ian > > On Apr 13, 2009, at 1:23 PM, Johan Rydberg wrote: > >> I've created a PyObjC project using Xcode, and everything works just >> fine when I hit Build and Go. >> >> But it happens that I'm better suited for using emacs and command-line >> tools, so I tried to write up >> a simple setup.py; >> >> #... >> setup( >> name="Foo", >> app=["main.py"], >> data_files=["English.lproj"], >> ) >> >> Running setup.py py2app -A creates the dist and build directories. >> The problem starts when trying >> to run the executable: >> >> 2009-04-13 22:22:29.513 Foo[46645:10b] Unable to load nib file: >> MainMenu, exiting >> >> Has I missed anything in my setup.py file? >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> High Quality Requirements in a Collaborative Environment. >> Download a free trial of Rational Requirements Composer Now! >> http://p.sf.net/sfu/www-ibm-com >> _______________________________________________ >> Pyobjc-dev mailing list >> Pyo...@li... >> https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > —————————————————— > Ian Beck > ia...@on... > > Tagamac: simple mac tagging > http://tagamac.com > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |