How to use the pyexpander.utils.find_executable function in pyexpander

To help you get started, we’ve selected a few pyexpander 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 omerbenamram / py-expander / pyexpander / extract.py View on Github external
def _extract(archive_path, destination):
    """
    Extract archive content to destination.

    :param  archive_path: The archive to extract.
    :param  destination: The destination to extract to.
    """
    # 'e': extract to current working dir.
    # '-y': assume yes to all (overwrite).
    process_info = [find_executable(config.EXTRACTION_EXECUTABLE), 'e', '-y', archive_path]
    logger.debug('Running {}'.format(process_info))
    # Change current working directory since 7Zip only works with e flag.
    output = subprocess.check_output(process_info, cwd=destination)
    logger.debug('Output: {}'.format(output))