Ronald Oussoren avatar Ronald Oussoren committed efa2547

Actually check in the OSAKit wrappers

Comments (0)

Files changed (6)

Lib/OSAKit/__init__.py

+from _OSAKit import *
+import objc as _objc
+if _objc.platform == 'MACOSX':
+    _objc.loadBundle(
+        "OSAKit",
+        globals(),
+        bundle_identifier=u'com.apple.OSAKit',
+    )
+import protocols

Lib/OSAKit/protocols.py

+# generated from '/System/Library/Frameworks/OSAKit.framework'
+import objc as _objc
+
+
Add a comment to this file

Lib/OSAKit/test/__init__.py

Empty file added.

Lib/OSAKit/test/test_loaded.py

+"""
+OSAKit doesn't add 'interesting' behaviour, just check that the
+module loaded correctly.
+"""
+
+import unittest
+import objc
+
+class Test (unittest.TestCase):
+
+    def testConstants(self):
+        import OSAKit
+
+        self.assert_(hasattr(OSAKit, 'OSASupportsCompiling'))
+        self.assert_(isinstance(OSAKit.OSASupportsCompiling, (int, long)))
+
+        self.assert_(hasattr(OSAKit, 'OSAScriptErrorMessage'))
+        self.assert_(isinstance(OSAKit.OSAScriptErrorMessage, unicode))
+
+    def testClasses(self):
+        import OSAKit
+
+        # Check that we loaded the AddressBook framework by looking for a
+        # class that should exist
+        self.assert_(hasattr(OSAKit, 'OSAScript'))
+        self.assert_(isinstance(OSAKit.OSAScript, objc.objc_class))
+
+if __name__ == "__main__":
+    unittest.main()

Modules/OSAKit/_OSAKit.m

+/*
+ * Mapping of static items in the OSAKit framework
+ */
+#include <Python.h>
+#include "pymactoolbox.h"
+
+#import <Cocoa/Cocoa.h>
+#import <OSAKit/OSAKit.h>
+
+#include "pyobjc-api.h"
+#include "wrapper-const-table.h"
+
+
+
+PyDoc_STRVAR(ib_doc,
+"OSAKit._OSAKit defines constants, types and global functions used by "
+"OSAKit"
+);
+
+
+#include "_OSAKit_Enum.inc"
+#include "_OSAKit_Str.inc"
+
+static PyMethodDef ib_methods[] = {
+
+	{ 0, 0, 0, 0 }
+};
+
+void init_OSAKit(void);
+
+void init_OSAKit(void)
+{
+	PyObject *m, *d, *v;
+	CFBundleRef bundle;
+
+	m = Py_InitModule4("_OSAKit", ib_methods, 
+		ib_doc, NULL, PYTHON_API_VERSION);
+	if (!m) return;
+
+	d = PyModule_GetDict(m);
+	if (!d) return;
+
+	if (PyObjC_ImportAPI(m) < 0) {
+		return;
+	}
+
+	bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.OSAKit"));
+
+	if (register_ints(d, enum_table) < 0) return;
+	if (register_variableList(d, bundle, string_table, 
+		(sizeof(string_table)/sizeof(string_table[0]))-1) < 0) return;
+
+	//CFRelease(bundle);
+}
     XgridFoundationPackages +
     QTKitPackages +
     QuartzPackages +
-    # XXX: Ronald forgot to check this in
-    # OSAKitPackages +
+    OSAKitPackages +
 
     [
         'PyObjCTools',
        + AutomatorExtensions
        + QTKitExtensions
        + QuartzExtensions
-       # XXX: Ronald forgot to check this in
-       # + OSAKitExtensions
+       + OSAKitExtensions
        + CoreDataExtensions
        + DiscRecordingExtensions
        + DiscRecordingUIExtensions
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.