Source

pyobjc / source-deps / py2app_check.py

import imp
import os, sys, site
path = os.path.join(os.path.dirname(__file__), 'py2app', 'src')
try:
    py2app_file = imp.find_module('py2app', None)[1]
    from findVersion import findVersion
    srcVersion = findVersion(os.path.join(path, 'py2app', '__init__.py'))
    locVersion = findVersion(os.path.join(py2app_file, '__init__.py'))
    from distutils.version import LooseVersion
    if LooseVersion(locVersion) < LooseVersion(srcVersion):
        raise ImportError, "Old version detected %s < %s" % (locVersion, srcVersion)
    # import local versions
    import py2app
    import bdist_mpkg
except (ImportError, ValueError):
    # shuffle to the beginning, there may be an old version installed
    print '** using pyobjc source-deps py2app for building'
    pathlen = len(sys.path)
    site.addsitedir(path)
    newentries = sys.path[pathlen:]
    del sys.path[pathlen:]
    sys.path[1:1] = newentries
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.