#! /usr/bin/env python3

import os
from os import path

root_dir = path.dirname(path.realpath(__file__))
local_reg_dir = path.join(root_dir, 'registry')
os.makedirs(local_reg_dir, exist_ok=True)

def copy_reg(reg_dir, files):
    import shutil
    for f in files:
        file_path = path.join(reg_dir, f)
        if not path.isfile(file_path):
            raise RuntimeError(file_path + ' could not be found')
        shutil.copy2(file_path, path.join(local_reg_dir, path.basename(f)))

vk_files = [ 'registry/vk.xml', 'registry/reg.py', 'registry/generator.py' ]
copy_reg(path.join(root_dir, 'Vulkan-Headers'), vk_files)

[((7, 16, 7, 47), 'os.path.join', 'path.join', ({(7, 26, 7, 34): 'root_dir', (7, 36, 7, 46): '"""registry"""'}, {}), "(root_dir, 'registry')", False, 'from os import path\n'), ((8, 0, 8, 41), 'os.makedirs', 'os.makedirs', (), '', False, 'import os\n'), ((6, 24, 6, 47), 'os.path.realpath', 'path.realpath', ({(6, 38, 6, 46): '__file__'}, {}), '(__file__)', False, 'from os import path\n'), ((19, 9, 19, 46), 'os.path.join', 'path.join', ({(19, 19, 19, 27): 'root_dir', (19, 29, 19, 45): '"""Vulkan-Headers"""'}, {}), "(root_dir, 'Vulkan-Headers')", False, 'from os import path\n'), ((13, 20, 13, 41), 'os.path.join', 'path.join', ({(13, 30, 13, 37): 'reg_dir', (13, 39, 13, 40): 'f'}, {}), '(reg_dir, f)', False, 'from os import path\n'), ((14, 15, 14, 37), 'os.path.isfile', 'path.isfile', ({(14, 27, 14, 36): 'file_path'}, {}), '(file_path)', False, 'from os import path\n'), ((16, 57, 16, 73), 'os.path.basename', 'path.basename', ({(16, 71, 16, 72): 'f'}, {}), '(f)', False, 'from os import path\n')]