def copy_files(project_vars, project_dir, files):
for root, name, content, is_unicode in files:<EOL><INDENT>project_name = project_vars['<STR_LIT>']<EOL>if is_unicode:<EOL><INDENT>content = replace_content(content, project_vars)<EOL><DEDENT>file_path = make_file_path(project_dir, project_name, root, name)<EOL>makedirs(make_dir_path(project_dir, root, project_name), exist_ok=True)<EOL>if is_unicode:<EOL><INDENT>with open(file_path, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(content)<EOL><DEDENT>if content.startswith('<STR_LIT>'):<EOL><INDENT>chmod(file_path, <NUM_LIT>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>with open(file_path, '<STR_LIT:wb>') as f:<EOL><INDENT>f.write(content)<EOL><DEDENT><DEDENT><DEDENT>
Copies files from the template into their target location. Unicode files
get their variables replaced here and files with a shebang are set to be
executable.