Commits

Ronald Oussoren  committed 6642d64

Fix annoyance in pyobjc_setup.py file

  • Participants
  • Parent commits 1649472

Comments (0)

Files changed (41)

File pyobjc-core/Lib/objc/_bridgesupport.py

     # calls will behave as expected in all cases.
     globals['super'] = objc.super
 
-    if 1:
-        # Look for metadata in the Python wrapper and prefer that over the
-        # data in the framework or in system locations. 
-        # Needed because the system bridgesupport files are buggy.
-        try:
-            exists = pkg_resources.resource_exists(
-                    frameworkResourceName, "PyObjC.bridgesupport")
-        
-        except ImportError:
-            pass
+    # Look for metadata in the Python wrapper and prefer that over the
+    # data in the framework or in system locations. 
+    # Needed because the system bridgesupport files are buggy.
+    try:
+        exists = pkg_resources.resource_exists(
+                frameworkResourceName, "PyObjC.bridgesupport")
+    
+    except ImportError:
+        pass
 
-        else:
-            if exists:
-                data = pkg_resources.resource_string(frameworkResourceName,
-                    "PyObjC.bridgesupport")
-                if data:
-                    _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)
-                return bundle
+    else:
+        if exists:
+            data = pkg_resources.resource_string(frameworkResourceName,
+                "PyObjC.bridgesupport")
+            if data:
+                _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)
+            return bundle
 
     # Look for metadata in the framework bundle
     path = bundle.pathForResource_ofType_inDirectory_(frameworkName, 'bridgesupport', 'BridgeSupport')
                         _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)
             return bundle
     
-    # 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(frameworkResourceName,
-            "PyObjC.bridgesupport")
-        if data:
-            _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)
-        return bundle
-    
     return bundle
 
 _ivar_dict = objc._objc._ivar_dict()

File pyobjc-core/PyObjCTest/test_bridgesupport.py

 
 
     def test_calls_initwrappper(self):
-       self.fail()
+        with Patcher() as p:
+
+            SENTINEL=object()
+
+            class InlineTab (object): pass
+
+            class Bundle (object):
+                def __init__(self):
+                    self.calls = []
+
+                def pathForResource_ofType_inDirectory_(self, name, type, directory):
+                    self.calls.append((name, type, directory))
+                    return None
+
+
+            load_calls = []
+            def loadBundle(module_name, module_globals, bundle_path=SENTINEL, bundle_identifier=SENTINEL, scan_classes=True):
+                self.assertIsInstance(module_name, str)
+                self.assertIsInstance(module_globals, dict)
+                if bundle_path is not SENTINEL:
+                    self.assertIsInstance(bundle_path, str)
+                if bundle_identifier is not SENTINEL:
+                    self.assertIsInstance(bundle_identifier, str)
+                bool(scan_classes)
+                bundle = Bundle()
+                load_calls.append((bundle, module_name, module_globals, bundle_path, bundle_identifier, scan_classes))
+                return bundle
+
+            resources = {}
+            def resource_exists(package, name):
+                return (package, name) in resources
+
+            def resource_string(package, name):
+                return resources[(package, name)]
+
+            parse_calls = []
+            def parseBridgeSupport(xml,  globals, framework, dylib_path=None, inlineTab=None):
+                parse_calls.append((xml, globals, framework, dylib_path, inlineTab))
+
+            TEST_BRIDGESUPPORT_DIRECTORIES=[]
+
+            p.patch("objc.loadBundle", loadBundle)
+            p.patch("pkg_resources.resource_exists", resource_exists)
+            p.patch("pkg_resources.resource_string", resource_string)
+            p.patch("objc._bridgesupport._parseBridgeSupport", parseBridgeSupport)
+            p.patch("objc._bridgesupport.BRIDGESUPPORT_DIRECTORIES", TEST_BRIDGESUPPORT_DIRECTORIES)
+
+            # 1. No resource files, no bundle files, no library files
+            resources = {}
+            TEST_BRIDGESUPORT_DIRECTORIES = [] # Need to have actual entries in this list
+
+            def basic_verify(g):
+                self.assertIs(g['objc'], objc)
+                self.assertIs(g['super'], objc.super)
+
+            load_calls = []
+            parse_calls = []
+            g = {}
+            objc.initFrameworkWrapper("TestFramework", "/Library/Framework/Test.framework", "com.apple.Test", g)
+            # VERIFY
+            basic_verify(g)
+
+            load_calls = []
+            parse_calls = []
+            g = {}
+            objc.initFrameworkWrapper("TestFramework", "/Library/Framework/Test.framework", None, g)
+            # VERIFY
+            basic_verify(g)
+
+            load_calls = []
+            parse_calls = []
+            g = {}
+            objc.initFrameworkWrapper("TestFramework", "/Library/Framework/Test.framework", None, g, scan_classes=False)
+            # VERIFY
+            basic_verify(g)
+
+            load_calls = []
+            parse_calls = []
+            g = {}
+            objc.initFrameworkWrapper("TestFramework", None, "com.apple.Test", g)
+            # VERIFY
+            basic_verify(g)
+
+            load_calls = []
+            parse_calls = []
+            g = {}
+            objc.initFrameworkWrapper("TestFramework", None, "com.apple.Test", g, scan_classes=False)
+            # VERIFY
+            basic_verify(g)
+
+            load_calls = []
+            parse_calls = []
+            g = {}
+            objc.initFrameworkWrapper("TestFramework", "/Library/Framework/Test.framework", "com.apple.Test", g, inlineTab=InlineTab())
+            # VERIFY
+            basic_verify(g)
+
+            load_calls = []
+            parse_calls = []
+            g = {}
+            objc.initFrameworkWrapper("TestFramework", "/Library/Framework/Test.framework", "com.apple.Test", g, 
+                    inlineTab=InlineTab(), scan_classes=False)
+            # VERIFY
+            basic_verify(g)
+
+
+            # 2. Have resource files, bundle files and library files (only first is used)
+
+            # 3. No resource files, have bundle files and library files (only bundle one is used)
+
+            # 4. No resource files, have bundle files (with override) and library files (only bundle one is used)
+
+            # 5. No resource file, no bundle file, have library file
+
+            # 6. No resource file, no bundle file, have library file (with override)
+
+            # 7. Cannot load bundle (should look for bridgesupport)
+
+            # 8. Use the 'frameworkResourceName' parameter
 
 
     def test_real_loader(self):

File pyobjc-core/Tools/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-Accounts/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-AddressBook/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-AppleScriptKit/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-AppleScriptObjC/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-Automator/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-CFNetwork/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-CalendarStore/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-Cocoa/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-Collaboration/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-CoreData/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-CoreLocation/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-CoreText/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-DictionaryServices/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-EventKit/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-ExceptionHandling/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-FSEvents/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-InputMethodKit/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-InstallerPlugins/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-InstantMessage/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-InterfaceBuilderKit/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-LatentSemanticMapping/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-LaunchServices/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-Message/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-OpenDirectory/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-PreferencePanes/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-PubSub/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-QTKit/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-Quartz/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-ScreenSaver/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-ScriptingBridge/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-SearchKit/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-ServerNotification/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-ServiceManagement/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-Social/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-SyncServices/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-SystemConfiguration/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-WebKit/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)
 

File pyobjc-framework-XgridFoundation/pyobjc_setup.py

 
     plat_name = "MacOS X"
     plat_versions = []
-    if min_os_level is not None:
-        plat_versions.append(">=%s"%(min_os_level,))
-    if max_os_level is not None:
-        plat_versions.append("<=%s"%(min_os_level,))
+    if min_os_level is not None and min_os_level == max_os_level:
+        plat_versions.append("==%s"%(min_os_level,))
+    else:
+        if min_os_level is not None:
+            plat_versions.append(">=%s"%(min_os_level,))
+        if max_os_level is not None:
+            plat_versions.append("<=%s"%(max_os_level,))
     if plat_versions:
         plat_name += " (%s)"%(", ".join(plat_versions),)