Ronald Oussoren avatar Ronald Oussoren committed b7202e3 Merge

merge

Comments (0)

Files changed (22)

Add a comment to this file

pyobjc-core/Modules/objc/OC_PythonArray.m

File contents unchanged.

Add a comment to this file

pyobjc-core/Modules/objc/OC_PythonDictionary.m

File contents unchanged.

pyobjc-core/Modules/objc/bundle-variables.m

 #include <dlfcn.h>
 
 static CFBundleRef
-NSBundle2CFBundle(NSBundle* bundle)
+CreateCFBundleFromNSBundle(NSBundle* bundle)
 {
     CFURLRef bundleURL;
 
     }
 
     PyObjC_DURING
-        cfBundle = NSBundle2CFBundle(bundle);
+        cfBundle = CreateCFBundleFromNSBundle(bundle);
 
     PyObjC_HANDLER
         PyObjCErr_FromObjC(localException);
     }
 
     PyObjC_DURING
-        cfBundle = NSBundle2CFBundle(bundle);
+        cfBundle = CreateCFBundleFromNSBundle(bundle);
 
     PyObjC_HANDLER
         PyObjCErr_FromObjC(localException);
         cfBundle = NULL;
     } else {
         PyObjC_DURING
-            cfBundle = NSBundle2CFBundle(bundle);
+            cfBundle = CreateCFBundleFromNSBundle(bundle);
 
         PyObjC_HANDLER
             PyObjCErr_FromObjC(localException);

pyobjc-core/Modules/objc/class-builder.m

 {
     Class intermediate_class = nil;
 
-    intermediate_class = objc_allocateClassPair(base_class, strdup(name), 0);
+    intermediate_class = objc_allocateClassPair(base_class, name, 0);
     if (intermediate_class == NULL) {
         PyErr_NoMemory();
         goto error_cleanup;

pyobjc-core/Modules/objc/helpers-foundation-nsdecimal.m

     if (result == NULL) goto error;
 
     Decimal_Convert(result, &res);
+    if (res == NULL) {
+        Py_DECREF(result);
+        goto error;
+    }
+
     *pretval = *res;
     Py_DECREF(result);
     PyGILState_Release(state);

pyobjc-core/Modules/objc/method-accessor.m

 
             } else if (!PyObjCSelector_Check(v)) {
                 Py_DECREF(v);
-                free(methods);
                 v = NULL;
 
             } else {

pyobjc-core/Modules/objc/module.m

         }
 
     } else if (PyObjCSelector_Check(closureFor)) {
-        methinfo = ((PyObjCSelector*)closureFor)->sel_methinfo;
+        methinfo = PyObjCSelector_GetMetadata(closureFor);
         if (methinfo == NULL) {
-            PyErr_SetString(PyExc_ValueError,
-                "No signature??");
+            PyObjC_Assert(PyErr_Occurred(), NULL);
             return NULL;
         }
 
     if (PyDict_SetItemString(d, "super", (PyObject*)&PyObjCSuper_Type) < 0) {
         PyObjC_INITERROR();
     }
+    if (PyDict_SetItemString(d, "_pep447", Py_False) < 0) {
+        PyObjC_INITERROR();
+    }
 #else /* Py_HAVE_LOCAL_LOOKUP */
     if (PyDict_SetItemString(d, "super", (PyObject*)&PySuper_Type) < 0) {
         PyObjC_INITERROR();

pyobjc-core/Modules/objc/objc-class.m

 
     result = PyDict_GetItem(tp->tp_dict, name);
     if (result != NULL) {
+        if (PyObjCSelector_Check(result) && PyObjCSelector_IsHidden(result)) {
+            return NULL;
+        }
         Py_INCREF(result);
         return result;
     }
 
     result = PyObjCMetaClass_TryResolveSelector((PyObject*)Py_TYPE(tp), name, default_selector(name));
     if (result != NULL) {
+        if (PyObjCSelector_Check(result) && PyObjCSelector_IsHidden(result)) {
+            return NULL;
+        }
         Py_INCREF(result);
         return result;
     }
 
     result = PyDict_GetItem(tp->tp_dict, name);
     if (result != NULL) {
+        if (PyObjCSelector_Check(result) && PyObjCSelector_IsHidden(result)) {
+            return NULL;
+        }
         Py_INCREF(result);
         return result;
     }
 
     result = PyObjCClass_TryResolveSelector((PyObject*)tp, name, default_selector(name));
     if (result != NULL) {
+        if (PyObjCSelector_Check(result) && PyObjCSelector_IsHidden(result)) {
+            return NULL;
+        }
         Py_INCREF(result);
         return result;
     }
 
+    /* TODO: harder names */
+
     return NULL;
 }
 #endif /* Py_HAVE_LOCALLOOKUP */
 {
     PyObject* res;
     PyObject* args;
-    Class     objc_cls;
     PyObject* dict;
     PyObject* k;
     PyObject* v;
         return -1;
     }
 
-    objc_cls = PyObjCClass_GetClass(cls);
-
     dict = PyDict_New();
     if (dict == NULL) {
         return -1;

pyobjc-core/Modules/objc/objc_super.m

     .tp_alloc       = PyType_GenericAlloc,
     .tp_new         = PyType_GenericNew,
     .tp_free        = PyObject_GC_Del,
+    .tp_base        = &PySuper_Type,
 };
 
 

pyobjc-core/Modules/objc/objc_util.m

 
         if (depythonify_c_value(@encode(id), args, &result) == -1) {
             PyErr_Clear();
-            [[NSException alloc] initWithName:NSInternalInconsistencyException
+            result = [[NSException alloc] initWithName:NSInternalInconsistencyException
                                        reason:@"Cannot convert Python exception"
                                      userInfo: nil];
         }

pyobjc-core/Modules/objc/selector.m

 
     if (self->base.sel_methinfo == NULL) {
         /* Make sure we actually have metadata */
+        /* XXX: this is unclean... */
         PyObjCSelector_GetMetadata(_self);
     }
     if (self->numoutput == 0) {

pyobjc-core/Modules/objc/struct-wrapper.m

         }
         r = PyDict_SetItemString(((PyTypeObject*)structType)->tp_dict, "__struct_pack__", v);
         Py_DECREF(v);
-        if (v == NULL) {
+        if (r == -1) {
             Py_DECREF(structType);
             return NULL;
         }

pyobjc-core/Modules/objc/test/specialtypecodes.m

 
 -(instancetype)init
 {
-    [super init];
+    self = [super init];
+    if (self == nil) return nil;
+
     _idx = 0;
     return self;
 }

pyobjc-framework-Cocoa/Lib/Foundation/__init__.py

     ('__len__',     lambda self: self.length()),
 ))
 
+# XXX
+objc.addConvenienceForBasicMapping('NSMergeConflict', True)
+objc.addConvenienceForBasicMapping('NSUbiquitousKeyValueStore', False)
+objc.addConvenienceForBasicMapping('NSUserDefaults', False)
+
+
 def _setup_conveniences():
     NSNull = objc.lookUpClass('NSNull')
     def nscache_getitem(self, key):

pyobjc-framework-Cocoa/Lib/PyObjCTools/AppHelper.py

                     firstRun = False
                     if installInterrupt:
                         installMachInterrupt()
+                    print("Running main", main)
                     main(argv)
                 else:
                     NSApp().run()
             except RAISETHESE:
+                print("got exception")
                 traceback.print_exc()
                 break
             except:
+                print("got other exception", sys.exc_info())
                 exctype, e, tb = sys.exc_info()
                 objc_exception = False
                 if isinstance(e, objc.error):
                 break
 
     finally:
+        print("In finally")
         if Debugging is not None:
             Debugging.removeExceptionHandler()
         PyObjCAppHelperRunLoopStopper.removeRunLoopStopperFromRunLoop_(runLoop)

pyobjc-framework-Cocoa/Modules/_AppKit_appmain.m

 
 #import <AppKit/AppKit.h>
 
-static PyObject* 
+static PyObject*
 objc_NSApplicationMain(
-	PyObject* self __attribute__((__unused__)), 
-	PyObject* args, 
+	PyObject* self __attribute__((__unused__)),
+	PyObject* args,
 	PyObject* kwds)
 {
 static	char* keywords[] = { "argv", NULL };
 	}
 
 	if (!PySequence_Check(arglist)) {
-		PyErr_SetString(PyExc_TypeError, 
+		PyErr_SetString(PyExc_TypeError,
 			"NSApplicationMain: need list of strings as argument");
 		return NULL;
 	}
 			goto error_cleanup;
 		}
 		if (PyUnicode_Check(v)) {
-			PyObject* bytes = PyUnicode_AsEncodedString(v, 
+			PyObject* bytes = PyUnicode_AsEncodedString(v,
 					NULL, NULL);
 			if (!bytes) {
 				goto error_cleanup;
 			argv[i] = strdup(PyString_AsString(v));
 #endif
 		} else {
-			PyErr_SetString(PyExc_TypeError, 
+			PyErr_SetString(PyExc_TypeError,
 				"NSApplicationMain: need list of strings "
 				"as argument");
 			goto error_cleanup;
 	argv[argc] = NULL;
 
 	PyObjC_DURING
+                NSLog(@"->NSApplicationMain");
 		res = NSApplicationMain(argc, (const char**)argv);
+                NSLog(@"<-NSApplicationMain");
+
 	PyObjC_HANDLER
+                NSLog(@"NSApplicationMain: exc %@", localException);
 		PyObjCErr_FromObjC(localException);
 		res = -1;
 	PyObjC_ENDHANDLER

pyobjc-framework-CoreData/Examples/DragApp/DragAppAppDelegate.py

 
         return self._managedObjectModel
 
-
-
     # Change this path/code to point to your App's data store.
     def applicationSupportFolder(self):
         paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, True)
 
         return self._managedObjectContext
 
-
     def windowWillReturnUndoManager_(self, window):
         return self.managedObjectContext().undoManager()
 

pyobjc-framework-ExceptionHandling/Lib/ExceptionHandling/__init__.py

        'objc': objc,
     }, ( Foundation,))
 
+import sys
 del sys.modules['ExceptionHandling._metadata']

pyobjc-framework-Quartz/Lib/Quartz/ImageKit/__init__.py

 
 from Quartz.ImageKit import _metadata
 
+objc.addConvenienceForBasicMapping('IKImageBrowserGridGroup', False)
+objc.addConvenienceForBasicMapping('IKImageCell', False)
+objc.addConvenienceForBasicMapping('IKImageState', False)
+objc.addConvenienceForBasicSequence('IKLinkedList', True)
+
 sys.modules['Quartz.ImageKit'] = mod = objc.ObjCLazyModule('Quartz.ImageKit',
     "com.apple.imageKit",
     objc.pathForFramework("/System/Library/Frameworks/Quartz.framework/Frameworks/ImageKit.framework"),

pyobjc-framework-Quartz/Lib/Quartz/QuartzCore/__init__.py

     ('__setitem__',     lambda self, key, value: self.setObject_forKey_(value, key)),
 ))
 
+objc.addConvenienceForBasicSequence('QCStructure', True)
+
 
 sys.modules['Quartz.QuartzCore'] = mod = objc.ObjCLazyModule('Quartz.QuartzCore',
     "com.apple.QuartzCore",

pyobjc-framework-WebKit/Examples/IEWebArchive/MHTDocument.py

             fp.write(archive.data().bytes())
         self.webview.mainFrame().stopLoading()
         self.webview.mainFrame().loadArchive_(archive)
+        1/0

pyobjc-framework-WebKit/Lib/WebKit/__init__.py

 from WebKit import _metadata
 from WebKit._WebKit import *
 
+objc.addConvenienceForBasicSequence('WebScriptObject', True)
+
 sys.modules['WebKit'] = mod = objc.ObjCLazyModule(
     "WebKit",
     "com.apple.WebKit",
 
 import sys
 del sys.modules['WebKit._metadata']
+
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.