Commits

Ronald Oussoren  committed 9e370c1

* prototype changes for some framework wrappers
* fix testcase for nsdecimal comparison (code was already brought in line with decimal.Decimal behavior)

  • Participants
  • Parent commits 9d02cbf
  • Branches core-cleanup

Comments (0)

Files changed (4)

File pyobjc-core/PyObjCTest/test_nsdecimal.py

         D5 = decimal.Decimal(5)
 
         self.assertTrue(d5 == i5)
-        self.assertFalse(d5 == f5)
+        self.assertTrue(d5 == f5)
         self.assertFalse(d5 == D5)
         self.assertFalse(d5 != i5)
-        self.assertTrue(d5 != f5)
+        self.assertFalse(d5 != f5)
         self.assertTrue(d5 != D5)
         self.assertFalse(d5 < i5)
-        self.assertRaises(TypeError, operator.lt, d5, f5)
+        self.assertFalse(d5 < f5)
         self.assertRaises(TypeError, operator.lt, d5, D5)
         self.assertFalse(d5 > i5)
-        self.assertRaises(TypeError, operator.gt, d5, f5)
+        self.assertFalse(d5 > f5)
         self.assertRaises(TypeError, operator.gt, d5, D5)
         self.assertTrue(d5 >= i5)
-        self.assertRaises(TypeError, operator.ge, d5, f5)
+        self.assertTrue(d5 >= f5)
         self.assertRaises(TypeError, operator.ge, d5, D5)
         self.assertTrue(d5 <= i5)
-        self.assertRaises(TypeError, operator.le, d5, f5)
+        self.assertTrue(d5 <= f5)
         self.assertRaises(TypeError, operator.le, d5, D5)
 
     def test_hash(self):

File pyobjc-framework-CFNetwork/Modules/_manual.m

 #import <CFNetwork/CFNetwork.h>
 #endif
 
-static const void* 
-mod_retain(const void* info) 
+static const void*
+mod_retain(const void* info)
 {
 	PyGILState_STATE state = PyGILState_Ensure();
 	Py_INCREF((PyObject*)info);
 
 
 static CFStreamClientContext mod_CFStreamClientContext = {
-	0,		
+	0,
 	NULL,
 	(void*(*)(void*))mod_retain,
 	(void(*)(void*))mod_release,
 
 	PyObjC_DURING
 		ref = USE_10_5(CFNetworkExecuteProxyAutoConfigurationScript)(
-				script, url, 
+				script, url,
 				m_CFProxyAutoConfigurationResultCallback,
 				&context);
 	PyObjC_HANDLER
 
 	PyObjC_DURING
 		ref = USE_10_5(CFNetworkExecuteProxyAutoConfigurationURL)(
-				script, url, 
+				script, url,
 				m_CFProxyAutoConfigurationResultCallback,
 				&context);
 	PyObjC_HANDLER
 	PyObject*   py_host;
 	Boolean ok = 0;
 
-	if (!PyArg_ParseTuple(args, "OOO", &py_host, 
+	if (!PyArg_ParseTuple(args, "OOO", &py_host,
 				&callback, &ctx)) {
 		return NULL;
 	}
 		"CFNetworkExecuteProxyAutoConfigurationScript",
 		(PyCFunction)m_CFNetworkExecuteProxyAutoConfigurationScript,
 		METH_VARARGS,
-		NULL
+		"CFNetworkExecuteProxyAutoConfigurationScript(arg0, arg1, arg2, arg3)"
 	},
 #endif /* OSX >= 10.5 */
 #if PyObjC_BUILD_RELEASE >= 1005
 		"CFNetworkExecuteProxyAutoConfigurationURL",
 		(PyCFunction)m_CFNetworkExecuteProxyAutoConfigurationURL,
 		METH_VARARGS,
-		NULL
+		"CFNetworkExecuteProxyAutoConfigurationURL(arg0, arg1, arg2, arg3)"
 	},
 #endif /* OSX >= 10.5 */
 
 		"CFHostSetClient",
 		(PyCFunction)m_CFHostSetClient,
 		METH_VARARGS,
-		NULL
+		"CFHostSetClient(arg0, arg1, arg2)"
 	},
 
 	{ 0, 0, 0, }
 		PyObjC_INITERROR();
 	}
 
-        if (PyObjC_ImportAPI(m) < 0) { 
+        if (PyObjC_ImportAPI(m) < 0) {
 		PyObjC_INITERROR();
 	}
 

File pyobjc-framework-Cocoa/Modules/_AppKit_appmain.m

 		"NSApplicationMain", 				\
 		(PyCFunction)objc_NSApplicationMain, 		\
 		METH_VARARGS|METH_KEYWORDS, 			\
-		"int NSApplicationMain(int argc, const char *argv[]);" \
+		"NSApplicationMain(arg0, arg1)\n\nint NSApplicationMain(int argc, const char *argv[]);" \
 	},

File pyobjc-framework-Cocoa/Modules/_AppKit_nsfont.m

-static PyObject* 
+static PyObject*
 m_NSConvertGlyphsToPackedGlyphs(
 	PyObject* self __attribute__((__unused__)), PyObject* arguments)
 {
 	Py_ssize_t c;
 	NSMultibyteGlyphPacking packing;
 	char* packedGlyphs;
-	
+
 	if  (!PyArg_ParseTuple(arguments, "OOOO", &py_glBuf, &py_count, &py_packing, &py_packedGlyphs)) {
 		return NULL;
 	}
 		PyErr_NoMemory();
 		return NULL;
 	}
-	
+
 	NSInteger result = -1;
 	PyObjC_DURING
 		result = NSConvertGlyphsToPackedGlyphs(glBuf, count, packing, packedGlyphs);
-		
+
 	PyObjC_HANDLER
 		PyObjCErr_FromObjC(localException);
 	PyObjC_ENDHANDLER
 	}
 
 	PyObject* pyRes;
-	
+
 	if (result == 0) {
 		pyRes = Py_BuildValue("Ns#",
 			PyObjC_ObjCToPython(@encode(NSInteger), &result), packedGlyphs, result-1);
 	   "NSConvertGlyphsToPackedGlyphs",			\
 	   (PyCFunction)m_NSConvertGlyphsToPackedGlyphs,	\
 	   METH_VARARGS,					\
-	   0							\
+	   "NSConvertGlyphsToPackedGlyphs(arg0, arg1, arg2, arg3)\n\nNSInteger NSConvertGlyphsToPackedGlyphs(NSGlyph *glBuf, NSInteger count, NSMultibyteGlyphPacking packing, char *packedGlyphs);" \
 	},