def METHOD_NAME(cmd):
    """Accept a command string and return a function which opens executes the command,
    replacing %s with the full file path."""
    if '%s' not in cmd:
        cmd = cmd + ' %s'
    def f(fpath):
        s = cmd % fpath
        return subprocess.Popen(s, shell=True)
    return f