How to use the macholib.util.is_platform_file function in macholib

To help you get started, we’ve selected a few macholib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyinstaller / pyinstaller / PyInstaller / lib / macholib / _cmdline.py View on Github external
def check_file(fp, path, callback):
    if not os.path.exists(path):
        print('%s: %s: No such file or directory' % (sys.argv[0], path), file=sys.stderr)
        return 1

    try:
        is_plat = is_platform_file(path)

    except IOError as msg:
        print('%s: %s: %s' % (sys.argv[0], path, msg), file=sys.stderr)
        return 1

    else:
        if is_plat:
            callback(fp, path)
    return 0
github nortd / driveboardapp / other / pyinstaller / PyInstaller / lib / macholib / _cmdline.py View on Github external
def check_file(fp, path, callback):
    if not os.path.exists(path):
        print >>sys.stderr, '%s: %s: No such file or directory' % (sys.argv[0], path)
        return 1

    try:
        is_plat = is_platform_file(path)

    except IOError, msg:
        print >>sys.stderr, '%s: %s: %s' % (sys.argv[0], path, msg)
        return 1

    else:
        if is_plat:
            callback(fp, path)
    return 0
github HenriWahl / Nagstamon / build / helpers / pyinstaller-2.1 / PyInstaller / lib / macholib / _cmdline.py View on Github external
def check_file(fp, path, callback):
    if not os.path.exists(path):
        print('%s: %s: No such file or directory' % (sys.argv[0], path), file=sys.stderr)
        return 1

    try:
        is_plat = is_platform_file(path)

    except IOError as msg:
        print('%s: %s: %s' % (sys.argv[0], path, msg), file=sys.stderr)
        return 1

    else:
        if is_plat:
            callback(fp, path)
    return 0
github RuleWorld / bionetgen / bng2 / SBMLparser / pyinstaller2 / PyInstaller / lib / macholib / __main__.py View on Github external
def check_file(fp, path, callback):
    if not os.path.exists(path):
        print('%s: %s: No such file or directory' % (gCommand, path),
                file=sys.stderr)
        return 1

    try:
        is_plat = is_platform_file(path)

    except IOError as msg:
        print('%s: %s: %s' % (gCommand, path, msg), file=sys.stderr)
        return 1

    else:
        if is_plat:
            callback(fp, path)
    return 0
github metachris / py2app / py2app / util.py View on Github external
def iter_platform_files(path, is_platform_file=macholib.util.is_platform_file):
    """
    Iterate over all of the platform files in a directory
    """
    for root, dirs, files in os.walk(path):
        for fn in files:
            fn = os.path.join(root, fn)
            if is_platform_file(fn):
                yield fn