INNER CODE UNIT · Python
apply_license
HyperionGameTech/HyperionEngine · Tools/Scripts/Misc/apply_license.py:8
def apply_license(base_path, exclude=[]):
global license_text
headers = glob.glob('{0}/**/*.hpp'.format(base_path), recursive = True)
sources = glob.glob('{0}/**/*.cpp'.format(base_path), recursive = True)
all_sources = headers + sources
for item in all_sources:
if any([ex in item for ex in exclude]):
continue
f = open(item, 'r+')
# match for existing license by checking for /* \license and * \endlicense */
license_start = -1
license_end = -1
for i, line in enumerate(f):