(frameworkName,
        frameworkPath, frameworkIdentifier, globals, inlineTab=None,
        scan_classes=None, frameworkResourceName=None)
return bundle
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).
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).
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 ) .
def initFrameworkWrapper(frameworkName,
        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(
                frameworkName,
                globals,
                bundle_path=frameworkPath)
        else:
            bundle = objc.loadBundle(
                frameworkName,
                globals,
                bundle_path=frameworkPath,
                scan_classes=scan_classes)

    else:
        try:
            if scan_classes is None:
                bundle = objc.loadBundle(
                    frameworkName,
                    globals,
                    bundle_identifier=frameworkIdentifier)

            else:
                bundle = objc.loadBundle(
                    frameworkName,
                    globals,
                    bundle_identifier=frameworkIdentifier,
                    scan_classes=scan_classes)

        except ImportError:
            if scan_classes is None:
                bundle = objc.loadBundle(
                    frameworkName,
                    globals,
                    bundle_path=frameworkPath)
            else:
                bundle = objc.loadBundle(
                    frameworkName,
                    globals,
                    bundle_path=frameworkPath,
                    scan_classes=scan_classes)


    # Make the objc module available, because it contains a lot of useful
    # functionality.
    globals['objc'] = objc

    # Explicitly push objc.super into the globals dict, that way super
    # calls will behave as expected in all cases.
    globals['super'] = objc.super

    # 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.
    if safe_resource_exists(frameworkResourceName, "PyObjC.bridgesupport"):
        data = pkg_resources.resource_string(frameworkResourceName,
            "PyObjC.bridgesupport")
        _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)
        return bundle

    # Look for metadata in the framework bundle
    path = bundle.pathForResource_ofType_inDirectory_(frameworkName, 'bridgesupport', 'BridgeSupport')
    if path is not None:
        dylib_path = bundle.pathForResource_ofType_inDirectory_(frameworkName, 'dylib', 'BridgeSupport')
        with open(path, 'rb') as fp:
            data = fp.read()
        if dylib_path is not None:
            _parseBridgeSupport(data, globals, frameworkName, dylib_path=dylib_path)
        else:
            _parseBridgeSupport(data, globals, frameworkName)

        # Check if we have additional metadata bundled with PyObjC
        if safe_resource_exists(frameworkResourceName, "PyObjCOverrides.bridgesupport"):
            data = pkg_resources.resource_string(frameworkResourceName,
                "PyObjCOverrides.bridgesupport")
            _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)

        return bundle

    # If there is no metadata there look for metadata in the standard Library
    # locations
    fn = frameworkName + '.bridgesupport'
    for dn in BRIDGESUPPORT_DIRECTORIES:
        path = os.path.join(dn, fn)
        if os.path.exists(path):
            with open(path, 'rb') as fp:
                data = fp.read()  # pragma: no branch

            dylib_path = os.path.join(dn, frameworkName + '.dylib')
            if os.path.exists(dylib_path):
                _parseBridgeSupport(data, globals, frameworkName, dylib_path=dylib_path)
            else:
                _parseBridgeSupport(data, globals, frameworkName)

            # Check if we have additional metadata bundled with PyObjC
            if safe_resource_exists(frameworkResourceName, "PyObjCOverrides.bridgesupport"):
                data = pkg_resources.resource_string(frameworkResourceName,
                    "PyObjCOverrides.bridgesupport")
                _parseBridgeSupport(data, globals, frameworkName, inlineTab=inlineTab)

            return bundle

    return bundle
def initFrameworkWrapper ( frameworkName , frameworkPath , frameworkIdentifier , globals , inlineTab = None , scan_classes = None , frameworkResourceName = None ) : if frameworkResourceName is None : frameworkResourceName = frameworkName if frameworkIdentifier is None : if scan_classes is None : bundle = objc . loadBundle ( frameworkName , globals , bundle_path = frameworkPath ) else : bundle = objc . loadBundle ( frameworkName , globals , bundle_path = frameworkPath , scan_classes = scan_classes ) else : try : if scan_classes is None : bundle = objc . loadBundle ( frameworkName , globals , bundle_identifier = frameworkIdentifier ) else : bundle = objc . loadBundle ( frameworkName , globals , bundle_identifier = frameworkIdentifier , scan_classes = scan_classes ) except ImportError : if scan_classes is None : bundle = objc . loadBundle ( frameworkName , globals , bundle_path = frameworkPath ) else : bundle = objc . loadBundle ( frameworkName , globals , bundle_path = frameworkPath , scan_classes = scan_classes ) # Make the objc module available, because it contains a lot of useful # functionality. globals [ 'objc' ] = objc # Explicitly push objc.super into the globals dict, that way super # calls will behave as expected in all cases. globals [ 'super' ] = objc . super # 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. if safe_resource_exists ( frameworkResourceName , "PyObjC.bridgesupport" ) : data = pkg_resources . resource_string ( frameworkResourceName , "PyObjC.bridgesupport" ) _parseBridgeSupport ( data , globals , frameworkName , inlineTab = inlineTab ) return bundle # Look for metadata in the framework bundle path = bundle . pathForResource_ofType_inDirectory_ ( frameworkName , 'bridgesupport' , 'BridgeSupport' ) if path is not None : dylib_path = bundle . pathForResource_ofType_inDirectory_ ( frameworkName , 'dylib' , 'BridgeSupport' ) with open ( path , 'rb' ) as fp : data = fp . read ( ) if dylib_path is not None : _parseBridgeSupport ( data , globals , frameworkName , dylib_path = dylib_path ) else : _parseBridgeSupport ( data , globals , frameworkName ) # Check if we have additional metadata bundled with PyObjC if safe_resource_exists ( frameworkResourceName , "PyObjCOverrides.bridgesupport" ) : data = pkg_resources . resource_string ( frameworkResourceName , "PyObjCOverrides.bridgesupport" ) _parseBridgeSupport ( data , globals , frameworkName , inlineTab = inlineTab ) return bundle # If there is no metadata there look for metadata in the standard Library # locations fn = frameworkName + '.bridgesupport' for dn in BRIDGESUPPORT_DIRECTORIES : path = os . path . join ( dn , fn ) if os . path . exists ( path ) : with open ( path , 'rb' ) as fp : data = fp . read ( ) # pragma: no branch dylib_path = os . path . join ( dn , frameworkName + '.dylib' ) if os . path . exists ( dylib_path ) : _parseBridgeSupport ( data , globals , frameworkName , dylib_path = dylib_path ) else : _parseBridgeSupport ( data , globals , frameworkName ) # Check if we have additional metadata bundled with PyObjC if safe_resource_exists ( frameworkResourceName , "PyObjCOverrides.bridgesupport" ) : data = pkg_resources . resource_string ( frameworkResourceName , "PyObjCOverrides.bridgesupport" ) _parseBridgeSupport ( data , globals , frameworkName , inlineTab = inlineTab ) return bundle return bundle