def get_path(dest, file, cwd = None):
if callable(dest):<EOL><INDENT>return dest(file)<EOL><DEDENT>if not cwd:<EOL><INDENT>cwd = file.cwd<EOL><DEDENT>if not os.path.isabs(dest):<EOL><INDENT>dest = os.path.join(cwd, dest)<EOL><DEDENT>relative = os.path.relpath(file.path, file.base)<EOL>return os.path.join(dest, relative)<EOL>
Get the writing path of a file.