Commits

Ronald Oussoren committed 4de777c

- Much improved NSKeyValueCoding support, including a python module that
makes it possible to use Key-Value Coding with unmodified plain python
classes. Lightly tested, but including unittests.

- Adapted Scripts/CodeGenerators to deal with 'static inline' functions
(in Foundation), and some more basic C types.

- Fix names in objc.module (recycle_autorelease_pool -> recycleAutoreleasePool,
and simularly for some other internal functions)

- Move some 'convert' functions from Scripts/CodeGenerators to the PyObjC API.

- Start documentation for PyObjCTools package, and updates for the rest of the
documentation.

Comments (0)

Files changed (44)

pyobjc/Doc/C-API.txt

 more convenient.
 
 The C API is defined in ``pyobjc-api.h``. This file is currently not installed
-because the API is not entirely stable.
+because the API is not entirely stable. This is the only file that can
+be included from outside of the 'Modules/objc' directory, future versions of
+the bridge may use additional linker flags to make sure that the module doesn't
+export symbols other than the module init function.
 
-XXX: Insert reference to the CodeGeneration scripts.
+The easiest way to wrap global functions and constants is by using the scripts
+in Scripts/CodeGenerators. This script is unsupported and might not work on
+anything but the Apple headers, but if it works it will save you a lot of work.
 
 Limititations
 -------------
 from one C file in the implementation of an extension module. This limitation
 will probably not be removed in future versions of the API.
 
+
 Initialization
 --------------
 
 
 Loading the API will make it impossible to unload the ``calling_module``.
 
+NOTE: Using the API other than by the mechanism described in this document 
+is unsupported.
+
 Compatibility Macros
 --------------------
 
 
 This is a variation on ``PyObjC_PythonToId`` than can be used with 
 ``PyArg_Parse``.
+
+:: 
+ 
+  int PyObjCClass_Convert(PyObject* object, void* pvar);
+
+This is a variation on ``PyObjCClass_GetClass`` than can be used with 
+``PyArg_Parse``.
+
+::
+
+  int PyObjCSelector_Convert(PyObject* object, void* pvar);
+
+Write the ``SEL`` for a selector object into *pvar. 
+For use with ``PyArg_Parse``.
+
+::
+
+  int PyObjC_ConvertBOOL(PyObject* object, void* pvar);
+
+Write ``YES`` into *pvar if ``object`` is true, write ``NO`` otherwise.
+*pvar should be of type BOOL.  For use with ``PyArg_Parse``.
+
+::
+
+  int PyObjC_ConvertChar(PyObject* object, void* pvar);
+
+Write the value of a string of length 1 into the character (type char)
+at ``*pvar``. For use with ``PyArg_Parse``.

pyobjc/Doc/PyObjCTools.txt

+===============================
+PyObjCTools: The PyObjC Toolbox
+===============================
+
+Introduction
+------------
+
+The package ``PyObjCTools`` contains a number of (basicly unrelated) modules
+with usefull functionality. These have been placed inside a module to avoid
+cluttering the global namespace.
+
+The rest of this document provides documentation for these modules, but lets
+start with a short overview.
+
+* ``PyObjCTools.AppHelper``
+
+Utility functions for use with the ``AppKit`` module.
+
+* ``PyObjCTools.Conversion.py``
+
+Functions for converting between Cocoa and pure Python data structures.
+
+* ``PyObjCTools.KeyValueCoding.py``
+
+A python API for working with Key-Value Coding. XXX: Link
+
+* ``PyObjCTools.KeyValueCodingSupport.py``
+
+Utility functions and mix-in classes for working with Key-Value Coding. This
+module is deprecated.
+
+* ``PyObjCTools.NibClassBuilder.py``
+
+Module containing a magic super-class that can read information about the
+actual super-class and implemented actions and outlets from a NIB file.
+
+* ``PyObjCTools.pluginbuilder.py``
+
+Extension of ``bundlebuilder`` (XXX: Link) that allows you to build python-based
+plugin bundles, such as panes for the System Preferences application and
+screen savers.
+
+* ``PyObjCTools.Signals.py``
+
+Module that tries to print usefull information when the program gets a fatal
+exception. This module should only be used during development.
 * Restructure selector.m, this file is too long and complicated. We could
   do away with the difference between method implemented in Python and ObjC.
 
+* Likewise for class-builder.m, this file is way to large.
+
+* Use libffi to do away with class-builder.m:find_real_superclass. And check
+  if we can use libffi to simplify code.
+
 
 Support for GNUstep
 ...................

pyobjc/Doc/intro.txt

 	:copyright: 2003 The PyObjC Project
 
 
-
 .. contents::
 
 WORK IN PROGRESS
 Objective-C for PyObjC users
 ----------------------------
 
+It is necessary to understand a little bit of Objective-C to use PyObjC,
+this helps you to better understand the class libraries and makes it easier
+to read (and translate) example code.
+
 Objective-C is an object-oriented programming language that is an extension 
 of C and borrows heavily from Smalltalk. It features single inheritance with
 (in theory) multiple root classes and dynamic dispatch of methods. This is
 Objective-C. The former is done by the class-method ``alloc``, while the
 latter is done by instance-methods whose name customarily starts with ``init``.
 
+Objective-C code looks just like plain C code, with some easily recognizable
+extensions for the Object-Oriented parts of the language. And example class
+declaration (usually found in ``.h`` files) and implementation (usually found
+in ``.m`` files) are listed below). Class declarations are easily recognized as 
+blocks of code between ``@interface`` and ``@end``, and simularly the 
+implementation is between ``@implementation`` and ``@end``. Calling methods
+is done using expressions enclosed with brackets (name?), e.g. 
+``[foo method]``.  This is the same as ``foo.method()`` in Python.
+
+A class declaration::
+
+   @interface MYClass : MySuperClass
+   {
+      id  anInstanceVariable;
+      int anotherInstanceVariable;
+   }
+
+   +aClassMethod;
+
+   -(int)anInstanceMethodWithArg1:arg1 andArg2:(BOOL)arg2;
+   @end
+
+A class implemenation::
+
+   @implementation MYClass
+
+   +aClassMethod
+   {
+   	id res = [[MYClass alloc] init];
+	return res;
+   }
+
+   -(int)anInstanceMethodWithArg1:arg1 andArg2:(BOOL)arg2
+   {
+   	int res;
+
+	if (arg2) {
+		res = [self fooWith:arg1];
+	} else {
+		res = [arg1 bar];
+	}
+   }
+
+   @end
+
+Objective-C also features exceptions, but as those are mostly used for disaster
+recovery and not for normal error handling you won't see them very often
+in example code. The `The Objective-C Programming Language`_ if you want to
+know more about exceptions in Objective-C. 
+
 For more information about Objective-C see:
 
 * `The Objective-C Programming Language`_ at `Apple`_.

pyobjc/Doc/website.lst

 extending_objc_with_python.txt,user,13
 tutorial_reading.txt,user,14
 ProjectBuilder-SyntaxHighlighting.txt,user,15
+PyObjCTools.txt,user,16
 api-notes-macosx.txt,user,17
 warts.txt,user,20
 wrapping.txt,user,30

pyobjc/Doc/wrapping.txt

 The following code tells the brigde about this better method signature::
 
    import objc
-   objc.set_signature_for_selector("ClassName", "selector:withArguments:",
+   objc.setSignatureForSelector("ClassName", "selector:withArguments:",
    	"v@:o^@:@")
 
 To anotate method signatures you'll have to add a single character before all

pyobjc/Examples/subclassing-objective-c.py

 obj = None
 print "Done"
 
-objc.recycle_autorelease_pool()
+objc.recyleAutoreleasePool()

pyobjc/Lib/AppKit/_AppKitSignatures.py

 # Generated from 'Lib/AppKit/AppKit.byref'.
 #
 #
-from objc import set_signature_for_selector
+from objc import setSignatureForSelector
 
-set_signature_for_selector("NSFocusState", "clip:", "@@:i^{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
-set_signature_for_selector("NSSurface", "surfaceID", "i@:")
-set_signature_for_selector("NSInputManager", "getMarkedText:selectedRange:", "v@:o^@o^{_NSRange=II}")
-set_signature_for_selector("NSToolbar", "_configSheetDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSEvent", "enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:", "@52@4:8i12{_NSPoint=ff}16I24d36i40@44i48i52i56")
-set_signature_for_selector("NSEvent", "userData", "i@:")
-set_signature_for_selector("NSPSMatrix", "invTransformRect:", "@@:N^{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
-set_signature_for_selector("NSPSMatrix", "invTransform:", "@@:N^{_NSPoint=ff}")
-set_signature_for_selector("NSPSMatrix", "transformRect:", "@@:N^{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
-set_signature_for_selector("NSPSMatrix", "transform:", "@@:N^{_NSPoint=ff}")
-set_signature_for_selector("NSButton", "getPeriodicDelay:interval:", "v@:o^fo^f")
-set_signature_for_selector("NSView", "addToolTipRect:owner:userData:", "i28@4:8{_NSRect={_NSPoint=ff}{_NSSize=ff}}12@28i32")
-set_signature_for_selector("NSView", "addTrackingRect:owner:userData:assumeInside:", "i@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}@ic")
-set_signature_for_selector("NSAlert", "didEndSheet:returnCode:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSSavePanel", "_runModalForDirectory:file:relativeToWindow:modalDelegate:didEndSelector:contextInfo:", "v28@4:8@12@16@20@24:28i32")
-set_signature_for_selector("NSSavePanel", "beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:", "v28@4:8@12@16@20@24:28i32")
-set_signature_for_selector("NSSavePanel", "didEndSheet:returnCode:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSPageLayout", "_sheetDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSPageLayout", "beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:", "v24@4:8@12@16@20:24i28")
-set_signature_for_selector("NSPageLayout", "convertOldFactor:newFactor:", "v@:i^fo^f")
-set_signature_for_selector("NSBitmapImageRep", "getCompression:factor:", "v@:o^io^f")
-set_signature_for_selector("NSColor", "getCyan:magenta:yellow:black:alpha:", "v@:o^fo^fo^fo^f")
-set_signature_for_selector("NSColor", "getHue:saturation:brightness:alpha:", "v@:o^fo^fo^fo^f")
-set_signature_for_selector("NSColor", "getRed:green:blue:alpha:", "v@:o^fo^fo^fo^f")
-set_signature_for_selector("NSColor", "getWhite:alpha:", "v@:o^fo^f")
-set_signature_for_selector("NSFont", "positionOfGlyph:precededByGlyph:isNominal:", "{_NSPoint=ff}@:IIo^c")
-set_signature_for_selector("NSFont", "positionOfGlyph:struckOverGlyph:metricsExist:", "{_NSPoint=ff}@:IIo^c")
-set_signature_for_selector("NSFont", "positionOfGlyph:struckOverRect:metricsExist:", "{_NSPoint=ff}@:I{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^c")
-set_signature_for_selector("NSFont", "positionOfGlyph:withRelation:toBaseGlyph:totalAdvancement:metricsExist:", "{_NSPoint=ff}@:IiIo^{_NSSize=ff}o^c")
-set_signature_for_selector("NSWorkspace", "getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:", "c28@4:8@12o^c16o^c20o^c24o^@28o^@32")
-set_signature_for_selector("NSWorkspace", "getInfoForFile:application:type:", "c16@4:8@12o^@16o^@20")
-set_signature_for_selector("NSWorkspace", "performFileOperation:source:destination:files:tag:", "c@:@@@@o^i")
-set_signature_for_selector("NSDocument", "_changeAlertDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSDocument", "_compatibility_canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:", "v16@4:8@12:16i20")
-set_signature_for_selector("NSDocument", "_compatibility_doSavePanelSave:delegate:didSaveSelector:contextInfo:", "v20@4:8i12@16:20i24")
-set_signature_for_selector("NSDocument", "_compatibility_shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:", "v20@4:8@12@16:20i24")
-set_signature_for_selector("NSDocument", "_didEndCloseSheet:returnCode:closeContext:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSDocument", "_document:pageLayoutDidReturn:contextInfo:", "v16@4:8@12c16i20")
-set_signature_for_selector("NSDocument", "_finishSaveDocumentTo:withType:forSaveOperation:withDelegate:didSaveSelector:contextInfo:", "v28@4:8@12@16i20@24:28i32")
-set_signature_for_selector("NSDocument", "_pageLayout:didEndAndReturn:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSDocument", "_printOperation:didReturn:contextInfo:", "v16@4:8@12c16i20")
-set_signature_for_selector("NSDocument", "_revertPanel:didConfirm:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSDocument", "_runAlertPanelForDocumentMoved:orDocumentRenamed:orDocumentInTrash:orDocumentUnavailable:thenSaveDocumentWithDelegate:didSaveSelector:contextInfo:", "v36@4:8c12c16c20c24@28:32i40")
-set_signature_for_selector("NSDocument", "_savePanelDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSDocument", "canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:", "v16@4:8@12:16i20")
-set_signature_for_selector("NSDocument", "runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:", "v20@4:8@12@16:20i24")
-set_signature_for_selector("NSDocument", "runModalPrintOperation:delegate:didRunSelector:contextInfo:", "v20@4:8@12@16:20i24")
-set_signature_for_selector("NSDocument", "runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:", "v20@4:8i12@16:20i24")
-set_signature_for_selector("NSDocument", "saveDocumentWithDelegate:didSaveSelector:contextInfo:", "v16@4:8@12:16i20")
-set_signature_for_selector("NSDocument", "saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:", "v24@4:8@12i16@20:24i28")
-set_signature_for_selector("NSDocument", "shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:", "v20@4:8@12@16:20i24")
-set_signature_for_selector("NSWindow", "_document:shouldClose:contextInfo:", "v16@4:8@12c16i20")
-set_signature_for_selector("NSWindow", "_setTrackingRect:inside:owner:userData:", "i36@4:8{_NSRect={_NSPoint=ff}{_NSSize=ff}}12c28@32i40")
-set_signature_for_selector("NSTypesetter", "layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:", "v@:@IIo^I")
-set_signature_for_selector("NSCell", "getPeriodicDelay:interval:", "v@:o^fo^f")
-set_signature_for_selector("NSProgressPanel", "setCancellationDelegate:wasCancelledSelector:contextInfo:", "v16@4:8@12:16i20")
-set_signature_for_selector("NSLayoutManager", "characterRangeForGlyphRange:actualGlyphRange:", "{_NSRange=II}@:{_NSRange=II}o^{_NSRange=II}")
-set_signature_for_selector("NSLayoutManager", "getFirstUnlaidCharacterIndex:glyphIndex:", "v@:o^Io^I")
-set_signature_for_selector("NSLayoutManager", "glyphAtIndex:isValidIndex:", "I@:Io^c")
-set_signature_for_selector("NSLayoutManager", "glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:", "I@:{_NSPoint=ff}@o^f")
-set_signature_for_selector("NSLayoutManager", "glyphRangeForCharacterRange:actualCharacterRange:", "{_NSRange=II}@:{_NSRange=II}o^{_NSRange=II}")
-set_signature_for_selector("NSLayoutManager", "invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:", "v@:{_NSRange=II}io^{_NSRange=II}")
-set_signature_for_selector("NSLayoutManager", "invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:", "v@:{_NSRange=II}co^{_NSRange=II}")
-set_signature_for_selector("NSLayoutManager", "lineFragmentRectForGlyphAtIndex:effectiveRange:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:Io^{_NSRange=II}")
-set_signature_for_selector("NSLayoutManager", "lineFragmentUsedRectForGlyphAtIndex:effectiveRange:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:Io^{_NSRange=II}")
-set_signature_for_selector("NSLayoutManager", "lineFragmentUsedRectForGlyphAtIndex:effectiveRange:allowLayout:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:Io^{_NSRange=II}c")
-set_signature_for_selector("NSLayoutManager", "temporaryAttributesAtCharacterIndex:effectiveRange:", "@@:Io^{_NSRange=II}")
-set_signature_for_selector("NSLayoutManager", "textContainerForGlyphAtIndex:effectiveRange:", "@@:Io^{_NSRange=II}")
-set_signature_for_selector("NSOpenPanel", "beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:", "v36@4:8@12@16@20@24@28:32i40")
-set_signature_for_selector("NSPrintOperation", "runOperationModalForWindow:delegate:didRunSelector:contextInfo:", "v20@4:8@12@16:20i24")
-set_signature_for_selector("NSSpellChecker", "checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:", "{_NSRange=II}@:@i@cio^i")
-set_signature_for_selector("NSSpellChecker", "checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:reconnectOnError:", "{_NSRange=II}@:@i@cio^ic")
-set_signature_for_selector("NSToolTipManager", "_setToolTip:forView:cell:rect:owner:ownerIsDisplayDelegate:userData:", "i48@4:8@12@16@20{_NSRect={_NSPoint=ff}{_NSSize=ff}}28@44c51i52")
-set_signature_for_selector("NSToolTipManager", "setToolTipForView:rect:displayDelegate:userData:", "i36@4:8@12{_NSRect={_NSPoint=ff}{_NSSize=ff}}16@32i40")
-set_signature_for_selector("NSToolTipManager", "setToolTipForView:rect:owner:userData:", "i36@4:8@12{_NSRect={_NSPoint=ff}{_NSSize=ff}}16@32i40")
-set_signature_for_selector("NSMatrix", "getNumberOfRows:columns:", "v@:o^io^i")
-set_signature_for_selector("NSMatrix", "getRow:column:forPoint:", "c@:o^io^i{_NSPoint=ff}")
-set_signature_for_selector("NSMatrix", "getRow:column:ofCell:", "c@:o^io^i@")
-set_signature_for_selector("NSMatrix", "view:frameForToolTip:point:userData:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}28@8:12@16i20{_NSPoint=ff}24i32")
-set_signature_for_selector("NSMatrix", "view:stringForToolTip:point:userData:", "@24@4:8@12i16{_NSPoint=ff}20i28")
-set_signature_for_selector("NSDocumentController", "_document:didSave:contextInfo:", "v16@4:8@12c16i20")
-set_signature_for_selector("NSDocumentController", "closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:", "v16@4:8@12:16i20")
-set_signature_for_selector("NSDocumentController", "reviewUnsavedDocumentsWithAlertTitle:cancellable:delegate:didReviewAllSelector:contextInfo:", "v24@4:8@12c16@20:24i28")
-set_signature_for_selector("NSConcretePrintOperation", "_printPanel:didEndAndReturn:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSConcretePrintOperation", "_progressPanelWasCancelled:contextInfo:", "v12@4:8@12i16")
-set_signature_for_selector("NSConcretePrintOperation", "_progressPanel:didEndAndReturn:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSPrintPanel", "_sheetDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
-set_signature_for_selector("NSPrintPanel", "beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:", "v24@4:8@12@16@20:24i28")
-set_signature_for_selector("NSTextContainer", "lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}iio^{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
-set_signature_for_selector("NSApplication", "_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:", "^{_NSModalSession=@@^{_NSModalSession}iciI^vi@@:^vi}24@4:8@12@16@20:24i28")
-set_signature_for_selector("NSApplication", "beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:", "v@:@@@:i")
-set_signature_for_selector("NSApplication", "contextID", "i4@4:8")
-set_signature_for_selector("NSApplication", "openFile:ok:", "i12@4:8@12o^i16")
-set_signature_for_selector("NSApplication", "openTempFile:ok:", "i12@4:8@12o^i16")
-set_signature_for_selector("NSApplication", "runModalSession:", "i8@4:8^{_NSModalSession=@@^{_NSModalSession}iciI^vi@@:^vi}12")
-set_signature_for_selector("NSView", "adjustPageHeightNew:top:bottom:limit:", "v@:o^ffff")
-set_signature_for_selector("NSView", "adjustPageWidthNew:left:right:limit:", "v@:o^ffff")
-set_signature_for_selector("NSView", "knowsPageRange:", "v@:N^{_NSRange=II}")
+setSignatureForSelector("NSFocusState", "clip:", "@@:i^{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
+setSignatureForSelector("NSSurface", "surfaceID", "i@:")
+setSignatureForSelector("NSInputManager", "getMarkedText:selectedRange:", "v@:o^@o^{_NSRange=II}")
+setSignatureForSelector("NSToolbar", "_configSheetDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSEvent", "enterExitEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:trackingNumber:userData:", "@52@4:8i12{_NSPoint=ff}16I24d36i40@44i48i52i56")
+setSignatureForSelector("NSEvent", "userData", "i@:")
+setSignatureForSelector("NSPSMatrix", "invTransformRect:", "@@:N^{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
+setSignatureForSelector("NSPSMatrix", "invTransform:", "@@:N^{_NSPoint=ff}")
+setSignatureForSelector("NSPSMatrix", "transformRect:", "@@:N^{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
+setSignatureForSelector("NSPSMatrix", "transform:", "@@:N^{_NSPoint=ff}")
+setSignatureForSelector("NSButton", "getPeriodicDelay:interval:", "v@:o^fo^f")
+setSignatureForSelector("NSView", "addToolTipRect:owner:userData:", "i28@4:8{_NSRect={_NSPoint=ff}{_NSSize=ff}}12@28i32")
+setSignatureForSelector("NSView", "addTrackingRect:owner:userData:assumeInside:", "i@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}@ic")
+setSignatureForSelector("NSAlert", "didEndSheet:returnCode:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSSavePanel", "_runModalForDirectory:file:relativeToWindow:modalDelegate:didEndSelector:contextInfo:", "v28@4:8@12@16@20@24:28i32")
+setSignatureForSelector("NSSavePanel", "beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:", "v28@4:8@12@16@20@24:28i32")
+setSignatureForSelector("NSSavePanel", "didEndSheet:returnCode:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSPageLayout", "_sheetDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSPageLayout", "beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:", "v24@4:8@12@16@20:24i28")
+setSignatureForSelector("NSPageLayout", "convertOldFactor:newFactor:", "v@:i^fo^f")
+setSignatureForSelector("NSBitmapImageRep", "getCompression:factor:", "v@:o^io^f")
+setSignatureForSelector("NSColor", "getCyan:magenta:yellow:black:alpha:", "v@:o^fo^fo^fo^f")
+setSignatureForSelector("NSColor", "getHue:saturation:brightness:alpha:", "v@:o^fo^fo^fo^f")
+setSignatureForSelector("NSColor", "getRed:green:blue:alpha:", "v@:o^fo^fo^fo^f")
+setSignatureForSelector("NSColor", "getWhite:alpha:", "v@:o^fo^f")
+setSignatureForSelector("NSFont", "positionOfGlyph:precededByGlyph:isNominal:", "{_NSPoint=ff}@:IIo^c")
+setSignatureForSelector("NSFont", "positionOfGlyph:struckOverGlyph:metricsExist:", "{_NSPoint=ff}@:IIo^c")
+setSignatureForSelector("NSFont", "positionOfGlyph:struckOverRect:metricsExist:", "{_NSPoint=ff}@:I{_NSRect={_NSPoint=ff}{_NSSize=ff}}o^c")
+setSignatureForSelector("NSFont", "positionOfGlyph:withRelation:toBaseGlyph:totalAdvancement:metricsExist:", "{_NSPoint=ff}@:IiIo^{_NSSize=ff}o^c")
+setSignatureForSelector("NSWorkspace", "getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:", "c28@4:8@12o^c16o^c20o^c24o^@28o^@32")
+setSignatureForSelector("NSWorkspace", "getInfoForFile:application:type:", "c16@4:8@12o^@16o^@20")
+setSignatureForSelector("NSWorkspace", "performFileOperation:source:destination:files:tag:", "c@:@@@@o^i")
+setSignatureForSelector("NSDocument", "_changeAlertDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSDocument", "_compatibility_canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:", "v16@4:8@12:16i20")
+setSignatureForSelector("NSDocument", "_compatibility_doSavePanelSave:delegate:didSaveSelector:contextInfo:", "v20@4:8i12@16:20i24")
+setSignatureForSelector("NSDocument", "_compatibility_shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:", "v20@4:8@12@16:20i24")
+setSignatureForSelector("NSDocument", "_didEndCloseSheet:returnCode:closeContext:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSDocument", "_document:pageLayoutDidReturn:contextInfo:", "v16@4:8@12c16i20")
+setSignatureForSelector("NSDocument", "_finishSaveDocumentTo:withType:forSaveOperation:withDelegate:didSaveSelector:contextInfo:", "v28@4:8@12@16i20@24:28i32")
+setSignatureForSelector("NSDocument", "_pageLayout:didEndAndReturn:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSDocument", "_printOperation:didReturn:contextInfo:", "v16@4:8@12c16i20")
+setSignatureForSelector("NSDocument", "_revertPanel:didConfirm:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSDocument", "_runAlertPanelForDocumentMoved:orDocumentRenamed:orDocumentInTrash:orDocumentUnavailable:thenSaveDocumentWithDelegate:didSaveSelector:contextInfo:", "v36@4:8c12c16c20c24@28:32i40")
+setSignatureForSelector("NSDocument", "_savePanelDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSDocument", "canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:", "v16@4:8@12:16i20")
+setSignatureForSelector("NSDocument", "runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:", "v20@4:8@12@16:20i24")
+setSignatureForSelector("NSDocument", "runModalPrintOperation:delegate:didRunSelector:contextInfo:", "v20@4:8@12@16:20i24")
+setSignatureForSelector("NSDocument", "runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:", "v20@4:8i12@16:20i24")
+setSignatureForSelector("NSDocument", "saveDocumentWithDelegate:didSaveSelector:contextInfo:", "v16@4:8@12:16i20")
+setSignatureForSelector("NSDocument", "saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:", "v24@4:8@12i16@20:24i28")
+setSignatureForSelector("NSDocument", "shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:", "v20@4:8@12@16:20i24")
+setSignatureForSelector("NSWindow", "_document:shouldClose:contextInfo:", "v16@4:8@12c16i20")
+setSignatureForSelector("NSWindow", "_setTrackingRect:inside:owner:userData:", "i36@4:8{_NSRect={_NSPoint=ff}{_NSSize=ff}}12c28@32i40")
+setSignatureForSelector("NSTypesetter", "layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:", "v@:@IIo^I")
+setSignatureForSelector("NSCell", "getPeriodicDelay:interval:", "v@:o^fo^f")
+setSignatureForSelector("NSProgressPanel", "setCancellationDelegate:wasCancelledSelector:contextInfo:", "v16@4:8@12:16i20")
+setSignatureForSelector("NSLayoutManager", "characterRangeForGlyphRange:actualGlyphRange:", "{_NSRange=II}@:{_NSRange=II}o^{_NSRange=II}")
+setSignatureForSelector("NSLayoutManager", "getFirstUnlaidCharacterIndex:glyphIndex:", "v@:o^Io^I")
+setSignatureForSelector("NSLayoutManager", "glyphAtIndex:isValidIndex:", "I@:Io^c")
+setSignatureForSelector("NSLayoutManager", "glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:", "I@:{_NSPoint=ff}@o^f")
+setSignatureForSelector("NSLayoutManager", "glyphRangeForCharacterRange:actualCharacterRange:", "{_NSRange=II}@:{_NSRange=II}o^{_NSRange=II}")
+setSignatureForSelector("NSLayoutManager", "invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:", "v@:{_NSRange=II}io^{_NSRange=II}")
+setSignatureForSelector("NSLayoutManager", "invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:", "v@:{_NSRange=II}co^{_NSRange=II}")
+setSignatureForSelector("NSLayoutManager", "lineFragmentRectForGlyphAtIndex:effectiveRange:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:Io^{_NSRange=II}")
+setSignatureForSelector("NSLayoutManager", "lineFragmentUsedRectForGlyphAtIndex:effectiveRange:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:Io^{_NSRange=II}")
+setSignatureForSelector("NSLayoutManager", "lineFragmentUsedRectForGlyphAtIndex:effectiveRange:allowLayout:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:Io^{_NSRange=II}c")
+setSignatureForSelector("NSLayoutManager", "temporaryAttributesAtCharacterIndex:effectiveRange:", "@@:Io^{_NSRange=II}")
+setSignatureForSelector("NSLayoutManager", "textContainerForGlyphAtIndex:effectiveRange:", "@@:Io^{_NSRange=II}")
+setSignatureForSelector("NSOpenPanel", "beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector:contextInfo:", "v36@4:8@12@16@20@24@28:32i40")
+setSignatureForSelector("NSPrintOperation", "runOperationModalForWindow:delegate:didRunSelector:contextInfo:", "v20@4:8@12@16:20i24")
+setSignatureForSelector("NSSpellChecker", "checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:", "{_NSRange=II}@:@i@cio^i")
+setSignatureForSelector("NSSpellChecker", "checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:reconnectOnError:", "{_NSRange=II}@:@i@cio^ic")
+setSignatureForSelector("NSToolTipManager", "_setToolTip:forView:cell:rect:owner:ownerIsDisplayDelegate:userData:", "i48@4:8@12@16@20{_NSRect={_NSPoint=ff}{_NSSize=ff}}28@44c51i52")
+setSignatureForSelector("NSToolTipManager", "setToolTipForView:rect:displayDelegate:userData:", "i36@4:8@12{_NSRect={_NSPoint=ff}{_NSSize=ff}}16@32i40")
+setSignatureForSelector("NSToolTipManager", "setToolTipForView:rect:owner:userData:", "i36@4:8@12{_NSRect={_NSPoint=ff}{_NSSize=ff}}16@32i40")
+setSignatureForSelector("NSMatrix", "getNumberOfRows:columns:", "v@:o^io^i")
+setSignatureForSelector("NSMatrix", "getRow:column:forPoint:", "c@:o^io^i{_NSPoint=ff}")
+setSignatureForSelector("NSMatrix", "getRow:column:ofCell:", "c@:o^io^i@")
+setSignatureForSelector("NSMatrix", "view:frameForToolTip:point:userData:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}28@8:12@16i20{_NSPoint=ff}24i32")
+setSignatureForSelector("NSMatrix", "view:stringForToolTip:point:userData:", "@24@4:8@12i16{_NSPoint=ff}20i28")
+setSignatureForSelector("NSDocumentController", "_document:didSave:contextInfo:", "v16@4:8@12c16i20")
+setSignatureForSelector("NSDocumentController", "closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:", "v16@4:8@12:16i20")
+setSignatureForSelector("NSDocumentController", "reviewUnsavedDocumentsWithAlertTitle:cancellable:delegate:didReviewAllSelector:contextInfo:", "v24@4:8@12c16@20:24i28")
+setSignatureForSelector("NSConcretePrintOperation", "_printPanel:didEndAndReturn:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSConcretePrintOperation", "_progressPanelWasCancelled:contextInfo:", "v12@4:8@12i16")
+setSignatureForSelector("NSConcretePrintOperation", "_progressPanel:didEndAndReturn:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSPrintPanel", "_sheetDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSPrintPanel", "beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:", "v24@4:8@12@16@20:24i28")
+setSignatureForSelector("NSTextContainer", "lineFragmentRectForProposedRect:sweepDirection:movementDirection:remainingRect:", "{_NSRect={_NSPoint=ff}{_NSSize=ff}}@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}iio^{_NSRect={_NSPoint=ff}{_NSSize=ff}}")
+setSignatureForSelector("NSApplication", "_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEndSelector:contextInfo:", "^{_NSModalSession=@@^{_NSModalSession}iciI^vi@@:^vi}24@4:8@12@16@20:24i28")
+setSignatureForSelector("NSApplication", "beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:", "v@:@@@:i")
+setSignatureForSelector("NSApplication", "contextID", "i4@4:8")
+setSignatureForSelector("NSApplication", "openFile:ok:", "i12@4:8@12o^i16")
+setSignatureForSelector("NSApplication", "openTempFile:ok:", "i12@4:8@12o^i16")
+setSignatureForSelector("NSApplication", "runModalSession:", "i8@4:8^{_NSModalSession=@@^{_NSModalSession}iciI^vi@@:^vi}12")
+setSignatureForSelector("NSView", "adjustPageHeightNew:top:bottom:limit:", "v@:o^ffff")
+setSignatureForSelector("NSView", "adjustPageWidthNew:left:right:limit:", "v@:o^ffff")
+setSignatureForSelector("NSView", "knowsPageRange:", "v@:N^{_NSRange=II}")

pyobjc/Lib/AppKit/__init__.py

 
 # Load the Cocoa bundle, and gather all classes defined there
 _objc.loadBundle("AppKit", globals(), bundle_path="/System/Library/Frameworks/AppKit.framework")
-_objc.recycle_autorelease_pool()
+_objc.recyleAutoreleasePool()
 del Foundation
 
 

pyobjc/Lib/Foundation/__init__.py

                       NSCopyLinkMoveHandler, NSKeyedArchiverDelegate, \
                       NSKeyedUnarchiverDelegate, NSNetServiceDelegateMethods, \
                       NSNetServiceBrowserDelegateMethods, NSPortDelegateMethods
+

pyobjc/Lib/Foundation/test/test_keyvalue.py

+"""
+Tests for the Key-Value Coding for hybrid python objects.
+
+NOTE: Testcases here should be synchronized with the Key-Value Coding tests
+in PyObjCTools.test.test_keyvalue and objc.test.test_keyvalue.
+
+TODO:
+    - Tests that access properties in the parent Objective-C class!
+"""
+import objc
+import unittest
+from objc.test.testbndl import PyObjC_TestClass3 as STUB
+
+class KeyValueClass1 (objc.runtime.NSObject):
+    def init(self):
+        self = super(KeyValueClass1, self).init()
+        self.key3 = 3
+        self._key4 = "4"
+        self.__private = "private"
+        return self
+
+    def addMultiple(self):
+        self.multiple = KeyValueClass1.alloc().init()
+        self.multiple.level2 = KeyValueClass1.alloc().init()
+        self.multiple.level2.level3 = KeyValueClass1.alloc().init()
+        self.multiple.level2.level3.keyA = "hello"
+        self.multiple.level2.level3.keyB = "world"
+
+    def getKey1(self):
+        return 1
+
+    def get_key2(self):
+        return 2
+
+
+    def setKey4(self, value):
+        self._key4 = value * 4
+
+    def set_key5(self, value):
+        self.key5 = value * 5
+
+class KeyValueClass4 (objc.runtime.NSObject):
+    __slots__ = ('foo', )
+
+    def init(self):
+        self = super(KeyValueClass4, self).init()
+        self.foo = "foobar"
+        return self
+
+    # Definition for property 'bar'. Use odd names for the methods
+    # because the KeyValue support recognizes the usual names.
+    def read_bar(self):
+        return self.foo + self.foo
+
+    def write_bar (self, value):
+        self.foo = value + value
+
+    bar = property(read_bar, write_bar)
+
+    roprop = property(lambda self: "read-only")
+
+class PyKeyValueCoding (unittest.TestCase):
+    def testNoPrivateVars(self):
+        # Private instance variables ('anObject.__value') are not accessible using
+        # key-value coding.
+        o = KeyValueClass1.alloc().init()
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 0, o, "private")
+
+    def testValueForKey(self):
+        o = KeyValueClass1.alloc().init()
+        o.addMultiple()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "key1"), 1)
+
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "key2"), 2)
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "key3"), 3)
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "key4"), "4")
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "multiple"), o.multiple)
+       
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 0, o, "nokey")
+
+    def testValueForKey2(self):
+        o = KeyValueClass4.alloc().init()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "foo"), "foobar")
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "bar"), "foobarfoobar")
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "roprop"), "read-only")
+
+
+    def testStoredValueForKey(self):
+        o = KeyValueClass1.alloc().init()
+        o.addMultiple()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "key1"), 1)
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "key2"), 2)
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "key3"), 3)
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "key4"), "4")
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "multiple"), o.multiple)
+       
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 2, o, "nokey")
+
+    def testStoredValueForKey2(self):
+        o = KeyValueClass4.alloc().init()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "foo"), "foobar")
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "bar"), "foobarfoobar")
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "roprop"), "read-only")
+
+    def testValueForKeyPath(self):
+        o = KeyValueClass1.alloc().init()
+        o.addMultiple()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(1, o, "multiple"), o.multiple)
+        self.assertEquals(STUB.keyValue_forObject_key_(1, o, "multiple.level2"), o.multiple.level2)
+        self.assertEquals(STUB.keyValue_forObject_key_(1, o, "multiple.level2.level3.keyA"), 
+            o.multiple.level2.level3.keyA)
+        self.assertEquals(STUB.keyValue_forObject_key_(1, o, "multiple.level2.level3.keyB"), 
+            o.multiple.level2.level3.keyB)
+
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 1, o, "multiple.level2.nokey")
+
+    def testValuesForKeys(self):
+        o = KeyValueClass1.alloc().init()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(3, o, ["key1", "key2", "key3", "key4"]), { "key1":1, "key2":2, "key3": 3, "key4": "4"} )
+
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 3, o, ["key1", "key3", "nosuchkey"])
+
+    def testTakeValueForKey(self):
+        o = KeyValueClass1.alloc().init()
+
+        self.assertEquals(o.key3, 3)
+        STUB.setKeyValue_forObject_key_value_(0, o, 'key3', 'drie')
+        self.assertEquals(o.key3, "drie")
+
+        self.assertEquals(o._key4, "4")
+        STUB.setKeyValue_forObject_key_value_(0, o, 'key4', 'vier')
+        self.assert_(not hasattr(o, "key4"))
+        self.assertEquals(o._key4, "viervierviervier")
+
+        o.key5 = 1
+        STUB.setKeyValue_forObject_key_value_(0, o, 'key5', 'V')
+        self.assertEquals(o.key5, "VVVVV")
+
+        self.assert_(not hasattr(o, 'key9'))
+        STUB.setKeyValue_forObject_key_value_(0, o, 'key9', 'IX')
+        self.assert_(hasattr(o, 'key9'))
+        self.assertEquals(o.key9, 'IX')
+
+    def testTakeValueForKey2(self):
+        o = KeyValueClass4.alloc().init()
+
+        self.assertEquals(o.foo, "foobar")
+        STUB.setKeyValue_forObject_key_value_(0, o, 'foo', 'FOO')
+        self.assertEquals(o.foo, "FOO")
+
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 0, o, 'key9', 'IX')
+
+
+    def testTakeStoredValueForKey(self):
+        o = KeyValueClass1.alloc().init()
+
+        self.assertEquals(o.key3, 3)
+        STUB.setKeyValue_forObject_key_value_(2, o, 'key3', 'drie')
+        self.assertEquals(o.key3, "drie")
+        
+        self.assertEquals(o._key4, "4")
+        STUB.setKeyValue_forObject_key_value_(2, o, 'key4', 'vier')
+        self.assertEquals(o._key4, "viervierviervier")
+
+        o.key5 = 1
+        STUB.setKeyValue_forObject_key_value_(2, o, 'key5', 'V')
+        self.assertEquals(o.key5, "VVVVV")
+
+        self.assert_(not hasattr(o, 'key9'))
+        STUB.setKeyValue_forObject_key_value_(2, o, 'key9', 'IX')
+        self.assert_(hasattr(o, 'key9'))
+        self.assertEquals(o.key9, 'IX')
+
+    def testStoredTakeValueForKey2(self):
+        o = KeyValueClass4.alloc().init()
+
+        self.assertEquals(o.foo, "foobar")
+        STUB.setKeyValue_forObject_key_value_(2, o, 'foo', 'FOO')
+        self.assertEquals(o.foo, "FOO")
+
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 2, o, 'key9', 'IX')
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 2, o, 'roprop', 'IX')
+
+    def testTakeValuesFromDictionary(self):
+        o = KeyValueClass1.alloc().init()
+
+        self.assertEquals(o.key3, 3)
+        self.assertEquals(o._key4, "4")
+        o.key5 = 1
+        self.assert_(not hasattr(o, 'key9'))
+
+        STUB.setKeyValue_forObject_key_value_(3, o, None,
+            {
+                'key3': 'drie',
+                'key4': 'vier',
+                'key5': 'V',
+                'key9': 'IX',
+            })
+
+        self.assertEquals(o.key3, "drie")
+        self.assertEquals(o._key4, "viervierviervier")
+        self.assertEquals(o.key5, "VVVVV")
+        self.assert_(hasattr(o, 'key9'))
+        self.assertEquals(o.key9, 'IX')
+
+    def testTakeValuesFromDictionary2(self):
+        o = KeyValueClass4.alloc().init()
+
+        self.assertEquals(o.foo, "foobar")
+        STUB.setKeyValue_forObject_key_value_(3, o, None, { 'foo': 'FOO' })
+        self.assertEquals(o.foo, "FOO")
+
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 3, o, None, { 'key9':  'IX' })
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 3, o, None, { 'roprop':  'IX' })
+
+    def testTakeValueForKeyPath(self):
+        o = KeyValueClass1.alloc().init()
+        o.addMultiple()
+
+        self.assertEquals(o.multiple.level2.level3.keyA, "hello")
+        self.assertEquals(o.multiple.level2.level3.keyB, "world")
+
+        STUB.setKeyValue_forObject_key_value_(1, o, "multiple.level2.level3.keyA", "KeyAValue")
+        self.assertEquals(o.multiple.level2.level3.keyA, "KeyAValue")
+
+        STUB.setKeyValue_forObject_key_value_(1, o, "multiple.level2.level3.keyB", 9.999)
+        self.assertEquals(o.multiple.level2.level3.keyB, 9.999)
+
+
+class TestBaseExceptions (unittest.TestCase):
+    """
+    Check that NSObject implementation of Key-Value coding raises the 
+    exception that we expect it to raise.
+    """
+    def testValueForKey(self):
+        o = objc.runtime.NSObject.alloc().init()
+
+        self.assertRaises(KeyError, o.valueForKey_, "unknownKey")
+
+    def testStoredValueForKey(self):
+        o = objc.runtime.NSObject.alloc().init()
+
+        self.assertRaises(KeyError, o.storedValueForKey_, "unknownKey")
+
+    def testTakeStoredValue(self):
+        o = objc.runtime.NSObject.alloc().init()
+
+        self.assertRaises(KeyError, 
+            o.takeStoredValue_forKey_, "value", "unknownKey")
+
+if __name__ == "__main__":
+    unittest.main()

pyobjc/Lib/Foundation/test/test_nslocalizedstring.py

         # this...
 
         s = NSLocalizedString("hello world", "")
-        objc.recycle_autorelease_pool()
+        objc.recyleAutoreleasePool()
         self.assertEquals (s, "hello world")
         self.assertEquals (s.nsstring().description(), "hello world")
 

pyobjc/Lib/Foundation/test/test_nsundomanager.py

         self.assertEquals(l[0], 1)
 
     def __del__(self):
-        objc.recycle_autorelease_pool()
+        objc.recyleAutoreleasePool()
 
 ## Undo Integer test
 ## From David Eppstein

pyobjc/Lib/PyObjCTools/KeyValueCoding.py

+"""
+Support for Key-Value Coding in Python. This provides a simple functional
+interface to Cocoa's Key-Value coding that also works for regular Python
+objects.
+
+Public API:
+
+    setKey(obj, key, value) -> None
+    setKeyPath (obj, keypath, value) -> None
+
+    getKey(obj, key) -> value
+    getKeyPath (obj, keypath) -> value
+
+A keypath is a string containing a sequence of keys seperated by dots. The
+path is followed by repeated calls to 'getKey'. This can be used to easily
+access nested attributes.
+
+This API is mirroring the 'getattr' and 'setattr' APIs in Python, this makes
+it more natural to work with Key-Value coding from Python. It also doesn't
+require changes to existing Python classes to make use of Key-Value coding,
+making it easier to build applications as a platform independent core with
+a Cocoa GUI layer.
+
+See the Cocoa documentation on the Apple developer website for more 
+information on Key-Value coding. The protocol is basicly used to enable 
+weaker coupling between the view and model layers.
+
+TODO: Add unittests (in test/test_keyvalue.py)
+"""
+
+__all__ = ("getKey", "setKey", "getKeyPath", "setKeyPath")
+
+import objc
+
+def getKey(obj, key):
+    """
+    Get the attribute referenced by 'key'. The key is used
+    to build the name of an attribute, or attribute accessor method.
+
+    The following attributes and accesors at tried (in this order):
+    - Accessor 'getKey'
+    - Accesoor 'get_key'
+    - Attribute 'key'
+    - Attribute '_key'
+
+    If none of these exist, raise KeyError
+    """
+    if isinstance(obj, (objc.objc_object, objc.objc_class)):
+        try:
+            return obj.valueForKey_(key)
+        except ValueError, msg:
+            # This is not entirely correct, should check if this
+            # is the right kind of ValueError before translating 
+            raise KeyError, str(msg)
+
+
+    try:
+        m = getattr(obj, "get" + key.capitalize())
+    except AttributeError:
+        pass
+    else:
+        return m()
+
+    try:
+        m = getattr(obj, "get_" + key)
+    except AttributeError:
+        pass
+    else:
+        return m()
+
+    try:
+        return getattr(obj, key)
+    except AttributeError:
+        pass
+
+    try:
+        return getattr(obj, "_" + key)
+    except AttributeError:
+        pass
+
+    raise KeyError, "Key %s does not exist"%(key,)
+
+def setKey(obj, key, value):
+    """
+    Set the attribute referenced by 'key' to 'value'. The key is used
+    to build the name of an attribute, or attribute accessor method.
+
+    The following attributes and accessors are tried (in this order):
+    - Accessor 'setKey'
+    - Accessor 'set_key'
+    - Attribute '_key'
+    - Attribute 'key'
+
+    Raises KeyError if the key doesn't exist.
+    """
+    if isinstance(obj, (objc.objc_object, objc.objc_class)):
+        try:
+            return obj.takeValue_forKey_(value, key)
+        except ValueError, msg:
+            raise KeyError, str(msg)
+
+    try:
+        m = getattr(obj, 'set' + key.capitalize())
+    except AttributeError:
+        pass
+    else:
+        m(value)
+        return
+
+    try:
+        m = getattr(obj, 'set_' + key)
+    except AttributeError:
+        pass
+    else:
+        m(value)
+        return
+
+    try:
+        o = getattr(obj, "_" + key)
+    except AttributeError:
+        pass
+    else:
+        setattr(obj, "_" + key, value)
+        return
+
+    try:
+        setattr(obj, key, value)
+    except AttributeError:
+        raise KeyError, "Key %s does not exist"%(key,)
+
+def getKeyPath(obj, keypath):
+    """
+    Get the value for the keypath. Keypath is a string containing a
+    path of keys, path elements are seperated by dots.
+    """
+    if isinstance(obj, (objc.objc_object, objc.objc_class)):
+        return obj.valueForKeyPath_(keypath)
+
+    elements = keypath.split('.')
+    cur = obj
+    for e in elements:
+        cur = getKey(cur, e)
+    return cur
+
+def setKeyPath(obj, keypath, value):
+    """
+    Set the value at 'keypath'. The keypath is a string containing a
+    path of keys, seperated by dots.
+    """
+    if isinstance(obj, (objc.objc_object, objc.objc_class)):
+        return obj.takeValue_forKeyPath_(value, keypath)
+
+    elements = keypath.split('.')
+    cur = obj
+    for e in elements[:-1]:
+        cur = getKey(cur, e)
+
+    return setKey(cur, elements[-1], value)

pyobjc/Lib/PyObjCTools/test/test_collections.py

         unittest.main( )
     except SystemExit :
         pass
-    objc.recycle_autorelease_pool()
+    objc.recyleAutoreleasePool()

pyobjc/Lib/PyObjCTools/test/test_keyvalue.py

+"""
+Tests for PyObjCTools.KeyValueCoding
+
+TODO: 
+    - Accessing properties in superclass of ObjC hybrids (see also Foundation.test.test_keyvalue)
+
+NOTE: Testcases here should be synchronized with the Key-Value Coding tests
+in objc.test.test_keyvalue and Foundation.test.test_keyvalue.
+"""
+
+from PyObjCTools.KeyValueCoding import *
+import objc
+import unittest
+
+
+class KeyValueClass5 (object):
+    def __init__(self):
+        self.key3 = 3
+        self._key4 = "4"
+        self.__private = 'private'
+
+    def addMultiple(self):
+        self.multiple = KeyValueClass5()
+        self.multiple.level2 = KeyValueClass5()
+        self.multiple.level2.level3 = KeyValueClass5()
+        self.multiple.level2.level3.keyA = "hello"
+        self.multiple.level2.level3.keyB = "world"
+
+    def getKey1(self):
+        return 1
+
+    def get_key2(self):
+        return 2
+
+    def setKey4(self, value):
+        self._key4 = value * 4
+
+    def set_key5(self, value):
+        self.key5 = value * 5
+
+
+class KeyValueClass6 (object):
+    __slots__ = ('foo', )
+
+    def __init__(self):
+        self.foo = "foobar"
+
+    # Definition for property 'bar'. Use odd names for the methods
+    # because the KeyValue support recognizes the usual names.
+    def read_bar(self):
+        return self.foo + self.foo
+
+    def write_bar (self, value):
+        self.foo = value + value
+
+    bar = property(read_bar, write_bar)
+
+    roprop = property(lambda self: "read-only")
+
+class KeyValueClass7 (objc.runtime.NSObject):
+    def init(self):
+        self = super(KeyValueClass7, self).init()
+        self.key3 = 3
+        self._key4 = "4"
+        self.__private = 'private'
+        return self
+
+    def addMultiple(self):
+        self.multiple = KeyValueClass5()
+        self.multiple.level2 = KeyValueClass5()
+        self.multiple.level2.level3 = KeyValueClass5()
+        self.multiple.level2.level3.keyA = "hello"
+        self.multiple.level2.level3.keyB = "world"
+
+    def getKey1(self):
+        return 1
+
+    def get_key2(self):
+        return 2
+
+    def setKey4(self, value):
+        self._key4 = value * 4
+
+    def set_key5(self, value):
+        self.key5 = value * 5
+
+
+class KeyValueClass8 (objc.runtime.NSObject):
+    __slots__ = ('foo', )
+
+    def init(self):
+        self = super(KeyValueClass8, self).init()
+        self.foo = "foobar"
+        return self
+
+    # Definition for property 'bar'. Use odd names for the methods
+    # because the KeyValue support recognizes the usual names.
+    def read_bar(self):
+        return self.foo + self.foo
+
+    def write_bar (self, value):
+        self.foo = value + value
+
+    bar = property(read_bar, write_bar)
+
+    roprop = property(lambda self: "read-only")
+
+
+
+class PyKeyValueCoding (unittest.TestCase):
+    def testNoPrivateVars(self):
+        # Private instance variables ('anObject.__value') are not accessible using
+        # key-value coding.
+
+        o = KeyValueClass5()
+        self.assertRaises(KeyError, getKey, o, "private")
+
+    def testValueForKey(self):
+        o = KeyValueClass5()
+        o.addMultiple()
+
+        self.assertEquals(getKey(o, "key1"), 1)
+        self.assertEquals(getKey(o, "key2"), 2)
+        self.assertEquals(getKey(o, "key3"), 3)
+        self.assertEquals(getKey(o, "key4"), "4")
+        self.assertEquals(getKey(o, "multiple"), o.multiple)
+       
+        self.assertRaises(KeyError, getKey, o, "nokey")
+
+    def testValueForKey2(self):
+        o = KeyValueClass6()
+
+        self.assertEquals(getKey(o, "foo"), "foobar")
+        self.assertEquals(getKey(o, "bar"), "foobarfoobar")
+        self.assertEquals(getKey(o, "roprop"), "read-only")
+
+    def testValueForKeyPath(self):
+        o = KeyValueClass5()
+        o.addMultiple()
+
+        self.assertEquals(getKeyPath(o, "multiple"), o.multiple)
+        self.assertEquals(getKeyPath(o, "multiple.level2"), o.multiple.level2)
+        self.assertEquals(getKeyPath(o, "multiple.level2.level3.keyA"), o.multiple.level2.level3.keyA)
+        self.assertEquals(getKeyPath(o, "multiple.level2.level3.keyB"), o.multiple.level2.level3.keyB)
+
+        self.assertRaises(KeyError, getKeyPath, o, "multiple.level2.nokey")
+
+    def testTakeValueForKey(self):
+        o = KeyValueClass5()
+
+        self.assertEquals(o.key3, 3)
+        setKey(o, 'key3', 'drie')
+        self.assertEquals(o.key3, "drie")
+        
+        self.assertEquals(o._key4, "4")
+        setKey(o, 'key4', 'vier')
+        self.assertEquals(o._key4, "viervierviervier")
+
+        o.key5 = 1
+        setKey(o, 'key5', 'V')
+        self.assertEquals(o.key5, "VVVVV")
+
+        self.assert_(not hasattr(o, 'key9'))
+        setKey(o, 'key9', 'IX')
+        self.assert_(hasattr(o, 'key9'))
+        self.assertEquals(o.key9, 'IX')
+
+    def testTakeValueForKey2(self):
+        o = KeyValueClass6()
+
+        self.assertEquals(o.foo, "foobar")
+        setKey(o, 'foo', 'FOO')
+        self.assertEquals(o.foo, "FOO")
+
+        self.assertRaises(KeyError, setKey, o, 'key9', 'IX')
+
+    def testTakeValueForKeyPath(self):
+        o = KeyValueClass5()
+        o.addMultiple()
+
+        self.assertEquals(o.multiple.level2.level3.keyA, "hello")
+        self.assertEquals(o.multiple.level2.level3.keyB, "world")
+
+        setKeyPath(o, "multiple.level2.level3.keyA", "KeyAValue")
+        self.assertEquals(o.multiple.level2.level3.keyA, "KeyAValue")
+
+        setKeyPath(o, "multiple.level2.level3.keyB", 9.999)
+        self.assertEquals(o.multiple.level2.level3.keyB, 9.999)
+
+
+class OcKeyValueCoding (unittest.TestCase):
+    def testNoPrivateVars(self):
+        # Private instance variables ('anObject.__value') are not accessible using
+        # key-value coding.
+
+        o = KeyValueClass7.alloc().init()
+        self.assertRaises(KeyError, getKey, o, "private")
+
+    def testValueForKey(self):
+        o = KeyValueClass7.alloc().init()
+        o.addMultiple()
+
+        self.assertEquals(getKey(o, "key1"), 1)
+        self.assertEquals(getKey(o, "key2"), 2)
+        self.assertEquals(getKey(o, "key3"), 3)
+        self.assertEquals(getKey(o, "key4"), "4")
+        self.assertEquals(getKey(o, "multiple"), o.multiple)
+       
+        self.assertRaises(KeyError, getKey, o, "nokey")
+
+    def testValueForKey2(self):
+        o = KeyValueClass8.alloc().init()
+
+        self.assertEquals(getKey(o, "foo"), "foobar")
+        self.assertEquals(getKey(o, "bar"), "foobarfoobar")
+        self.assertEquals(getKey(o, "roprop"), "read-only")
+
+    def testValueForKeyPath(self):
+        o = KeyValueClass7.alloc().init()
+        o.addMultiple()
+
+        self.assertEquals(getKeyPath(o, "multiple"), o.multiple)
+        self.assertEquals(getKeyPath(o, "multiple.level2"), o.multiple.level2)
+        self.assertEquals(getKeyPath(o, "multiple.level2.level3.keyA"), o.multiple.level2.level3.keyA)
+        self.assertEquals(getKeyPath(o, "multiple.level2.level3.keyB"), o.multiple.level2.level3.keyB)
+
+        self.assertRaises(KeyError, getKeyPath, o, "multiple.level2.nokey")
+
+    def testTakeValueForKey(self):
+        o = KeyValueClass7.alloc().init()
+
+        self.assertEquals(o.key3, 3)
+        setKey(o, 'key3', 'drie')
+        self.assertEquals(o.key3, "drie")
+        
+        self.assertEquals(o._key4, "4")
+        setKey(o, 'key4', 'vier')
+        self.assertEquals(o._key4, "viervierviervier")
+
+        o.key5 = 1
+        setKey(o, 'key5', 'V')
+        self.assertEquals(o.key5, "VVVVV")
+
+        self.assert_(not hasattr(o, 'key9'))
+        setKey(o, 'key9', 'IX')
+        self.assert_(hasattr(o, 'key9'))
+        self.assertEquals(o.key9, 'IX')
+
+    def testTakeValueForKey2(self):
+        o = KeyValueClass8.alloc().init()
+
+        self.assertEquals(o.foo, "foobar")
+        setKey(o, 'foo', 'FOO')
+        self.assertEquals(o.foo, "FOO")
+
+        self.assertRaises(KeyError, setKey, o, 'key9', 'IX')
+
+    def testTakeValueForKeyPath(self):
+        o = KeyValueClass7.alloc().init()
+        o.addMultiple()
+
+        self.assertEquals(o.multiple.level2.level3.keyA, "hello")
+        self.assertEquals(o.multiple.level2.level3.keyB, "world")
+
+        setKeyPath(o, "multiple.level2.level3.keyA", "KeyAValue")
+        self.assertEquals(o.multiple.level2.level3.keyA, "KeyAValue")
+
+        setKeyPath(o, "multiple.level2.level3.keyB", 9.999)
+        self.assertEquals(o.multiple.level2.level3.keyB, 9.999)
+
+if __name__ == "__main__":
+    unittest.main()

pyobjc/Lib/ScreenSaver/__init__.py

 del AppKit
 
 # Custom method signature (undocumented class, this is a guess)
-objc.set_signature_for_selector("ScreenSaverUserInfo", "loginUserName:andID:", "v@:o^@o^I")
+objc.setSignatureForSelector("ScreenSaverUserInfo", "loginUserName:andID:", "v@:o^@o^I")
 
 objc.loadBundle("ScreenSaver", globals(), bundle_path="/System/Library/Frameworks/ScreenSaver.framework")
 

pyobjc/Lib/WebKit/__init__.py

 """
 
 import AppKit
-#import _WebKitSignatures
+del AppKit
 import objc as _objc
 
 # We first register special methods signatures with the runtime. The module
 
 from _WebKit import *
 
-
-# We try to import a module containing support code, the code
-# is only ever used from the C side.
-#import _WebKitMapping 
-
 # Load the Cocoa bundle, and gather all classes defined there
 _objc.loadBundle("WebKit", globals(), bundle_path="/System/Library/Frameworks/WebKit.framework")
-_objc.recycle_autorelease_pool()
+_objc.recyleAutoreleasePool()
 
 import protocols  # no need to export these, just register with PyObjC
+del _objc

pyobjc/Lib/objc/_FoundationSignatures.py

 # Generated from 'Lib/Foundation/Foundation.byref'.
 #
 #
-from objc import set_signature_for_selector
+from objc import setSignatureForSelector
 
-set_signature_for_selector("NSScanner", "scanCharactersFromSet:intoString:", "c@:@o^@")
-set_signature_for_selector("NSScanner", "scanDouble:", "c@:o^d")
-set_signature_for_selector("NSScanner", "scanFloat:", "c@:o^f")
-set_signature_for_selector("NSScanner", "scanHexInt:", "c@:o^I")
-set_signature_for_selector("NSScanner", "scanInt:", "c@:o^i")
-set_signature_for_selector("NSScanner", "scanLongLong:", "c@:o^q")
-set_signature_for_selector("NSScanner", "scanString:intoString:", "c@:@o^@")
-set_signature_for_selector("NSScanner", "scanUpToCharactersFromSet:intoString:", "c@:@o^@")
-set_signature_for_selector("NSScanner", "scanUpToString:intoString:", "c@:@o^@")
-set_signature_for_selector("NSString", "completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:", "Io^@co^@@")
-set_signature_for_selector("NSString", "getLineStart:end:contentsEnd:forRange:", "v@:o^Io^Io^I{_NSRange=II}")
-set_signature_for_selector("NSMutableAttributedString", "readFromURL:options:documentAttributes:", "c@:@@o^@")
-set_signature_for_selector("NSAttributedString", "attribute:atIndex:effectiveRange:", "@0@4:8@12I16o^{_NSRange=II}20")
-set_signature_for_selector("NSAttributedString", "attribute:atIndex:longestEffectiveRange:inRange:", "@0@4:8@12I16o^{_NSRange=II}20{_NSRange=II}24")
-set_signature_for_selector("NSAttributedString", "attributesAtIndex:effectiveRange:", "@0@4:8I12o^{_NSRange=II}16")
-set_signature_for_selector("NSAttributedString", "attributesAtIndex:longestEffectiveRange:inRange:", "@0@4:8I12o^{_NSRange=II}16{_NSRange=II}20")
-set_signature_for_selector("NSAttributedString", "initWithHTML:baseURL:documentAttributes:", "@0@4:8@12@16o^@20")
-set_signature_for_selector("NSAttributedString", "initWithHTML:documentAttributes:", "@@:@o^@")
-set_signature_for_selector("NSAttributedString", "initWithPath:documentAttributes:", "@@:@o^@")
-set_signature_for_selector("NSAttributedString", "initWithRTFDFileWrapper:documentAttributes:", "@@:@o^@")
-set_signature_for_selector("NSAttributedString", "initWithRTFD:documentAttributes:", "@0@4:8@12o^@16")
-set_signature_for_selector("NSAttributedString", "initWithRTF:documentAttributes:", "@0@4:8@12o^@16")
-set_signature_for_selector("NSAttributedString", "initWithURL:documentAttributes:", "@0@4:8@12o^@16")
-set_signature_for_selector("NSFileManager", "fileExistsAtPath:isDirectory:", "c0@4:8@12o^c16")
-set_signature_for_selector("NSArray", "getObject:atIndex:", "c@:o^@I")
-set_signature_for_selector("NSCalendarDate", "years:months:days:hours:minutes:seconds:sinceDate:", "v@:o^io^io^io^io^io^i@")
-set_signature_for_selector("NSPropertyListSerialization", "dataFromPropertyList:format:errorDescription:", "@@:@io^@")
-set_signature_for_selector("NSPropertyListSerialization", "propertyListFromData:mutabilityOption:format:errorDescription:", "@@:@iN^io^@")
-set_signature_for_selector("NSAppleScript", "_initWithContentsOfFile:error:", "@@:@o^@")
-set_signature_for_selector("NSAppleScript", "_initWithData:error:", "@@:@o^@")
-set_signature_for_selector("NSAppleScript", "compileAndReturnError:", "c@:o^@")
-set_signature_for_selector("NSAppleScript", "executeAndReturnError:", "@@:o^@")
-set_signature_for_selector("NSAppleScript", "executeAppleEvent:error:", "@@:@o^@")
-set_signature_for_selector("NSAppleScript", "initWithContentsOfURL:error:", "@@:@o^@")
-set_signature_for_selector("NSFaultHandler", "extraData", "i@:")
-set_signature_for_selector("NSFaultHandler", "setTargetClass:extraData:", "v@:#i")
-set_signature_for_selector("NSFormatter", "getObjectValue:forString:errorDescription:", "c@:o^@@o^@")
-set_signature_for_selector("NSFormatter", "isPartialStringValid:newEditingString:errorDescription:", "c@:@o^@o^@")
-set_signature_for_selector("NSFormatter", "isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:", "c0@4:8o^@12o^{_NSRange=II}16@20{_NSRange=II}24o^@32")
+setSignatureForSelector("NSScanner", "scanCharactersFromSet:intoString:", "c@:@o^@")
+setSignatureForSelector("NSScanner", "scanDouble:", "c@:o^d")
+setSignatureForSelector("NSScanner", "scanFloat:", "c@:o^f")
+setSignatureForSelector("NSScanner", "scanHexInt:", "c@:o^I")
+setSignatureForSelector("NSScanner", "scanInt:", "c@:o^i")
+setSignatureForSelector("NSScanner", "scanLongLong:", "c@:o^q")
+setSignatureForSelector("NSScanner", "scanString:intoString:", "c@:@o^@")
+setSignatureForSelector("NSScanner", "scanUpToCharactersFromSet:intoString:", "c@:@o^@")
+setSignatureForSelector("NSScanner", "scanUpToString:intoString:", "c@:@o^@")
+setSignatureForSelector("NSString", "completePathIntoString:caseSensitive:matchesIntoArray:filterTypes:", "Io^@co^@@")
+setSignatureForSelector("NSString", "getLineStart:end:contentsEnd:forRange:", "v@:o^Io^Io^I{_NSRange=II}")
+setSignatureForSelector("NSMutableAttributedString", "readFromURL:options:documentAttributes:", "c@:@@o^@")
+setSignatureForSelector("NSAttributedString", "attribute:atIndex:effectiveRange:", "@0@4:8@12I16o^{_NSRange=II}20")
+setSignatureForSelector("NSAttributedString", "attribute:atIndex:longestEffectiveRange:inRange:", "@0@4:8@12I16o^{_NSRange=II}20{_NSRange=II}24")
+setSignatureForSelector("NSAttributedString", "attributesAtIndex:effectiveRange:", "@0@4:8I12o^{_NSRange=II}16")
+setSignatureForSelector("NSAttributedString", "attributesAtIndex:longestEffectiveRange:inRange:", "@0@4:8I12o^{_NSRange=II}16{_NSRange=II}20")
+setSignatureForSelector("NSAttributedString", "initWithHTML:baseURL:documentAttributes:", "@0@4:8@12@16o^@20")
+setSignatureForSelector("NSAttributedString", "initWithHTML:documentAttributes:", "@@:@o^@")
+setSignatureForSelector("NSAttributedString", "initWithPath:documentAttributes:", "@@:@o^@")
+setSignatureForSelector("NSAttributedString", "initWithRTFDFileWrapper:documentAttributes:", "@@:@o^@")
+setSignatureForSelector("NSAttributedString", "initWithRTFD:documentAttributes:", "@0@4:8@12o^@16")
+setSignatureForSelector("NSAttributedString", "initWithRTF:documentAttributes:", "@0@4:8@12o^@16")
+setSignatureForSelector("NSAttributedString", "initWithURL:documentAttributes:", "@0@4:8@12o^@16")
+setSignatureForSelector("NSFileManager", "fileExistsAtPath:isDirectory:", "c0@4:8@12o^c16")
+setSignatureForSelector("NSArray", "getObject:atIndex:", "c@:o^@I")
+setSignatureForSelector("NSCalendarDate", "years:months:days:hours:minutes:seconds:sinceDate:", "v@:o^io^io^io^io^io^i@")
+setSignatureForSelector("NSPropertyListSerialization", "dataFromPropertyList:format:errorDescription:", "@@:@io^@")
+setSignatureForSelector("NSPropertyListSerialization", "propertyListFromData:mutabilityOption:format:errorDescription:", "@@:@iN^io^@")
+setSignatureForSelector("NSAppleScript", "_initWithContentsOfFile:error:", "@@:@o^@")
+setSignatureForSelector("NSAppleScript", "_initWithData:error:", "@@:@o^@")
+setSignatureForSelector("NSAppleScript", "compileAndReturnError:", "c@:o^@")
+setSignatureForSelector("NSAppleScript", "executeAndReturnError:", "@@:o^@")
+setSignatureForSelector("NSAppleScript", "executeAppleEvent:error:", "@@:@o^@")
+setSignatureForSelector("NSAppleScript", "initWithContentsOfURL:error:", "@@:@o^@")
+setSignatureForSelector("NSFaultHandler", "extraData", "i@:")
+setSignatureForSelector("NSFaultHandler", "setTargetClass:extraData:", "v@:#i")
+setSignatureForSelector("NSFormatter", "getObjectValue:forString:errorDescription:", "c@:o^@@o^@")
+setSignatureForSelector("NSFormatter", "isPartialStringValid:newEditingString:errorDescription:", "c@:@o^@o^@")
+setSignatureForSelector("NSFormatter", "isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:", "c0@4:8o^@12o^{_NSRange=II}16@20{_NSRange=II}24o^@32")

pyobjc/Lib/objc/__init__.py

 ##
 ## Disable gc -- blows up w/Python 2.2.0
 ##
-## XXX Fix me: This is probably a bug in PyObjC, need to check why this
-## fails on Python 2.2.0 and not on Python 2.2.2. Copying gcmodule.c from
-## Python 2.2.2 to 2.2.0 causes the crash to go away...
 import sys
 if sys.version_info[:3] == (2,2,0):
     import gc
 #
 # Interface builder support.
 #
-IBOutlet = lambda name: ivar(name, isOutlet=1)
+def IBOutlet(name):
+    """
+    Create an instance variable that can be used as an outlet in
+    Interface Builder.
+    """
+    return ivar(name, isOutlet=1)
 
 def IBAction(func):
     """
         sel = selector(method, selector=name)
 
     return classAddMethods(cls, [sel])
+
+######
+# Backward compatibility stuff
+# (depricated functionality)
+
+def recycle_autorelease_pool():
+    """Depricated: Use recycleAutoreleasePool"""
+    import warnings
+    warings.warn(
+        "Use recycleAutoreleasePool instead of recycle_autorelease_pool",
+        DeprecationWarning)
+    recycleAutoreleasePool()

pyobjc/Lib/objc/_convenience.py

 TODO:
 - Add external interface: Framework specific modules may want to add to this.
 """
-from objc import set_class_extender, selector, runtime
+from objc import setClassExtender, selector, runtime
 
 CONVENIENCE_METHODS = {}
 CLASS_METHODS = {}
         for name, value in CLASS_METHODS[name]:
             type_dict[name] = value
 
-set_class_extender(add_convenience_methods)
+setClassExtender(add_convenience_methods)
 
 # NOTE: the '!= 0' in the definition of the comparison function
 # is there to force conversion to type 'bool' on Python releases

pyobjc/Lib/objc/test/test_allocatebuffer.py

 
 if __name__ == '__main__':
     unittest.main()
-    objc.recycle_autorelease_pool()
+    objc.recyleAutoreleasePool()

pyobjc/Lib/objc/test/test_ivar.py

         self.deleted = 0
         self.object.idVar = Base(lambda : setattr(self, 'deleted', 1))
         self.object.idVar = None
-        objc.recycle_autorelease_pool()
+        objc.recyleAutoreleasePool()
         self.assertEquals(self.deleted, 1)
 
     def testLeak2(self):
         self.deleted = 0
         self.object.idVar = Base(lambda : setattr(self, 'deleted', 1))
         del self.object
-        objc.recycle_autorelease_pool()
+        objc.recyleAutoreleasePool()
         self.assertEquals(self.deleted, 1)
 
     def testOCLeak(self):
         self.deleted = 0
         self.object.idVar = OCBase.alloc().init_(lambda : setattr(self, 'deleted', 1))
         self.object.idVar = None
-        objc.recycle_autorelease_pool()
+        objc.recyleAutoreleasePool()
         self.assertEquals(self.deleted, 1)
 
     def testOCLeak2(self):
         self.deleted = 0
         self.object.idVar = OCBase.alloc().init_(lambda : setattr(self, 'deleted', 1))
         del self.object
-        objc.recycle_autorelease_pool()
+        objc.recyleAutoreleasePool()
         self.assertEquals(self.deleted, 1)
 
     def testDelete(self):

pyobjc/Lib/objc/test/test_keyvalue.py

+"""
+Tests for the Key-Value Coding support in OC_PythonObject
+
+NOTE: Testcases here should be synchronized with the Key-Value Coding tests
+in PyObjCTools.test.test_keyvalue and Foundation.test.test_keyvalue.
+"""
+import objc
+import unittest
+
+# Native code is needed to access the python class from Objective-C, otherwise
+# the Key-Value support cannot be tested.
+from objc.test.testbndl import PyObjC_TestClass3 as STUB
+
+class KeyValueClass2 (object):
+    def __init__(self):
+        self.key3 = 3
+        self._key4 = "4"
+        self.__private = 'private'
+
+    def addMultiple(self):
+        self.multiple = KeyValueClass2()
+        self.multiple.level2 = KeyValueClass2()
+        self.multiple.level2.level3 = KeyValueClass2()
+        self.multiple.level2.level3.keyA = "hello"
+        self.multiple.level2.level3.keyB = "world"
+
+    def getKey1(self):
+        return 1
+
+    def get_key2(self):
+        return 2
+
+    def setKey4(self, value):
+        self._key4 = value * 4
+
+    def set_key5(self, value):
+        self.key5 = value * 5
+
+
+class KeyValueClass3 (object):
+    __slots__ = ('foo', )
+
+    def __init__(self):
+        self.foo = "foobar"
+
+    # Definition for property 'bar'. Use odd names for the methods
+    # because the KeyValue support recognizes the usual names.
+    def read_bar(self):
+        return self.foo + self.foo
+
+    def write_bar (self, value):
+        self.foo = value + value
+
+    bar = property(read_bar, write_bar)
+
+    roprop = property(lambda self: "read-only")
+
+class PyKeyValueCoding (unittest.TestCase):
+    def testNoPrivateVars(self):
+        # Private instance variables ('anObject.__value') are not accessible using
+        # key-value coding.
+        o = KeyValueClass2()
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 0, o, "private")
+
+    def testValueForKey(self):
+        o = KeyValueClass2()
+        o.addMultiple()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "key1"), 1)
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "key2"), 2)
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "key3"), 3)
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "key4"), "4")
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "multiple"), o.multiple)
+       
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 0, o, "nokey")
+
+    def testValueForKey2(self):
+        o = KeyValueClass3()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "foo"), "foobar")
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "bar"), "foobarfoobar")
+        self.assertEquals(STUB.keyValue_forObject_key_(0, o, "roprop"), "read-only")
+
+    def testStoredValueForKey(self):
+        o = KeyValueClass2()
+        o.addMultiple()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "key1"), 1)
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "key2"), 2)
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "key3"), 3)
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "key4"), "4")
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "multiple"), o.multiple)
+       
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 2, o, "nokey")
+
+    def testStoredValueForKey2(self):
+        o = KeyValueClass3()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "foo"), "foobar")
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "bar"), "foobarfoobar")
+        self.assertEquals(STUB.keyValue_forObject_key_(2, o, "roprop"), "read-only")
+
+    def testValueForKeyPath(self):
+        o = KeyValueClass2()
+        o.addMultiple()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(1, o, "multiple"), o.multiple)
+        self.assertEquals(STUB.keyValue_forObject_key_(1, o, "multiple.level2"), o.multiple.level2)
+        self.assertEquals(STUB.keyValue_forObject_key_(1, o, "multiple.level2.level3.keyA"), o.multiple.level2.level3.keyA)
+        self.assertEquals(STUB.keyValue_forObject_key_(1, o, "multiple.level2.level3.keyB"), o.multiple.level2.level3.keyB)
+
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 1, o, "multiple.level2.nokey")
+
+    def testValuesForKeys(self):
+        o = KeyValueClass2()
+
+        self.assertEquals(STUB.keyValue_forObject_key_(3, o, ["key1", "key2", "key3", "key4"]), { "key1":1, "key2": 2, "key3": 3, "key4": "4"} )
+
+        self.assertRaises(KeyError, STUB.keyValue_forObject_key_, 3, o, [ "key1", "key2", "nokey", "key3" ])
+
+    def testTakeValueForKey(self):
+        o = KeyValueClass2()
+
+        self.assertEquals(o.key3, 3)
+        STUB.setKeyValue_forObject_key_value_(0, o, 'key3', 'drie')
+        self.assertEquals(o.key3, "drie")
+        
+        self.assertEquals(o._key4, "4")
+        STUB.setKeyValue_forObject_key_value_(0, o, 'key4', 'vier')
+        self.assertEquals(o._key4, "viervierviervier")
+
+        o.key5 = 1
+        STUB.setKeyValue_forObject_key_value_(0, o, 'key5', 'V')
+        self.assertEquals(o.key5, "VVVVV")
+
+        self.assert_(not hasattr(o, 'key9'))
+        STUB.setKeyValue_forObject_key_value_(0, o, 'key9', 'IX')
+        self.assert_(hasattr(o, 'key9'))
+        self.assertEquals(o.key9, 'IX')
+
+    def testTakeValueForKey2(self):
+        o = KeyValueClass3()
+
+        self.assertEquals(o.foo, "foobar")
+        STUB.setKeyValue_forObject_key_value_(0, o, 'foo', 'FOO')
+        self.assertEquals(o.foo, "FOO")
+
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 0, o, 'key9', 'IX')
+
+    def testTakeStoredValueForKey(self):
+        o = KeyValueClass2()
+
+        self.assertEquals(o.key3, 3)
+        STUB.setKeyValue_forObject_key_value_(2, o, 'key3', 'drie')
+        self.assertEquals(o.key3, "drie")
+        
+        self.assertEquals(o._key4, "4")
+        STUB.setKeyValue_forObject_key_value_(2, o, 'key4', 'vier')
+        self.assertEquals(o._key4, "viervierviervier")
+
+        o.key5 = 1
+        STUB.setKeyValue_forObject_key_value_(2, o, 'key5', 'V')
+        self.assertEquals(o.key5, "VVVVV")
+
+        self.assert_(not hasattr(o, 'key9'))
+        STUB.setKeyValue_forObject_key_value_(2, o, 'key9', 'IX')
+        self.assert_(hasattr(o, 'key9'))
+        self.assertEquals(o.key9, 'IX')
+
+    def testStoredTakeValueForKey2(self):
+        o = KeyValueClass3()
+
+        self.assertEquals(o.foo, "foobar")
+        STUB.setKeyValue_forObject_key_value_(2, o, 'foo', 'FOO')
+        self.assertEquals(o.foo, "FOO")
+
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 2, o, 'key9', 'IX')
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 2, o, 'roprop', 'IX')
+
+    def testTakeValuesFromDictionary(self):
+        o = KeyValueClass2()
+
+        self.assertEquals(o.key3, 3)
+        self.assertEquals(o._key4, "4")
+        o.key5 = 1
+        self.assert_(not hasattr(o, 'key9'))
+
+        STUB.setKeyValue_forObject_key_value_(3, o, None,
+            {
+                'key3': 'drie',
+                'key4': 'vier',
+                'key5': 'V',
+                'key9': 'IX',
+            })
+
+        self.assertEquals(o.key3, "drie")
+        self.assertEquals(o._key4, "viervierviervier")
+        self.assertEquals(o.key5, "VVVVV")
+        self.assert_(hasattr(o, 'key9'))
+        self.assertEquals(o.key9, 'IX')
+
+    def testTakeValuesFromDictionary2(self):
+        o = KeyValueClass3()
+
+        self.assertEquals(o.foo, "foobar")
+        STUB.setKeyValue_forObject_key_value_(3, o, None, { 'foo': 'FOO' })
+        self.assertEquals(o.foo, "FOO")
+
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 3, o, None, { 'key9':  'IX' })
+        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, 3, o, None, { 'roprop':  'IX' })
+
+    def testTakeValueForKeyPath(self):
+        o = KeyValueClass2()
+        o.addMultiple()
+
+        self.assertEquals(o.multiple.level2.level3.keyA, "hello")
+        self.assertEquals(o.multiple.level2.level3.keyB, "world")
+
+        STUB.setKeyValue_forObject_key_value_(1, o, "multiple.level2.level3.keyA", "KeyAValue")
+        self.assertEquals(o.multiple.level2.level3.keyA, "KeyAValue")
+
+        STUB.setKeyValue_forObject_key_value_(1, o, "multiple.level2.level3.keyB", 9.999)
+        self.assertEquals(o.multiple.level2.level3.keyB, 9.999)
+
+if __name__ == "__main__":
+    unittest.main()

pyobjc/Lib/objc/test/test_leaks.py

         LeaksDel = 0
         self.assertEquals(LeaksDel, 0)
         c = NSMutableArray.arrayWithArray_([ LeaksClass.alloc().init() ])
-        objc.recycle_autorelease_pool()
+        objc.recyleAutoreleasePool()
 
         self.assert_(c is not None)
         self.assertEquals(LeaksDel, 0)
         c = NSMutableArray.alloc()
         c = c.initWithArray_(
             [ LeaksClass.alloc().init() ])
-        objc.recycle_autorelease_pool()
+        objc.recyleAutoreleasePool()
 
         self.assert_(c is not None)
         self.assertEquals(LeaksDel, 0)

pyobjc/Lib/objc/test/test_methods.py

 import struct
 
 # Can't set the right signatures in plain Objective-C.
-set_signature = objc.set_signature_for_selector
-set_signature("OC_TestClass1", "passInOutChar:", "v@:N^c")
-set_signature("OC_TestClass1", "passOutChar:", "v@:o^c")
-set_signature("OC_TestClass1", "passInChar:", "c@:n^c")
-set_signature("OC_TestClass1", "passInOutUChar:", "v@:N^C")
-set_signature("OC_TestClass1", "passOutUChar:", "v@:o^C")
-set_signature("OC_TestClass1", "passInUChar:", "I@:n^C")
-set_signature("OC_TestClass1", "passInOutShort:", "v@:N^s")
-set_signature("OC_TestClass1", "passOutShort:", "v@:o^s")
-set_signature("OC_TestClass1", "passInShort:", "i@:n^s")
-set_signature("OC_TestClass1", "passInOutUShort:", "v@:N^S")
-set_signature("OC_TestClass1", "passOutUShort:", "v@:o^S")
-set_signature("OC_TestClass1", "passInUShort:", "I@:n^S")
-set_signature("OC_TestClass1", "passInOutInt:", "v@:N^i")
-set_signature("OC_TestClass1", "passOutInt:", "v@:o^i")
-set_signature("OC_TestClass1", "passInInt:", "i@:n^i")
-set_signature("OC_TestClass1", "passInOutUInt:", "v@:N^I")
-set_signature("OC_TestClass1", "passOutUInt:", "v@:o^I")
-set_signature("OC_TestClass1", "passInUInt:", "I@:n^I")
-set_signature("OC_TestClass1", "passInOutLong:", "v@:N^l")
-set_signature("OC_TestClass1", "passOutLong:", "v@:o^l")
-set_signature("OC_TestClass1", "passInLong:", "l@:n^l")
-set_signature("OC_TestClass1", "passInOutULong:", "v@:N^L")
-set_signature("OC_TestClass1", "passOutULong:", "v@:o^L")
-set_signature("OC_TestClass1", "passInULong:", "L@:n^L")
-set_signature("OC_TestClass1", "passInOutLongLong:", "v@:N^q")
-set_signature("OC_TestClass1", "passOutLongLong:", "v@:o^q")
-set_signature("OC_TestClass1", "passInLongLong:", "q@:n^q")
-set_signature("OC_TestClass1", "passInOutULongLong:", "v@:N^Q")
-set_signature("OC_TestClass1", "passOutULongLong:", "v@:o^Q")
-set_signature("OC_TestClass1", "passInULongLong:", "Q@:n^Q")
-set_signature("OC_TestClass1", "passInOutFloat:", "v@:N^f")
-set_signature("OC_TestClass1", "passOutFloat:", "v@:o^f")
-set_signature("OC_TestClass1", "passInFloat:", "f@:n^f")
-set_signature("OC_TestClass1", "passInOutDouble:", "v@:N^d")
-set_signature("OC_TestClass1", "passOutDouble:", "v@:o^d")
-set_signature("OC_TestClass1", "passInDouble:", "d@:n^d")
-set_signature("OC_TestClass1", "passInOutCharp:", "v@:N^*")
-set_signature("OC_TestClass1", "passOutCharp:", "v@:o^*")
-set_signature("OC_TestClass1", "passInCharp:", "*@:n^*")
-set_signature("OC_TestClass1", "passInOutID:", "v@:N^@")
-set_signature("OC_TestClass1", "passOutID:", "v@:o^@")
-set_signature("OC_TestClass1", "passInID:", "@@:n^@")
+setSignature = objc.setSignatureForSelector
+setSignature("OC_TestClass1", "passInOutChar:", "v@:N^c")
+setSignature("OC_TestClass1", "passOutChar:", "v@:o^c")
+setSignature("OC_TestClass1", "passInChar:", "c@:n^c")
+setSignature("OC_TestClass1", "passInOutUChar:", "v@:N^C")
+setSignature("OC_TestClass1", "passOutUChar:", "v@:o^C")
+setSignature("OC_TestClass1", "passInUChar:", "I@:n^C")
+setSignature("OC_TestClass1", "passInOutShort:", "v@:N^s")
+setSignature("OC_TestClass1", "passOutShort:", "v@:o^s")
+setSignature("OC_TestClass1", "passInShort:", "i@:n^s")
+setSignature("OC_TestClass1", "passInOutUShort:", "v@:N^S")
+setSignature("OC_TestClass1", "passOutUShort:", "v@:o^S")
+setSignature("OC_TestClass1", "passInUShort:", "I@:n^S")
+setSignature("OC_TestClass1", "passInOutInt:", "v@:N^i")
+setSignature("OC_TestClass1", "passOutInt:", "v@:o^i")
+setSignature("OC_TestClass1", "passInInt:", "i@:n^i")
+setSignature("OC_TestClass1", "passInOutUInt:", "v@:N^I")
+setSignature("OC_TestClass1", "passOutUInt:", "v@:o^I")
+setSignature("OC_TestClass1", "passInUInt:", "I@:n^I")
+setSignature("OC_TestClass1", "passInOutLong:", "v@:N^l")
+setSignature("OC_TestClass1", "passOutLong:", "v@:o^l")
+setSignature("OC_TestClass1", "passInLong:", "l@:n^l")
+setSignature("OC_TestClass1", "passInOutULong:", "v@:N^L")
+setSignature("OC_TestClass1", "passOutULong:", "v@:o^L")
+setSignature("OC_TestClass1", "passInULong:", "L@:n^L")
+setSignature("OC_TestClass1", "passInOutLongLong:", "v@:N^q")
+setSignature("OC_TestClass1", "passOutLongLong:", "v@:o^q")
+setSignature("OC_TestClass1", "passInLongLong:", "q@:n^q")
+setSignature("OC_TestClass1", "passInOutULongLong:", "v@:N^Q")
+setSignature("OC_TestClass1", "passOutULongLong:", "v@:o^Q")
+setSignature("OC_TestClass1", "passInULongLong:", "Q@:n^Q")
+setSignature("OC_TestClass1", "passInOutFloat:", "v@:N^f")
+setSignature("OC_TestClass1", "passOutFloat:", "v@:o^f")
+setSignature("OC_TestClass1", "passInFloat:", "f@:n^f")
+setSignature("OC_TestClass1", "passInOutDouble:", "v@:N^d")
+setSignature("OC_TestClass1", "passOutDouble:", "v@:o^d")
+setSignature("OC_TestClass1", "passInDouble:", "d@:n^d")
+setSignature("OC_TestClass1", "passInOutCharp:", "v@:N^*")
+setSignature("OC_TestClass1", "passOutCharp:", "v@:o^*")
+setSignature("OC_TestClass1", "passInCharp:", "*@:n^*")
+setSignature("OC_TestClass1", "passInOutID:", "v@:N^@")
+setSignature("OC_TestClass1", "passOutID:", "v@:o^@")
+setSignature("OC_TestClass1", "passInID:", "@@:n^@")
 
 from objc.test.testbndl import *
 

pyobjc/Lib/objc/test/test_methods2.py

 NSArray = objc.runtime.NSArray
 
 # First make sure that the pass-by-reference methods have the correct signature
-set_signature = objc.set_signature_for_selector
-set_signature("PyObjC_TestClass1", "BOOLInOutArg:", "@@:N^c")
-set_signature("PyObjC_TestClass1", "BOOLOutArg:", "v@:o^c")
-set_signature("PyObjC_TestClass1", "BOOLInArg:", "@@:n^c")
-set_signature("PyObjC_TestClass2", "callBOOLInOutArg:of:", "@@:N^c@")
-set_signature("PyObjC_TestClass2", "callBOOLOutArg:of:", "v@:o^c@")
-set_signature("PyObjC_TestClass2", "callBOOLInArg:of:", "@@:n^c@")
-set_signature("PyObjC_TestClass2", "invokeBOOLInOutArg:of:", "@@:N^c@")
-set_signature("PyObjC_TestClass2", "invokeBOOLOutArg:of:", "v@:o^c@")
-set_signature("PyObjC_TestClass2", "invokeBOOLInArg:of:", "@@:n^c@")
-set_signature("PyObjC_TestClass1", "charInOutArg:", "@@:N^c")
-set_signature("PyObjC_TestClass1", "charOutArg:", "v@:o^c")
-set_signature("PyObjC_TestClass1", "charInArg:", "@@:n^c")
-set_signature("PyObjC_TestClass2", "callcharInOutArg:of:", "@@:N^c@")
-set_signature("PyObjC_TestClass2", "callcharOutArg:of:", "v@:o^c@")
-set_signature("PyObjC_TestClass2", "callcharInArg:of:", "@@:n^c@")
-set_signature("PyObjC_TestClass2", "invokecharInOutArg:of:", "@@:N^c@")
-set_signature("PyObjC_TestClass2", "invokecharOutArg:of:", "v@:o^c@")
-set_signature("PyObjC_TestClass2", "invokecharInArg:of:", "@@:n^c@")
-set_signature("PyObjC_TestClass1", "signedshortInOutArg:", "@@:N^s")
-set_signature("PyObjC_TestClass1", "signedshortOutArg:", "v@:o^s")
-set_signature("PyObjC_TestClass1", "signedshortInArg:", "@@:n^s")
-set_signature("PyObjC_TestClass2", "callsignedshortInOutArg:of:", "@@:N^s@")
-set_signature("PyObjC_TestClass2", "callsignedshortOutArg:of:", "v@:o^s@")
-set_signature("PyObjC_TestClass2", "callsignedshortInArg:of:", "@@:n^s@")
-set_signature("PyObjC_TestClass2", "invokesignedshortInOutArg:of:", "@@:N^s@")
-set_signature("PyObjC_TestClass2", "invokesignedshortOutArg:of:", "v@:o^s@")
-set_signature("PyObjC_TestClass2", "invokesignedshortInArg:of:", "@@:n^s@")
-set_signature("PyObjC_TestClass1", "signedintInOutArg:", "@@:N^i")
-set_signature("PyObjC_TestClass1", "signedintOutArg:", "v@:o^i")
-set_signature("PyObjC_TestClass1", "signedintInArg:", "@@:n^i")
-set_signature("PyObjC_TestClass2", "callsignedintInOutArg:of:", "@@:N^i@")
-set_signature("PyObjC_TestClass2", "callsignedintOutArg:of:", "v@:o^i@")
-set_signature("PyObjC_TestClass2", "callsignedintInArg:of:", "@@:n^i@")
-set_signature("PyObjC_TestClass2", "invokesignedintInOutArg:of:", "@@:N^i@")
-set_signature("PyObjC_TestClass2", "invokesignedintOutArg:of:", "v@:o^i@")
-set_signature("PyObjC_TestClass2", "invokesignedintInArg:of:", "@@:n^i@")
-set_signature("PyObjC_TestClass1", "signedlongInOutArg:", "@@:N^l")
-set_signature("PyObjC_TestClass1", "signedlongOutArg:", "v@:o^l")
-set_signature("PyObjC_TestClass1", "signedlongInArg:", "@@:n^l")
-set_signature("PyObjC_TestClass2", "callsignedlongInOutArg:of:", "@@:N^l@")
-set_signature("PyObjC_TestClass2", "callsignedlongOutArg:of:", "v@:o^l@")
-set_signature("PyObjC_TestClass2", "callsignedlongInArg:of:", "@@:n^l@")
-set_signature("PyObjC_TestClass2", "invokesignedlongInOutArg:of:", "@@:N^l@")
-set_signature("PyObjC_TestClass2", "invokesignedlongOutArg:of:", "v@:o^l@")
-set_signature("PyObjC_TestClass2", "invokesignedlongInArg:of:", "@@:n^l@")
-set_signature("PyObjC_TestClass1", "signedlonglongInOutArg:", "@@:N^q")
-set_signature("PyObjC_TestClass1", "signedlonglongOutArg:", "v@:o^q")
-set_signature("PyObjC_TestClass1", "signedlonglongInArg:", "@@:n^q")
-set_signature("PyObjC_TestClass2", "callsignedlonglongInOutArg:of:", "@@:N^q@")
-set_signature("PyObjC_TestClass2", "callsignedlonglongOutArg:of:", "v@:o^q@")
-set_signature("PyObjC_TestClass2", "callsignedlonglongInArg:of:", "@@:n^q@")
-set_signature("PyObjC_TestClass2", "invokesignedlonglongInOutArg:of:", "@@:N^q@")
-set_signature("PyObjC_TestClass2", "invokesignedlonglongOutArg:of:", "v@:o^q@")
-set_signature("PyObjC_TestClass2", "invokesignedlonglongInArg:of:", "@@:n^q@")
-set_signature("PyObjC_TestClass1", "unsignedcharInOutArg:", "@@:N^C")
-set_signature("PyObjC_TestClass1", "unsignedcharOutArg:", "v@:o^C")
-set_signature("PyObjC_TestClass1", "unsignedcharInArg:", "@@:n^C")
-set_signature("PyObjC_TestClass2", "callunsignedcharInOutArg:of:", "@@:N^C@")
-set_signature("PyObjC_TestClass2", "callunsignedcharOutArg:of:", "v@:o^C@")
-set_signature("PyObjC_TestClass2", "callunsignedcharInArg:of:", "@@:n^C@")
-set_signature("PyObjC_TestClass2", "invokeunsignedcharInOutArg:of:", "@@:N^C@")
-set_signature("PyObjC_TestClass2", "invokeunsignedcharOutArg:of:", "v@:o^C@")
-set_signature("PyObjC_TestClass2", "invokeunsignedcharInArg:of:", "@@:n^C@")
-set_signature("PyObjC_TestClass1", "unsignedshortInOutArg:", "@@:N^S")
-set_signature("PyObjC_TestClass1", "unsignedshortOutArg:", "v@:o^S")
-set_signature("PyObjC_TestClass1", "unsignedshortInArg:", "@@:n^S")
-set_signature("PyObjC_TestClass2", "callunsignedshortInOutArg:of:", "@@:N^S@")
-set_signature("PyObjC_TestClass2", "callunsignedshortOutArg:of:", "v@:o^S@")
-set_signature("PyObjC_TestClass2", "callunsignedshortInArg:of:", "@@:n^S@")
-set_signature("PyObjC_TestClass2", "invokeunsignedshortInOutArg:of:", "@@:N^S@")
-set_signature("PyObjC_TestClass2", "invokeunsignedshortOutArg:of:", "v@:o^S@")
-set_signature("PyObjC_TestClass2", "invokeunsignedshortInArg:of:", "@@:n^S@")
-set_signature("PyObjC_TestClass1", "unsignedintInOutArg:", "@@:N^I")
-set_signature("PyObjC_TestClass1", "unsignedintOutArg:", "v@:o^I")
-set_signature("PyObjC_TestClass1", "unsignedintInArg:", "@@:n^I")
-set_signature("PyObjC_TestClass2", "callunsignedintInOutArg:of:", "@@:N^I@")
-set_signature("PyObjC_TestClass2", "callunsignedintOutArg:of:", "v@:o^I@")
-set_signature("PyObjC_TestClass2", "callunsignedintInArg:of:",