Commits

Ronald Oussoren committed 2b9535c

- Added script used to generate Lib/AppKit/_AppKitSignatures.py
- objc/__init__.py no longer removed CWD from sys.path

  • Participants
  • Parent commits 9ce490d

Comments (0)

Files changed (3)

File pyobjc/ChangeLog

+2002-11-11 Ronald Oussoren <oussoren@cistron.nl>
+ 	* Lib/objc/__init__.py: Don't remove current directory from sys.path
+
 2002-11-08 Ronald Oussoren <oussoren@cistron.nl>
 	* Use integer for lots of userInfo arguments in the AppKit
 

File pyobjc/Lib/objc/__init__.py

 # - We want the resources directory to be on the python search-path
 # - It must be at the start of the path
 # - The CWD must not be on the path
-if 1:
+if 1 :
 	b = lookup_class('NSBundle').mainBundle()
 	if b:
 		sys.path.insert(0, '%s/Contents/Resources'%str(b.bundlePath()))
-		try:
-			del sys.path[sys.path.index('')]
-		except ValueError:
-			pass
 	del b
 del sys, __builtin__

File pyobjc/Scripts/create_byref_module.py

+#!/usr/bin/env python
+#
+#
+# Read the file created by extract_byref_signatures.py and define signature
+# overrides for those entries where a user has added more precise signatures.
+#
+# The overrides are used by the runtime and allow us to correctly pass 
+# pass-by-reference parameters to the objective-C runtime.
+#
+import sys
+
+if len(sys.argv) != 3:
+	print 'Usage: create_byref_module.py module.byref module.py'
+	sys.exit(1)
+
+fp_in = file(sys.argv[1])
+fp_out = file(sys.argv[2], 'w')
+
+fp_out.write("""
+#
+# This file is generated by 'create_byref_module.py'. Do not edit.
+#
+# Generated from '%s'.
+#
+#
+from objc import set_signature_for_selector
+
+"""%sys.argv[1])
+
+for ln in fp_in:
+	cls, selector, real_sign, repl_sign = ln.strip().split(ln[0])[1:]
+	if not repl_sign:
+		continue
+	fp_out.write('set_signature_for_selector("%s", "%s", "%s")\n'%(
+		cls, selector, repl_sign))
+