process_mining / pm4py /docs /header_script.py
linpershey's picture
Add 'pm4py/' from commit '80970016c5e1e79af7c37df0dd88e17587fe7bcf'
b4ba3ec
raw
history blame
706 Bytes
import glob
if __name__ == '__main__':
LICENSE_HEADER_FILE_PATH = r'LICENSE_HEADER_GITHUB.txt'
with open(LICENSE_HEADER_FILE_PATH, 'r') as license_file:
license = license_file.read()
for filename in glob.iglob('../pm4py/' + '**/*.py', recursive=True):
with open(filename, 'r', encoding='utf-8') as original:
data = original.read()
if (data.find(license) == -1):
with open(filename, 'w', encoding='utf-8') as modified:
print('adding license to: ' + filename)
modified.write(license + '\n' + data)
else:
print('skipping: ' + filename)