Ronald Oussoren avatar Ronald Oussoren committed f9b5579

- Check output from Scripts/find-raw-pointers.py, and fix issues

- Rename objc.Accessor to objc.accessor. objc.Accessor still exists, to
but generates a warning.

- Move all extension modules to toplevel for consistency, and remove leftover
extension modules from older releases when installing.

- Add a note about Cocoa Bindings to the documentation.

- Sync MPCompat with current Python version

- Some Python2.2/Jaguar related fixes

- Fix struct-wrapper (thanks --with-pydebug!), we basically trashed
memory on assignment

Comments (0)

Files changed (34)

   The documentation should mention that observations don't work for pure
   Python objects.
 
+Scott Anguish mentioned on one of the Cocoa lists that the right way to 
+override the key-value related methods is different from what we're doing.
+
 Formal Protocols, Distributed Objects
 .....................................
 
 
 The scripts we use for doing releases should be cleaned up, generic 
 functionality should be made available for others.
+
+Rewrite scripts/find-raw-pointers.py
+....................................
+
+This is a script for finding 'difficult' methods. The script should be 
+refactored to make it easier to create readable reports.
+
 <li><a href="#methods-and-functions" id="id7" name="id7">Methods and functions</a></li>
 <li><a href="#reference-counting" id="id8" name="id8">Reference counting</a></li>
 <li><a href="#informal-protocols" id="id9" name="id9">(Informal) protocols</a></li>
+<li><a href="#cocoa-bindings" id="id10" name="id10">Cocoa Bindings</a></li>
 </ul>
 </li>
-<li><a href="#cocoa-for-python-programmers" id="id10" name="id10">Cocoa for Python programmers</a></li>
-<li><a href="#notes-on-specific-tasks" id="id11" name="id11">Notes on specific tasks</a><ul>
-<li><a href="#working-with-threads" id="id12" name="id12">Working with threads</a></li>
-<li><a href="#finalizers" id="id13" name="id13">Finalizers</a></li>
+<li><a href="#cocoa-for-python-programmers" id="id11" name="id11">Cocoa for Python programmers</a></li>
+<li><a href="#notes-on-specific-tasks" id="id12" name="id12">Notes on specific tasks</a><ul>
+<li><a href="#working-with-threads" id="id13" name="id13">Working with threads</a></li>
+<li><a href="#finalizers" id="id14" name="id14">Finalizers</a></li>
 </ul>
 </li>
-<li><a href="#building-applications" id="id14" name="id14">Building applications</a><ul>
-<li><a href="#pure-python-buildapp-py" id="id15" name="id15">&quot;Pure Python&quot; :  buildapp.py</a></li>
-<li><a href="#ide-approach-project-builder" id="id16" name="id16">&quot;IDE approach&quot; : Project builder</a></li>
+<li><a href="#building-applications" id="id15" name="id15">Building applications</a><ul>
+<li><a href="#pure-python-buildapp-py" id="id16" name="id16">&quot;Pure Python&quot; :  buildapp.py</a></li>
+<li><a href="#ide-approach-project-builder" id="id17" name="id17">&quot;IDE approach&quot; : Project builder</a></li>
 </ul>
 </li>
 </ul>
 <p>PyObjC will automaticly use the information in the <code><span>informal_protocol</span></code> 
 objects to add the right method signatures to methods, and to warn about
 classes that partially implement a protocol.</p>
-<h2><a href="#id10" name="cocoa-for-python-programmers">Cocoa for Python programmers</a></h2>
+<h3><a href="#id10" name="cocoa-bindings">Cocoa Bindings</a></h3>
+<p>In Mac OS X 10.3 Apple introduced <i>Cocoa Bindings</i>, a method to make it easier
+to create and use <i>Controller</i> objects.</p>
+<p>Use <code><span>objc.accessor</span></code> to create accessor methods that conform to the 
+expectations of Cocoa Bindings.</p>
+<h2><a href="#id11" name="cocoa-for-python-programmers">Cocoa for Python programmers</a></h2>
 <p>Cocoa frameworks are mapped onto Python packages with the same name, that is
 the classes, constants and functioins from the AppKit framework are available
 after you import <code><span>AppKit</span></code> in your Python script.</p>
 <li><a href="http://www.stepwise.com/">stepwise.com</a></li>
 <li>Your local bookstore or library</li>
 </ul>
-<h2><a href="#id11" name="notes-on-specific-tasks">Notes on specific tasks</a></h2>
-<h3><a href="#id12" name="working-with-threads">Working with threads</a></h3>
+<h2><a href="#id12" name="notes-on-specific-tasks">Notes on specific tasks</a></h2>
+<h3><a href="#id13" name="working-with-threads">Working with threads</a></h3>
 <p>When you create a thread and want to use PyObjC from that thread you will
 have to create an <code><span>NSAutoreleasePool</span></code> in that thread and clean it up when
 you're done. The easiest way to that is to create an instance of that class
 thread that owns the Python GIL (that's also the reason for not being able 
 to use <code><span>NSThread</span></code> to create new threads).  This restriction will be lifted
 in a future version of PyObjC (at least when using Python 2.3).</p>
-<h3><a href="#id13" name="finalizers">Finalizers</a></h3>
+<h3><a href="#id14" name="finalizers">Finalizers</a></h3>
 <p>In Python you can use the method <code><span>__del__</span></code> to clean up resources when your
 object is garbage collected. In Objective-C/Cocoa this is done with a method 
 named <code><span>dealloc</span></code>.</p>
 <p>In PyObjC you should always use the <code><span>__del__</span></code> method, the <code><span>dealloc</span></code> method
 can safely be ignored and the bridge will complain when you try to override
 this method.</p>
-<h2><a href="#id14" name="building-applications">Building applications</a></h2>
+<h2><a href="#id15" name="building-applications">Building applications</a></h2>
 <p>There are two different ways to build applications with PyObjC. There are no
 major advantages to using either one of them, use the one that is most 
 convenient to you.</p>
-<h3><a href="#id15" name="pure-python-buildapp-py">&quot;Pure Python&quot; :  buildapp.py</a></h3>
+<h3><a href="#id16" name="pure-python-buildapp-py">&quot;Pure Python&quot; :  buildapp.py</a></h3>
 <p>PyObjC includes a copy of the <code><span>bundlebuilder</span></code> module. This module will be
 part of the Python 2.3 MacPython release and offers a way to build
 distutils-style scripts  for building (standalone) applications.</p>
 <p>The online documentation for <code><span>bundlebuilder</span></code> contains more information on 
 building <code><span>buildapp.py</span></code> scripts and how to invoke them. There are plenty of
 example <code><span>buildapp.py</span></code> scripts in the various <a href="../Examples/00ReadMe.txt">Examples</a> subfolders.</p>
-<h3><a href="#id16" name="ide-approach-project-builder">&quot;IDE approach&quot; : Project builder</a></h3>
+<h3><a href="#id17" name="ide-approach-project-builder">&quot;IDE approach&quot; : Project builder</a></h3>
 <p>PyObjC includes a number of Project Builder templates that can be used to 
 build (standalone) applications. Those templates are used like any other
 Project Builder template. The only non-obvious detail is that you have to
 objects to add the right method signatures to methods, and to warn about
 classes that partially implement a protocol.
 
+Cocoa Bindings
+..............
+
+In Mac OS X 10.3 Apple introduced *Cocoa Bindings*, a method to make it easier
+to create and use *Controller* objects. 
+
+Use ``objc.accessor`` to create accessor methods that conform to the 
+expectations of Cocoa Bindings.
 
 Cocoa for Python programmers
 ----------------------------

Lib/AddressBook/__init__.py

 objc.loadBundle("AddressBook", globals(), bundle_path="/System/Library/Frameworks/AddressBook.framework")
 
 from _AddressBook import *
-del _AddressBook
 
 import protocols  # no need to export these, just register with PyObjC
 
 objc.setSignatureForSelector('ABAuthenticationInfo', 'appliesToRequest:', 'c@:@')
 objc.setSignatureForSelector('ABAuthenticationInfo', 'applyToRequest:', 'c@:@')
 objc.setSignatureForSelector('ABDAVQuery', 'buildRequest', '@@:')
+objc.setSignatureForSelector('ABPerson', 'encodedDataForValue:charsetName:', '@@:@o^@')
 
 del objc

Lib/AppKit/_AppKitSignatures.py

 setSignatureForSelector("NSATSTypesetter", "glyphRangeForCharacterRange:actualCharacterRange:", "{_NSRange=II}@:{_NSRange=II}o^{_NSRange=II}")
 setSignatureForSelector("NSSavePanel", "beginForDirectory:file:types:modelessDelegate:didEndSelector:contextInfo:", 'v@:@@@@:i')
 setSignatureForSelector("NSOpenGLPixelFormat", "getValues:forAttribute:forVirtualScreen:", 'v@:o^lii')
-
+setSignatureForSelector("NSSavePanel", "gotoSheetDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSNavFilepathInputController", "sheetDidEnd:returnCode:contextInfo:", "v16@4:8@12i16i20")
+setSignatureForSelector("NSNavFilepathInputController", "beginSheetForSavePanel:withFilepath:didEndSelector:contextInfo:", 'v@:@@:i')

Lib/AppKit/test/test_nsview.py

 
     def test_rectForPage(self):
         method = ObjCTestNSView_KnowPageRange.rectForPage_
-        self.assertEquals(method.signature, "{_NSRect={_NSPoint=ff}{_NSSize=ff}}12@0:4i8")
+        self.assertEquals(objc.splitSignature(method.signature), objc.splitSignature("{_NSRect={_NSPoint=ff}{_NSSize=ff}}12@0:4i8"))
 
 if __name__ == "__main__":
     unittest.main()

Lib/Foundation/test/test_nsdecimal.py

 import unittest
 from Foundation import *
 import operator
+import objc
 
 class TestNSDecimal (unittest.TestCase):
     def testCreation(self):
         self.assert_(isinstance(o, NSDecimal))
         self.assertEquals(str(o), "1.25")
 
-        o = NSDecimal(12345, -2, True)
+        o = NSDecimal(12345, -2, objc.YES)
         self.assert_(isinstance(o, NSDecimal))
         self.assertEquals(str(o), "-123.45")
 
         # We only test addition, as all function wrappers are generated this 
         # should be enough to verify that the machinery is working correctly.
         o = NSDecimal("1.5")
-        p = NSDecimal(12345, -2, True)
+        p = NSDecimal(12345, -2, objc.YES)
         r = NSDecimal("-121.95")
         q = NSDecimal()
 

Lib/InterfaceBuilder/__init__.py

 
 del objc
 from _InterfaceBuilder import *
-del _InterfaceBuilder
 
 import protocols  # no need to export these, just register with PyObjC
 

Lib/PreferencePanes/__init__.py

 
 del objc
 from _PreferencePanes import *
-del _PreferencePanes
 
 # Define usefull utility methods here

Lib/SecurityInterface/__init__.py

 objc.loadBundle("SecurityInterface", globals(), bundle_path="/System/Library/Frameworks/SecurityInterface.framework")
 
 from _SecurityInterface import *
-del _SecurityInterface, objc
+del objc
 
 import protocols  # no need to export these, just register with PyObjC
 

Lib/WebKit/__init__.py

 _objc.recycleAutoreleasePool()
 
 import protocols  # no need to export these, just register with PyObjC
+
+_objc.setSignatureForSelector('NSJavaVirtualMachine', 'versionRangeFromString:lower:upper:', 'v@:r*o^Io^I')
 del _objc

Lib/objc/_FoundationSignatures.py

 setSignatureForSelector("NSAttributedString", "initWithDocFormat:documentAttributes:", "@@:@o^@")
 setSignatureForSelector("NSKeyValueProperty", "keyPathIfAffectedByValueForKey:exactMatch:", "@@:@o^c")
 setSignatureForSelector("NSKeyValueObservationForwarder", "initWithObserver:relationshipKey:keyPathFromRelatedObject:options:context:", "@@:@@@Ii")
+setSignatureForSelector("NSDeserializer", "deserializePropertyListFromData:atCursor:mutableContainers:", "@@:@O^Ic")
+setSignatureForSelector("NSDeserializer", "deserializePropertyListLazilyFromData:atCursor:length:mutableContainers:", "@@:@O^IIc")
+setSignatureForSelector("OC_PythonObject", "addObserver:forKeyPath:options:context:", "v@:@@Ii")
 
 
 # Technically incorrect, but not used anyway

Lib/objc/__init__.py

     """
     return selector(func, signature="v@:@")
 
-def Accessor(func):
+def accessor(func):
     """
     Return an Objective-C method object that is conformant with key-value coding
     and key-value observing.
     """
+    if not isinstance(func, type(accessor)):
+        raise ValueError, '%s is not a function'%(func,)
+
     argCount = func.func_code.co_argcount
     if argCount is 2:
         return selector(func, signature="v@:@")
     else:
         raise ValueError, "Too many arguments to function '%s'.  Cannot create selector." % foo.func_name
 
+def Accessor(func):
+    import warnings
+    warnings.warn(
+        "Use objc.accessor instead of objc.Accessor", DeprecationWarning)
+    return accessor(func)
+
 def pluginBundle(pluginName):
     """
     Return the main bundle for the named plugin. This should be used
 def recycle_autorelease_pool():
     """Depricated: Use recycleAutoreleasePool"""
     import warnings
-    warings.warn(
+    warnings.warn(
         "Use recycleAutoreleasePool instead of recycle_autorelease_pool",
         DeprecationWarning)
     recycleAutoreleasePool()

Lib/objc/test/test_conversion.py

         self.assertRaises(ValueError, carrayMaker, objc._C_SHT, ["a", "b"], 1)
 
     def testShortArray(self):
-        arr = array.array('h', (1,2,3,4,5))
-        arr2 = array.array('f', (1,2,3,4,5))
+        arr = array.array('h', [1,2,3,4,5])
+        arr2 = array.array('f', [1,2,3,4,5])
 
         res = carrayMaker(objc._C_SHT, arr, None)
         self.assertEquals(res, tuple(arr))
         self.assertRaises(ValueError, carrayMaker, objc._C_INT, ["a", "b"], 1)
 
     def testIntArray(self):
-        arr = array.array('i', (1,2,3,4,5))
-        arr2 = array.array('f', (1,2,3,4,5))
-        arr3 = array.array('h', (1,2,3,4,5))
+        arr = array.array('i', [1,2,3,4,5])
+        arr2 = array.array('f', [1,2,3,4,5])
+        arr3 = array.array('h', [1,2,3,4,5])
 
         res = carrayMaker(objc._C_INT, arr, None)
         self.assertEquals(res, tuple(arr))
         self.assertRaises(ValueError, carrayMaker, objc._C_INT, ["a", "b"], 1)
 
     def testFloatArray(self):
-        arr = array.array('f', (1.5,2.5,3.5,4.5,5.5))
-        arr2 = array.array('i', (1,2,3,4,5))
+        arr = array.array('f', [1.5,2.5,3.5,4.5,5.5])
+        arr2 = array.array('i', [1,2,3,4,5])
 
         res = carrayMaker(objc._C_FLT, arr, None)
         self.assertEquals(res, tuple(arr))
         self.assertRaises(TypeError, carrayMaker, '{Point=ff}', arr2, None)
 
     def testPointArray(self):
-        arr = array.array('f', (
+        arr = array.array('f', [
             1.0, 1.5, 
             2.0, 2.5, 
             3.0, 3.5, 
             4.0, 4.5, 
-            5.0, 5.5))
+            5.0, 5.5])
         lst = ((1.0, 1.5), (2.0, 2.5), (3.0, 3.5), (4.0, 4.5), (5.0, 5.5))
 
-        arr2 = array.array('i', (
+        arr2 = array.array('i', [
             1, 1, 
             2, 2, 
             3, 3, 
             4, 4, 
-            5, 5))
+            5, 5])
 
         res = carrayMaker('{Point=ff}', arr, None)
         self.assertEquals(res, lst)
         self.assertRaises(ValueError, carrayMaker, '{Point=ff}', arr2, None)
 
     def testRectArray(self):
-        arr = array.array('f', (
+        arr = array.array('f', [
             1.0, 1.5, -1.0, -1.5,
             2.0, 2.5, -2.0, -2.5,
             3.0, 3.5, -3.0, -3.5,
             4.0, 4.5, -4.0, -4.5,
-            5.0, 5.5, -5.0, -5.5))
+            5.0, 5.5, -5.0, -5.5])
         lst = (
                 ((1.0, 1.5),  (-1.0, -1.5)),
                 ((2.0, 2.5),  (-2.0, -2.5)),
                 ((5.0, 5.5),  (-5.0, -5.5)),
             )
 
-        arr2 = array.array('i', (
+        arr2 = array.array('i', [
             1, 1, 1, 1,
             2, 2, 2, 2,
             3, 3, 3, 3,
             4, 4, 4, 4, 
-            5, 5, 5, 5))
+            5, 5, 5, 5])
 
         res = carrayMaker('{Rect={P=ff}{S=ff}}', arr, None)
         self.assertEquals(res, lst)
         self.assertRaises(ValueError, carrayMaker, '{Rect={P=ff}{S=ff}}', arr2, None)
 
     def testMixedArray(self):
-        arr = array.array('f', (
+        arr = array.array('f', [
             1.0, 1.5, -1.0, -1.5,
             2.0, 2.5, -2.0, -2.5,
             3.0, 3.5, -3.0, -3.5,
             4.0, 4.5, -4.0, -4.5,
-            5.0, 5.5, -5.0, -5.5))
+            5.0, 5.5, -5.0, -5.5])
 
         self.assertRaises(ValueError, carrayMaker, '{M={P=ff}{S=ii}}', arr, 4)
         self.assertRaises(ValueError, carrayMaker, '{M=if{S=ii}}', arr, None)

Lib/objc/test/testbndl2.m

 
 #import <Foundation/Foundation.h>
 
-#if defined(MACOSX) && __GNUC__ >= 3
+#if defined(MACOSX) && ((__GNUC__* 100) + (__GNUC_MINOR__)) >= 303
+
 
 #define HAVE_BOOL
 

MPCompat/modulefinder.py

         self.starimports = {}
 
     def __repr__(self):
-        s = "Module(%s" % `self.__name__`
+        s = "Module(%r" % (self.__name__,)
         if self.__file__ is not None:
-            s = s + ", %s" % `self.__file__`
+            s = s + ", %r" % (self.__file__,)
         if self.__path__ is not None:
-            s = s + ", %s" % `self.__path__`
+            s = s + ", %r" % (self.__path__,)
         s = s + ")"
         return s
 
         if not m.__path__:
             return
         modules = {}
-        suffixes = [".py", ".pyc", ".pyo"]
+        # 'suffixes' used to be a list hardcoded to [".py", ".pyc", ".pyo"].
+        # But we must also collect Python extension modules - although
+        # we cannot separate normal dlls from Python extensions.
+        suffixes = []
+        for triple in imp.get_suffixes():
+            suffixes.append(triple[0])
         for dir in m.__path__:
             try:
                 names = os.listdir(dir)
     if debug > 1:
         print "path:"
         for item in path:
-            print "   ", `item`
+            print "   ", repr(item)
 
     # Create the module finder and turn its crank
     mf = ModuleFinder(path, debug, exclude)

Modules/Foundation/_FoundationMapping_NSAppleEventDescriptor.m

 #include "pyobjc-api.h"
 #include "pymactoolbox.h"
 
+#if PY_VERSION_HEX >= 0x0203000A
+
+#define HAVE_AEDESC_NEWBORROWED
+
+#endif
+
 static PyObject* 
 call_NSAppleEventDescriptor_initWithDescriptorType_bytes_length_(
 	PyObject* method, PyObject* self, PyObject* arguments)
 	return retVal;
 }
 
+#ifdef HAVE_AEDESC_NEWBORROWED
 static PyObject*
 call_NSAppleEventDescriptor_aeDesc(
 	PyObject* method, PyObject* self, PyObject* arguments)
 	retVal = AEDesc_NewBorrowed(res);
 	return retVal;
 }
+#endif
 
 static int 
 _pyobjc_install_NSAppleEventDescriptor(void)
 		return -1;
 	}
 
+#ifdef HAVE_AEDESC_NEWBORROWED
 	if (PyObjC_RegisterMethodMapping(
 		classNSAppleEventDescriptor,
 		@selector(aeDesc),
 		PyObjCUnsupportedMethod_IMP) < 0) {
 		return -1;
 	}
+#endif
 
 	if (PyObjC_RegisterMethodMapping(
 		classNSAppleEventDescriptor,

Modules/Foundation/decimals.m

 static PyObject* decimal_subtract(PyObject* left, PyObject* right);
 static PyObject* decimal_multiply(PyObject* left, PyObject* right);
 static PyObject* decimal_divide(PyObject* left, PyObject* right);
+static PyObject* decimal_power(PyObject* left, PyObject* right, PyObject* power);
 static int decimal_nonzero(PyObject* self);
 static int decimal_coerce(PyObject** l, PyObject** r);
 static PyObject* decimal_inplace_add(PyObject* left, PyObject* right);
 	decimal_divide,			/* nb_divide */
 	NULL,				/* nb_remainder */
 	NULL,				/* nb_divmod */
-	NULL,				/* nb_power */
+	decimal_power,			/* nb_power */
 	decimal_negative,		/* nb_negative */
 	decimal_positive,		/* nb_positive */
 	decimal_absolute,		/* nb_absolute */
 
 	if (!Decimal_Check(other)) {
 		if (type == Py_EQ) {
-			return PyBool_FromLong(0);
+			return PyObjCBool_FromLong(0);
 		}
 		PyErr_Format(PyExc_TypeError,
 			"Cannot compare NSDecimal and %s", 
 	res = NSDecimalCompare(&Decimal_Value(self), &Decimal_Value(other));
 
 	switch (type) {
-	case Py_LT: return PyBool_FromLong(res ==  NSOrderedAscending);
-	case Py_LE: return PyBool_FromLong(res != NSOrderedDescending);
-	case Py_EQ: return PyBool_FromLong(res == NSOrderedSame);
-	case Py_NE: return PyBool_FromLong(res != NSOrderedSame);
-	case Py_GE: return PyBool_FromLong(res != NSOrderedAscending);
-	case Py_GT: return PyBool_FromLong(res == NSOrderedDescending);
+	case Py_LT: return PyObjCBool_FromLong(res ==  NSOrderedAscending);
+	case Py_LE: return PyObjCBool_FromLong(res != NSOrderedDescending);
+	case Py_EQ: return PyObjCBool_FromLong(res == NSOrderedSame);
+	case Py_NE: return PyObjCBool_FromLong(res != NSOrderedSame);
+	case Py_GE: return PyObjCBool_FromLong(res != NSOrderedAscending);
+	case Py_GT: return PyObjCBool_FromLong(res == NSOrderedDescending);
 	default: 
 		    PyErr_SetString(PyExc_TypeError,
 				  "Bad comparison arg");
 	return PyFloat_FromDouble(retval);
 }
 
+static PyObject* decimal_power(
+	PyObject* left __attribute__((__unused__)),  
+	PyObject* right __attribute__((__unused__)), 
+	PyObject* extra __attribute__((__unused__)))
+{
+	PyErr_SetString(PyExc_TypeError,
+		"pow() and ** are not supported for NSDecimal");
+	return NULL;
+}
+
 static PyObject* decimal_add(PyObject* left, PyObject* right)
 {
 	NSDecimal  result;
 decimal_repr(PyObject* self)
 {
 	NSString* val = NSDecimalString(&Decimal_Value(self), NULL);
-	return PyObjC_IdToPython(val);
+	PyObject* tmp =  PyObjC_IdToPython(val);
+	PyObject* repr = PyObject_Str(tmp);
+	Py_DECREF(tmp);
+	return repr;
 }
 
 static inline int

Modules/objc/module.m

 			/* skip, posed-as type */
 		} else if (PyDict_SetItemString(module_globals, 
 				((PyTypeObject*)item)->tp_name, item) == -1) {
-			Py_DECREF(module_key);
+		//	Py_DECREF(module_key);
 			Py_DECREF(class_list);
 			return NULL;
 		}
 	}
-	Py_XDECREF(module_key);
+	//Py_XDECREF(module_key);
 	Py_XDECREF(class_list);
 
 	//NSLog(@"loadBundle %@ DONE", strval);

Modules/objc/objc-object.m

 		else
 #endif
 		{
-			PyErr_SetString(PyExc_TypeError,
-					"attribute name must be string");
+			PyErr_Format(PyExc_TypeError,
+				"attribute name must be string, got %s",
+				name->ob_type->tp_name);
 			return NULL;
 		}
 	}
 		else
 #endif
 		{
-			PyErr_SetString(PyExc_TypeError,
-					"attribute name must be string");
+			PyErr_Format(PyExc_TypeError,
+				"attribute name must be string, got %s",
+				name->ob_type->tp_name);
 			return -1;
 		}
 	}

Modules/objc/objc_util.m

 		return NULL;
 	}
 
-	array_type = (PyTypeObject*)PyObject_GetAttrString(mod, "array");
+	array_type = (PyTypeObject*)PyObject_GetAttrString(mod, "ArrayType");
 	Py_DECREF(mod);
 	if (array_type == NULL) {
 		return NULL;

Modules/objc/pyobjc.h

  * Central include file for PyObjC. 
  */
 
-#define OBJC_VERSION "1.1a1"
+#define OBJC_VERSION "1.1b1"
 
 #include <Python.h>
 #include "structmember.h"

Modules/objc/struct-wrapper.m

 SET_FIELD(PyObject* self, PyMemberDef* member, PyObject* val)
 {
 	Py_XINCREF(val);
-	Py_XDECREF((PyObject*)(((char*)self) + member->offset));
+	
+	Py_XDECREF(*(PyObject**)(((char*)self) + member->offset));
 	*((PyObject**)(((char*)self) + member->offset)) = val;
 }
 

Modules/objc/unittest.m

 	ASSERT_EQUALS(@encode(unsigned long long)[0], 'Q', "%c");
 
 #if defined(MACOSX) &&  MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_1
-	ASSERT_EQUALS(@encode(bool)[0], 'B', "%c");
+	ASSERT_EQUALS(@encode(bool)[0], 'B', "%#x");
 #endif
 
 END_UNITTEST
 
 An overview of the relevant changes in new, and older, releases.
 
-Version 1.1a1 (2004-02-15?)
+Version 1.1b1 (2004-02-20)
 ---------------------------
 
 - Fixes some regressions in 1.1 w.r.t. 1.0
 
 - Fix installer for Panther: the 1.1a0 version didn't behave correctly
 
+- There is now an easier way to define methods that conform to the expectations
+  of Cocoa bindings::
+
+  	class MyClass (NSObject):
+
+		def setSomething_(self, value):
+			pass
+
+		setSomething_ = objc.accessor(setSomething_)
+
+		def something(self):
+			return "something!"
+
+		something = objc.accessor(something)
+
+  It is not necessary to use ``objc.accessor`` when overriding an existing 
+  accessor method.
+
 Version 1.1a0 (2004-02-02)
 --------------------------
 

Scripts/README

-Reserved for PyObjC related scripts 

Scripts/buildpkg.py

 #!/usr/bin/env python
 
+# This module has been modified by Ronald Oussoren for use in PyObjC
+
 """buildpkg.py -- Build OS X packages for Apple's Installer.app.
 
 This is an experimental command-line tool for building packages to be

Scripts/find-raw-pointers.py

 Don't forget to add unittests for methods that are wrapped, or whose signature 
 you change.
 
-XXX: 
-- Use the values in the WRAPPED_METHODS dict to explain why a method is there.
-- Use this information to print information about incorrect entries in the table (e.g. method should be
-  in current OS, but isn't)
-- Use the information to make reports for the website
+XXX:
+- The data should be stored in a seperate file, to make it possible to use the
+  data for other purposes
+- The new annotation possibilities should be used, add a comment possibility 
+  as well.
+- Write tools for editing the data, and creating HTML reports (for the website)
 """
 
 import objc
 except ImportError:
     pass
 
-if 0:
-    try:
-        import PreferencePanes
-    except ImportError:
-        pass
-    try:
-        import ScreenSaver
-    except ImportError:
-        pass
-    try:
-        import InterfaceBuilder
-    except ImportError:
-        pass
-    try:
-        import AddressBook
-    except ImportError:
-        pass
-    try:
-        import WebKit
-    except ImportError:
-        pass
+try:
+    import PreferencePanes
+except ImportError:
+    pass
+
+try:
+    import ScreenSaver
+except ImportError:
+    pass
+
+try:
+    import InterfaceBuilder
+except ImportError:
+    pass
+
+try:
+    import AddressBook
+except ImportError:
+    pass
+
+try:
+    import WebKit
+except ImportError:
+    pass
+
+try:
+    import SecurityInterface
+except ImportError:
+    pass
 
 PTRSIG={}
 
 
 # Keys are 'Class_MethodName' value is ( initial-release, entrytype+)
 
+# XXX: This should be a data file, need to add framework info and comments.
 WRAPPED_METHODS={
-# Supported methods:
+    # Internal methods
+    'OC_PythonArray_getObjects_inRange_': (REL_OSX_10_3, TP_UNSUPPORTED),
 
     #<Foundation>
+    'NSBinHexDecoder_decodeAllIntoBuffer_size_useZeroBytesForCRC_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSBinHexDecoder_decodeIntoBuffer_size_useZeroBytesForCRC_': (REL_OSX_10_3, TP_UNDOCUMENTED),
     'NSKeyValueAccessor_extraArgument1': (REL_OSX_10_3, TP_UNDOCUMENTED),
     'NSKeyValueAccessor_extraArgument2': (REL_OSX_10_3, TP_UNDOCUMENTED),
     'NSKeyValueAccessor_initWithContainerClass_key_implementation_selector_extraArgument1_extraArgument2_extraArgument3_': (REL_OSX_10_3, TP_UNDOCUMENTED),
     'NSMutableArray_sortUsingFunction_context_range_': (REL_OSX_10_2, TP_SUPPORTED),    
 
     #<AppKit>
+    'NSATSUStyleObject_initWithStyle_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSATSUStyleObject_mergeInVariations_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSATSUStyleObject_merge_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSATSUStyleObject_setAttributes_Values_ValueSizes_Count_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSATSUStyleObject_setFeatures_selectors_count_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSATSUStyleObject_setVariations_Values_Count_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSATSUStyleObject_style': (REL_OSX_10_3, TP_UNDOCUMENTED),
+
+    # XX: selectionMode is a pointer
+    'NSArrayDetailBinder_addObjectToMasterArrayRelationship_selectionMode_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSArrayDetailBinder_addObjectsToMasterArrayRelationship_selectionMode_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSArrayDetailBinder_insertObjectIntoMasterArrayRelationship_atIndex_selectionMode_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSArrayDetailBinder_insertObjectsIntoMasterArrayRelationship_atIndexes_selectionMode_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSArrayDetailBinder_removeObjectFromMasterArrayRelationshipAtIndex_selectionMode_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSArrayDetailBinder_removeObjectsFromMasterArrayRelationshipAtIndexes_selectionMode_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+
+    'NSFontEffectsBox_carbonNotificationProc': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSValueBinder_handleValidationError_description_inEditor_errorUserInterfaceHandled_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSValueBinder_validateAndCommitValueInEditor_editingIsEnding_errorUserInterfaceHandled_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSToolTipStringDrawingLayoutManager_sizeForDisplayingAttributedString_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSAATAttributes_fillPlatformStyle_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    
+
     'NSATSTypesetter_getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits_': (REL_OSX_10_2, TP_SUPPORTED),
     'NSATSTypesetter_getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits_bidiLevels_': (REL_OSX_10_2, TP_SUPPORTED),
     'NSATSTypesetter_substituteGlyphsInRange_withGlyphs_': (REL_OSX_10_2, TP_SUPPORTED),
     'HIViewAdapter_initWithFrame_view_':1,
     'WebBaseNetscapePluginView_write_len_buffer_':1,
     'WebCoreDOMText_textImpl':1,
+    'KWQResourceLoader_initWithJob_': 1,
+    'KWQSecureTextField_initWithQLineEdit_':1,
+    'KWQAccObject_anchorElement':1,
+    'KWQAccObject_initWithRenderer_':1,
+    'WebBridge_pollForAppletInView_':1,
+    'WebBridge_syncLoadResourceWithURL_customHeaders_postData_finalURL_responseHeaders_statusCode_':1,
+    'WebTextRenderer_floatWidthForRun_style_widths_':1,
+    'WebBaseNetscapePluginStream_setNotifyData_':1,
+
 
 
 
     # From 'import PreferencePanes', some undocumented framework?
+    'SFCertificateData_parseGeneralNames_indent_':(REL_OSX_10_2, TP_UNDOCUMENTED),
     'SFCertificateTrustPanel_beginSheetForWindow_modalDelegate_didEndSelector_contextInfo_trust_message_':1,
     'SFCertificateTrustPanel_runModalForTrust_message_':1,
     'SFKeychainSavePanel_keychain':1,
     'IBObjectContainer_decodeObjectToObjectMapTableForKey_fromCoder_alwaysCreate_':1,
     'IBXMLDecoder_allocObjectWithClassName_':1,
     'IBSplitScrollView_getMinimumX_maximumX_':1,
+    
+    # XXX: Loads of 10.3 stuff
+    'PBXReference_pruneReferencesBySendingBooleanSelector_toObject_withContext_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXObject_copyWithZone_getUnretainedObjectMappings_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXFileType_bestFileTypeForRepresentingFileAtPath_withFileAttributes_withLessSpecificFileType_getExtraFileProperties_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXFileType_fileTypeForPath_getExtraFileProperties_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXFileType_guessFileTypeForGenericFileAtPath_withFileAttributes_getExtraFileProperties_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXCStringStorage_applyFunction_context_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXCStringStorage_offsetsOfStringsMatching_ignoreCase_matchStyle_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXThreadableWorkQueueOperation_launchExecutableAtPath_arguments_environment_workingDirectoryPath_keepStdinOpen_getErrorString_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXTypeDescriptor_typeRecord':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXLexicalRules_isNumber_withRange_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXProject_expandedValueForString_getRecursiveSettingName_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXProject_expandedValueForString_getRecursiveSettingName_options_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBTree_initMaxWidth_lookupFailedValue_keepUnique_comparisonFunction_comparisonContext_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBTree_initWithContentsOfFile_comparisonFunction_comparisonContext_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBTree_printValueFunction':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBTree_setPrintValueFunction_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXCodeSenseManager_getProjectInfo_forReference_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXTarget_expandedCurrentValueForBuildSetting_getRecursiveSettingName_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXTarget_expandedValueForString_getRecursiveSettingName_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXTarget_getLiteralStringValue_currentExpandedStringValue_isCurrentlyShadowed_recursiveSettingName_forBuildSettingKeyPath_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXTarget_hasOriginalForCopiedReference_usingCopiesToOriginalsMappings_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXTarget_moveBuildPhasesFromIndices_numIndices_toIndex_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXTarget_moveBuildRulesFromIndices_numIndices_toIndex_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBuildOperation_expandedValueForString_getRecursiveSettingName_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBuildContext_expandedValueForString_getRecursiveSettingName_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBuildContext_expandedValueForString_getRecursiveSettingName_options_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXSymbol_symbolRecord':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXSymbol_symbolWithSymbolRecord_projectIndex_location_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBuildOptionDefinition_initWithName_type_allowedValues_defaultValue_isCommon_commandLineArguments_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBuildSettingsDictionary_buildSettingForKeyPath_getOperation_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBuildSettingsDictionary_expandedBuildSettingForString_withExpansionDictionaries_getRecursiveSettingName_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBuildSettingsDictionary_expandedBuildSettingForString_withExpansionDictionaries_getRecursiveSettingName_options_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXBuildOutputParseRule_getBuildLogMessageItem_andBuildMessage_byMatchingAgainstString_withContext_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXMemberContainerSymbol_memberSymbolsOfType_withMapTable_includingInherited_includingCategories_projectOnly_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_currentRecord':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_firstRecord':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_getCurrentRecord_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_getNextRecord_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_getPreviousRecord_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_getRecord_atRow_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_lastRecord':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_recordAtRow_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_records':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'PBXRecordVector_rowForRecord_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSString_dictionaryByParsingAsSimpleAssignmentsAndGetLocalizedErrorString_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSString_getLineStartOffsets_count_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSString_initWithContentsOfFile_defaultCStringEncoding_getStringEncoding_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSString_initWithPotentiallyMalformedUTF8Bytes_length_stopAtTrailingIncompleteUTF8Sequence_getUsedLength_getNumberOfMalformedSequences_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSString_initWithUnicodeOrMacOSRomanContentsOfFile_getStringEncoding_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSString_stringByExpandingBuildSettingsUsingDictionaries_getRecursiveSettingName_percentMacroDelegate_options_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSString_stringFromOSType_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'JKJavaExceptionsAttribute_initWithName_byteStream_constantPool_': (REL_OSX_10_3, TP_UNDOCUMENTED),
+    'JKJavaSourceAttribute_initWithName_byteStream_constantPool_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'JKJavaUnknownAttribute_initWithName_byteStream_constantPool_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'JKJavaCodeExceptionAttribute_initWithByteStream_constantPool_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSArray_arrayByRecursivelyExpandingStringValuesWithExpansionDictionaries_getRecursiveSettingName_applyStringPostprocessingSelector_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSMutableArray_correctlyRemoveObjectsFromIndices_numIndices_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSMutableArray_moveObjectsFromIndices_numIndices_toIndex_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'TSCachedFileManager_registerFileInfoDerivationFunction_forKeyName_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'JKJavaInnerClassesAttribute_initWithName_byteStream_constantPool_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'TSStackBacktrace_initWithStackFramesNoCopy_count_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'JKJavaAttribute_attributeWithName_byteStream_constantPool_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'JKJavaMethod_parseMethodSignature_methodReturnType_methodArguments_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'TSMergedSortedArray_arrayWithArray_array_usingFunction_context_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'TSMergedSortedArray_initWithArray_array_usingFunction_context_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'XCStringList_initWithStrings_count_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'TSLineDataBuffer_processCompleteLinesUsingFunction_context_andRemove_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'JKJavaCodeAttribute_initWithName_byteStream_constantPool_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'NSDictionary_dictionaryByRecursivelyExpandingStringValuesWithExpansionDictionaries_getRecursiveSettingName_applyStringPostprocessingSelector_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+    'JKJavaConstantAttribute_initWithName_byteStream_constantPool_':(REL_OSX_10_3, TP_UNDOCUMENTED),
+
 
     #<PreferencePanes>
     "NSAuthorization_authorizationRef":1,

Scripts/gen_test_methods.py

 
 #import <Foundation/Foundation.h>
 
-#if defined(MACOSX) && __GNUC__ >= 3
+#if defined(MACOSX) && ((__GNUC__* 100) + (__GNUC_MINOR__)) >= 303
 
 #define HAVE_BOOL
 

Scripts/make_distrib.py

 #!/usr/bin/env python
 
-# Build the distribution. Requires Python2.2 on Jaguar, docutils and DocArticle.
+# Build the distribution. Requires DocArticle and docutils.
 # 
 # NOTES: Really needs a rewrite!
 
 PYTHON=sys.executable
 
 def rest2HTML(irrelevant, dirName, names):
+    try:
+        import DocArticle
+    except ImportError:
+        print "*** WARNING: Cannot recreate HTML"
+        return
+
     for aName in names:
         if aName.endswith('.txt'):
             anInputPath = os.path.join(dirName, aName)
         fp = open('Modules/objc/pyobjc.h', 'r')  
         for ln in fp.readlines():
                 if ln.startswith('#define OBJC_VERSION'):
-                	fp.close()
+                        fp.close()
                         break
         return ln.split()[-1][1:-1]
 
 
 try:
         opts, args = getopt.getopt(
-        	sys.argv[1:],
-        	'p:h?o:', ['with-python=', 'help', 'output-directory='])
+                sys.argv[1:],
+                'p:h?o:', ['with-python=', 'help', 'output-directory='])
 except getopt.error, msg:
         sys.stderr.write('%s: %s\n'%(sys.argv[0], msg))
         sys.stderr.write(USAGE)
 
 for key, value in opts:
         if key in [ '-h', '-?', '--help' ]:
-        	sys.stdout.write(USAGE)
-        	sys.exit(0)
+                sys.stdout.write(USAGE)
+                sys.exit(0)
         elif key in [ '-p', '--with-python' ]:
-        	PYTHON=value
+                PYTHON=value
         elif key in [ '-o', '--output-directory' ]:
-        	BUILDDIR=value
+                BUILDDIR=value
         else:
-        	raise ValueError, "Unsupported option: %s=%s"%(key, value)
+                raise ValueError, "Unsupported option: %s=%s"%(key, value)
 
 def makeDir(basedir, *path):
         base = basedir
         PYTHONPATH=sys.path
 else:
         fd = os.popen("'%s' -c 'import sys;print \".\".join(map(str, sys.version_info[:2]))'"%(
-        	escquotes(PYTHON)))
+                escquotes(PYTHON)))
         PYTHONVER=fd.readline().strip()
         fd = os.popen("'%s' -c 'import sys;print \"\\n\".join(sys.path)'"%(
-        	escquotes(PYTHON)))
+                escquotes(PYTHON)))
         PYTHONPATH=map(lambda x:x[:-1], fd.readlines())
 
 
 basedir = ''
 for p in PYTHONPATH:
         if p.endswith('lib/python%s'%PYTHONVER):
-        	basedir = os.path.split(os.path.split(p)[0])[0]
-        	break
+                basedir = os.path.split(os.path.split(p)[0])[0]
+                break
 
 if not basedir:
         sys.stderr.write("%s: Cannot determine basedir\n"%(sys.argv[0]))
 print "Generating HTML documentation"
 os.path.walk('Doc', rest2HTML, ['Doc/announcement.txt'])
 rest2HTML(None, '.', ['Install.txt', 'ReadMe.txt', 'Examples/00ReadMe.txt', 'Installer Package/10.2/ReadMe.txt', 'Installer Package/10.3/ReadMe.txt', 'ProjectBuilder Extras/Project Templates/00README.txt'])
-os.rename('ProjectBuilder Extras/Project Templates/00README.html', 'Doc/ProjectBuilder-Templates.html')
+
+if os.path.exists('ProjectBuilder Extras/Project Templates/00README.html'):
+        os.rename('ProjectBuilder Extras/Project Templates/00README.html', 'Doc/ProjectBuilder-Templates.html')
 
 if DOC_ONLY:
     sys.exit(0)
 
 print "Running: '%s' setup.py sdist -d '%s'"%(
-        		escquotes(PYTHON), escquotes(os.path.dirname(OUTPUTDIR)))
+                        escquotes(PYTHON), escquotes(os.path.dirname(OUTPUTDIR)))
 fd = os.popen("'%s' setup.py sdist -d '%s'"%(
-        		escquotes(PYTHON), escquotes(os.path.dirname(OUTPUTDIR))), 'r')
+                        escquotes(PYTHON), escquotes(os.path.dirname(OUTPUTDIR))), 'r')
 for ln in fd.xreadlines():
         sys.stdout.write(ln)
 
                         if aName.find(".pbxuser") > 0:
                                 os.remove( os.path.join(dirName, aName) )
         if dirName[-3:] == 'CVS':
-        	while len(names): del names[0]
-        	shutil.rmtree(dirName)
+                while len(names): del names[0]
+                shutil.rmtree(dirName)
 
 basedir = '%s/package'%(BUILDDIR)
 
 # the binary PackMan installer (which is built manually)
 #
 print "Running: '%s' setup.py bdist -d '%s'"%(
-        		escquotes("python2.3"), escquotes(os.path.dirname(OUTPUTDIR)))
+                        escquotes("python2.3"), escquotes(os.path.dirname(OUTPUTDIR)))
 fd = os.popen("'%s' setup.py bdist -d '%s'"%(
-        		escquotes("python2.3"), escquotes(os.path.dirname(OUTPUTDIR))), 'r')
+                        escquotes("python2.3"), escquotes(os.path.dirname(OUTPUTDIR))), 'r')
 for ln in fd.xreadlines():
         sys.stdout.write(ln)
 

Scripts/nibclassbuilder

 #!/usr/bin/env python
+"""
+This file is part of PyObjC <http://pyobjc.sourceforge.net>
+"""
 from PyObjCTools import NibClassBuilder
 NibClassBuilder.commandline()

Scripts/runPyObjCTests

 #!/usr/bin/env python
+"""
+This file is part of PyObjC <http://pyobjc.sourceforge.net>
 
-"""
 Run the PyObjC unittests (in an installed tree). This script is based on 
 Scripts/allTestsTogether.py by Dinu Gherman.
 

Scripts/update_html.py

-#!/usr/bin/env python
-"""
-Script for updating the HTML documentation. This uses docutils and DocArticle.
-The latter can be found in the docutils sandbox.
-
-Usage:
-        python Scripts/update_html.py 
-
-"""
-
-import sys
-import getopt
-import os
-import errno
-import shutil
-
-PYTHON=sys.executable
-
-def rest2HTML(irrelevant, dirName, names):
-    for aName in names:
-        if aName.endswith('.txt') or aName == 'NEWS':
-            anInputPath = os.path.join(dirName, aName)
-            if irrelevant is not None and anInputPath in irrelevant:
-                continue
-            anOutputPath = os.path.splitext(anInputPath)[0] + '.html'
-            print '- %s'%(anInputPath)
-            os.system("docarticle.py '%s' > '%s' || rm '%s'"%(
-                escquotes(anInputPath), escquotes(anOutputPath), 
-                escquotes(anOutputPath)))
-
-def escquotes(val):
-    return val.replace("'", "'\"'\"'")
-
-print "Generateing HTML documentation"
-os.path.walk('Doc', rest2HTML, ['Doc/announcement.txt'])
-rest2HTML(None, '.', ['NEWS', 'Install.txt', 'ReadMe.txt', 'Examples/00ReadMe.txt', 'Installer Package/ReadMe.txt', 'ProjectBuilder Extras/Project Templates/00README.txt'], )
-os.rename('ProjectBuilder Extras/Project Templates/00README.html', 'Doc/ProjectBuilder-Templates.html')
         return [], []
 
     CFLAGS=[
-        '-g',
-        '-O0',
+        #'-g',
+        ##'-O0',
         '-Wno-import',
 
         # The flags below should somehow be extracted from the GNUstep
         ]
 
     OBJC_LDFLAGS=[
-        '-g',
+        #'-g',
         '-L', gs_root + '/Libraries/',
         '-L', gs_root + '/Libraries/' + gs_flib_dir,
         '-L', gs_root + '/Libraries/' + gs_lib_dir,
 # AddressBook framework.
 AddressBookPackages, AddressBookExtensions = \
         IfFrameWork('AddressBook.framework', [ 'AddressBook' ], [
-            Extension('AddressBook._AddressBook',
+            Extension('_AddressBook',
                       [ 'Modules/AddressBook/_AddressBook.m' ],
                       extra_compile_args=[
                         '-IModules/objc',
 SecurityInterfacePackages, SecurityInterfaceExtensions = [], []
 SecurityInterfacePackages, SecurityInterfaceExtensions = \
         IfFrameWork('SecurityInterface.framework', [ 'SecurityInterface' ], [
-            Extension('SecurityInterface._SecurityInterface',
+            Extension('_SecurityInterface',
                       [ 'Modules/SecurityInterface/_SecurityInterface.m' ],
                       extra_compile_args=[
                         '-IModules/objc',
 
 PrefPanesPackages, PrefPanesExtensions = \
         IfFrameWork('PreferencePanes.framework', [ 'PreferencePanes' ], [
-            Extension('PreferencePanes._PreferencePanes',
+            Extension('_PreferencePanes',
                       [ 'Modules/PreferencePanes/_PreferencePanes.m' ],
                       extra_compile_args=[
                         '-IModules/objc',
 
 InterfaceBuilderPackages, InterfaceBuilderExtensions = \
         IfFrameWork('InterfaceBuilder.framework', [ 'InterfaceBuilder' ], [
-            Extension('InterfaceBuilder._InterfaceBuilder',
+            Extension('_InterfaceBuilder',
                       [ 'Modules/InterfaceBuilder/_InterfaceBuilder.m' ],
                       extra_compile_args=[
                         '-IModules/objc',
 
 WebKitPackages, WebKitExtensions = \
         IfFrameWork('WebKit.framework', [ 'WebKit' ], [
-            Extension('WebKit._WebKit',
+            Extension('_WebKit',
                       [ 'Modules/WebKit/_WebKit.m' ],
                       extra_compile_args=[
                         '-IModules/objc',
             elif os.path.isfile(path):
                 print "(removing old version: %s)" % path
                 os.remove(path)
+
+    # In version 1.1 some of the extension modules moved, clean up the old
+    # location
+    if install_dir is not None:
+        for name in ('objc', 'AppKit', 'Foundation', 'AddressBook', 'WebKit', 'InterfaceBuilder', 'PreferencePanes', 'SecurityInterface'):
+            path = os.path.join(install_dir, 'PyObjC', name)
+            if not os.path.exists(path): continue
+
+            exts = [ fn for fn in os.listdir(path) if fn.endswith('.so') ]
+            for fn in exts:
+                p = os.path.join(path, fn)
+                print "(removing old version: %s)"%(p,)
+                os.unlink(p)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.