def old_to_new_command(driver_name, project_title, local_argv):
    """Deprecate an old-style script.

    Will only work if the old-style script name matches a command name, and if
    all option names are the same between old and new.

    Use like this (put in the script you want to deprecate):

        #!/usr/bin/env python
        import sys
        from pyqi.util import old_to_new_command

        sys.exit(old_to_new_command('biom', 'BIOM', sys.argv))
    """
    logger = StdErrLogger()

    cmd_name = splitext(split(local_argv[0])[1])[0]
    base_cmd = "%s %s" % (driver_name, cmd_name)
    command = '%s %s' % (base_cmd, ' '.join(local_argv[1:]))

    logger.info("This is a new-style %s script. You should now call it with: "
                "%s" % (project_title, base_cmd))
    logger.info(command % "Calling: %s ")

    result_stdout, result_stderr, result_retval = pyqi_system_call(command)

    sys.stdout.write(result_stdout)
    sys.stderr.write(result_stderr)

    return result_retval
dataset/ETHPy150Open biocore/pyqi/pyqi/util.py/old_to_new_command/swapped operands of `%`