New submission from Bill Janssen <bill.jans...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue4848>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to