[PyObjC-svn] r2058 - in trunk/pyobjc/pyobjc-core/Lib: PyObjCTools objc

[email protected]
Newsgroups gmane.comp.python.pyobjc.cvs
Message-ID <[email protected]>
Author: ronaldoussoren
Date: Tue Feb 17 09:48:48 2009
New Revision: 2058

Log:
* Bugfix in testsupport
* Make it possible to have metadata in a subpackage,
  needed for embedding metadata in the Quartz bindings.


Modified:
   trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py
   trunk/pyobjc/pyobjc-core/Lib/objc/_bridgesupport.py

Modified: trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/PyObjCTools/TestSupport.py	Tue Feb 17 09:48:48 2009
@@ -206,8 +206,8 @@
 
         st = info['arguments'][argno+offset]['sel_of_type']
         if st != sel_type:
-            self.fail(message or "arg %d of %s doesn't have sel_type %r"%(
-                argno, method, seltype))
+            self.fail(message or "arg %d of %s doesn't have sel_type %r but %r"%(
+                argno, method, sel_type, info['arguments'][argno+offset]['sel_of_type']))
 
     def failUnlessResultIsBOOL(self, method, message=None):
         info = method.__metadata__()

Modified: trunk/pyobjc/pyobjc-core/Lib/objc/_bridgesupport.py
==============================================================================
--- trunk/pyobjc/pyobjc-core/Lib/objc/_bridgesupport.py	(original)
+++ trunk/pyobjc/pyobjc-core/Lib/objc/_bridgesupport.py	Tue Feb 17 09:48:48 2009
@@ -64,13 +64,17 @@
                 setattr(globals['protocols'], p.__name__, p)
 
 def initFrameworkWrapper(frameworkName,
-        frameworkPath, frameworkIdentifier, globals, inlineTab=None, scan_classes=None):
+        frameworkPath, frameworkIdentifier, globals, inlineTab=None, 
+        scan_classes=None, frameworkResourceName=None):
     """
     Load the named framework, using the identifier if that has result otherwise
     using the path. Also loads the information in the bridgesupport file (
     either one embedded in the framework or one in a BrigeSupport library
     directory).
     """
+    if frameworkResourceName is None:
+        frameworkResourceName = frameworkName
+
     if frameworkIdentifier is None:
         if scan_classes is None:
             bundle = objc.loadBundle(
@@ -127,14 +131,14 @@
         # Needed because the system bridgesupport files are buggy.
         try:
             exists = pkg_resources.resource_exists(
-                    frameworkName, "PyObjC.bridgesupport")
+                    frameworkResourceName, "PyObjC.bridgesupport")
         
         except ImportError:
             pass
 
         else:
             if exists:
-                data = pkg_resources.resource_string(frameworkName,
+                data = pkg_resources.resource_string(frameworkResourceName,
                     "PyObjC.bridgesupport")
                 if data:
                     _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)
@@ -153,14 +157,14 @@
         # Check if we have additional metadata bundled with PyObjC
         try:
             exists = pkg_resources.resource_exists(
-                frameworkName, "PyObjCOverrides.bridgesupport")
+                frameworkResourceName, "PyObjCOverrides.bridgesupport")
         
         except ImportError:
             pass
 
         else:
             if exists:
-                data = pkg_resources.resource_string(frameworkName,
+                data = pkg_resources.resource_string(frameworkResourceName,
                     "PyObjCOverrides.bridgesupport")
                 if data:
                     _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)
@@ -185,14 +189,14 @@
             # Check if we have additional metadata bundled with PyObjC
             try:
                 exists = pkg_resources.resource_exists(
-                    frameworkName, "PyObjCOverrides.bridgesupport")
+                    frameworkResourceName, "PyObjCOverrides.bridgesupport")
 
             except ImportError:
                 pass
 
             else:
                 if exists:
-                    data = pkg_resources.resource_string(frameworkName,
+                    data = pkg_resources.resource_string(frameworkResourceName,
                         "PyObjCOverrides.bridgesupport")
                     if data:
                         _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)
@@ -201,7 +205,7 @@
     # And if that fails look for the metadata in the framework wrapper
     if pkg_resources.resource_exists(
             frameworkName, "PyObjC.bridgesupport"):
-        data = pkg_resources.resource_string(frameworkName,
+        data = pkg_resources.resource_string(frameworkResourceName,
             "PyObjC.bridgesupport")
         if data:
             _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.