This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author janssen
Recipients janssen
Date 2009-01-05.17:15:56
SpamBayes Score 0.0023267195
Marked as misclassified No
Message-id <1231175758.14.0.180038218422.issue4848@psf.upfronthosting.co.za>
In-reply-to
Content
The build script for a Mac OS installer, in
Mac/BuildScript/build-installer.py, currently requires OS 10.4 and
Python 2.3.  At some point it will have to be ported to a newer version
of Python (and Mac OS).  It uses a number of modules which are slated
for future removal, particularly Carbon and MacOS.  These modules are
only used in the function "setIcon".  They can be replaced with a call
to a Cocoa method via PyObjC.  The "setIcon" function using PyObjC would
look like this:

def setIcon(folder, imagefile):

    try:

        import os, AppKit

        AppKit.NSApplicationLoad()      # initialize Cocoa

        return
AppKit.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(
            AppKit.NSImage.alloc().initWithContentsOfFile_(imagefile),
            os.path.abspath(folder), 0)

    except ImportError:
        return False
History
Date User Action Args
2009-01-05 17:15:58janssensetrecipients: + janssen
2009-01-05 17:15:58janssensetmessageid: <1231175758.14.0.180038218422.issue4848@psf.upfronthosting.co.za>
2009-01-05 17:15:57janssenlinkissue4848 messages
2009-01-05 17:15:56janssencreate