Dinu Gherman wrote:
> > But... when creating two vanilla PB projects from the PyCocoaApp
> > and PyCocoaDocApp templates and adjusting the buildapp.py script
> > as below (run with python buildapp.py --standalone --strip build)
> > I get a working app only for the single document version. The multi-
> > document version launches, but never shows any window. Any idea?
> > What's the role of the myseterious Main.py files in some of the
> > sample projects?
>
> I still don't think I understand how to convert an existing PB
> project into one to be created by bundlebuilder. The existing
> PyObjC samples rarely use multiple NIB files and I'm missing
> some short description of what the "canonical" way of writing
> a call to bundlebuilder really is...
>
> Thanks for any insight,
Multi-doc app: make sure you either create an Info.plist file or
manually create a plist object in your buildapp.py script.
Example of the latter:
from bundlebuilder import buildapp
from plistlib import Plist, Dict, True
plist = Plist(
CFBundleDocumentTypes = [
Dict(
CFBundleTypeExtensions = ["*"],
CFBundleTypeName = "Universal Font Object",
LSTypeIsPackage = True,
CFBundleTypeRole = "Viewer",
NSDocumentClass = "GlyphSetDocument",
),
Dict(
CFBundleTypeExtensions = ["ttf", "otf"],
CFBundleTypeName = "OpenType Font",
CFBundleTypeRole = "Viewer",
NSDocumentClass = "GlyphSetDocument",
),
Dict(
CFBundleTypeExtensions = ["pfb", "pfa"],
CFBundleTypeName = "Type1 Font",
CFBundleTypeRole = "Viewer",
NSDocumentClass = "GlyphSetDocument",
),
Dict(
CFBundleTypeExtensions = ["*"],
CFBundleTypeOSTypes = ["LWFN"],
CFBundleTypeName = "Type1 Font",
CFBundleTypeRole = "Viewer",
NSDocumentClass = "GlyphSetDocument",
),
]
)
buildapp(
mainprogram = "GlyphViewer.py",
resources = ["MainMenu.nib", "GlyphSetWindow.nib"],
nibname = "MainMenu",
plist = plist,
)
Alternatively you can add --plist=myinfo.plist to the command line, or
replace the above with
plist = Plist.fromFile("myinfo.plist")
Just
|