Commits

Ronald Oussoren committed c37841a

- objc.objc_class.__name__ didn't work, that caused problems with pydoc.
- NSMake{Rect,Size,Point} are functions in Foundation, not AppKit. Keep
the definitions in AppKit for backward compatibility.
- Optimize PyObjSelector_FindNative: __foo__ methods will never be found
in native classes. This is very helpfull with pydoc.

Comments (0)

Files changed (4)

pyobjc/Doc/intro.txt

 
 These helper modules contain *only* functions, constants and classes that 
 wrap items in the corresponding framework. All utility functions and classes 
-are located in the ``PyObjCTools`` package and ``objc`` module. 
+are located in the ``PyObjCTools`` package and ``objc`` module. Note that it
+is possible to use ``pydoc`` (or the ``help()``) function with the framework
+wrappers, but that this is not very usefull for the entire module due to the
+size of these modules.
 
 This makes it easier to find documentation for an item: if you import it 
 from the wrapper module for an Objective-C framework the documentation for

pyobjc/Lib/AppKit/__init__.py

 # Define usefull utility methods here
 NSClassForName = _objc.lookUpClass
 
-def NSMakePoint(p1, p2):
-    return (float(p1), float(p2))
-
-def NSMakeSize(h, w):
-    return (float(h), float(w))
-
-def NSMakeRect(p1, p2, h, w):
-    return ((p1, p2), (h, w))
+# The used to be defined here as pure python functions, these aliasses
+# are left here for backward compatibility.
+NSMakePoint = Foundaiton.NSMakePoint
+NSMakeSize = Foundation.NSMakeSize
+NSMakeRect = Foundation.NSMakeRect
 
 import protocols  # no need to export these, just register with PyObjC
 

pyobjc/Modules/objc/objc-class.m

 {
 	Class cls = PyObjCClass_GetClass(self);
 	if (cls == NULL) {
-		return NULL;
+		return PyString_FromString("objc.objc_class");
 	} else {
 		return PyString_FromString(cls->name);
 	}

pyobjc/Modules/objc/selector.m

 		Object_class = [Object class];
 	}
 
+	if (name[0] == '_' && name[1] == '_') {
+		/* XXX: Try to speed up pydoc */
+		ObjCErr_Set(PyExc_AttributeError,
+			"No attribute %s", name);
+		return NULL;
+	}
+
 	if (PyObjCClass_Check(self)) {
 		Class cls = PyObjCClass_GetClass(self);