(filename, framework_name, version=None)
Find a framework using dyld semantics
Find a framework using dyld semantics
Find a framework using dyld semantics
def dyld_framework(filename, framework_name, version=None):
    """Find a framework using dyld semantics"""
    filename = ensure_unicode(filename)
    framework_name = ensure_unicode(framework_name)
    version = ensure_unicode(version)

    def _search():
        spath = ensure_unicode(os.environ.get('DYLD_FRAMEWORK_PATH', None))
        if spath is not None:
            for path in spath.split(':'):
                if version:
                    yield os.path.join(
                        path, framework_name + '.framework',
                        'Versions', version, framework_name
                    )
                else:
                    yield os.path.join(
                        path, framework_name + '.framework', framework_name
                    )
        yield filename
        spath = ensure_unicode(os.environ.get(
            'DYLD_FALLBACK_FRAMEWORK_PATH', DEFAULT_FRAMEWORK_FALLBACK
        ))
        for path in spath.split(':'):
            if version:
                yield os.path.join(
                    path, framework_name + '.framework', 'Versions',
                    version, framework_name
                )
            else:
                yield os.path.join(
                    path, framework_name + '.framework', framework_name
                )


    for f in inject_suffixes(_search()):
        if os.path.exists(f):
            return f
    # raise ..
    raise ImportError("Framework %s could not be found" % (framework_name,))
def dyld_framework ( filename , framework_name , version = None ) : filename = ensure_unicode ( filename ) framework_name = ensure_unicode ( framework_name ) version = ensure_unicode ( version ) def _search ( ) : spath = ensure_unicode ( os . environ . get ( 'DYLD_FRAMEWORK_PATH' , None ) ) if spath is not None : for path in spath . split ( ':' ) : if version : yield os . path . join ( path , framework_name + '.framework' , 'Versions' , version , framework_name ) else : yield os . path . join ( path , framework_name + '.framework' , framework_name ) yield filename spath = ensure_unicode ( os . environ . get ( 'DYLD_FALLBACK_FRAMEWORK_PATH' , DEFAULT_FRAMEWORK_FALLBACK ) ) for path in spath . split ( ':' ) : if version : yield os . path . join ( path , framework_name + '.framework' , 'Versions' , version , framework_name ) else : yield os . path . join ( path , framework_name + '.framework' , framework_name ) for f in inject_suffixes ( _search ( ) ) : if os . path . exists ( f ) : return f # raise .. raise ImportError ( "Framework %s could not be found" % ( framework_name , ) )