[New-bugs-announce] [issue4848] MacPython build script uses Carbon and MacOS modules slated for removal

Bill Janssen report at bugs.python.org
Mon Jan 5 18:15:58 CET 2009


New submission from Bill Janssen <bill.janssen at gmail.com>:

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

----------
components: Build, Macintosh
messages: 79169
nosy: janssen
priority: low
severity: normal
status: open
title: MacPython build script uses Carbon and MacOS modules slated for removal
type: feature request
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4848>
_______________________________________


More information about the New-bugs-announce mailing list