Skip to content
Snippets Groups Projects
Commit 1e84d8c0 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Scripts:

- Updated license headers in update_license_headers.py script
parent 3364f79c
No related branches found
No related tags found
2 merge requests!235Release TeraFlowSDN 3.0,!224Resolve "Update license headers for Release 3"
......@@ -27,8 +27,10 @@ FILE_PATH_SKIPPED = 'out-skipped.txt'
FILE_PATH_NO_HEADER = 'out-no-header.txt'
FILE_PATH_UPDATED = 'out-updated.txt'
#RE_OLD_COPYRIGHT = re.compile(r'Copyright\ 2021\-2023\ H2020\ TeraFlow\ \(https\:\/\/www\.teraflow\-h2020\.eu\/\)')
RE_OLD_COPYRIGHT = re.compile(r'Copyright\ 2022\-2023\ ETSI\ TeraFlowSDN\ \-\ TFS\ OSG\ \(https\:\/\/tfs\.etsi\.org\/\)')
RE_OLD_COPYRIGHTS = [
re.compile(r'Copyright\ 2021\-2023\ H2020\ TeraFlow\ \(https\:\/\/www\.teraflow\-h2020\.eu\/\)'),
re.compile(r'Copyright\ 2022\-2023\ ETSI\ TeraFlowSDN\ \-\ TFS\ OSG\ \(https\:\/\/tfs\.etsi\.org\/\)'),
]
STR_NEW_COPYRIGHT = 'Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG/SDG (https://tfs.etsi.org/)'
def skip_file(file_path : str) -> bool:
......@@ -68,8 +70,10 @@ def skip_file(file_path : str) -> bool:
return False
def process_line(line_in : str) -> str:
line_out = RE_OLD_COPYRIGHT.sub(STR_NEW_COPYRIGHT, line_in)
if line_out != line_in: return line_out
for re_old_copyright in RE_OLD_COPYRIGHTS:
if re_old_copyright.match(line_in) is None: continue
line_out = re_old_copyright.sub(STR_NEW_COPYRIGHT, line_in)
return line_out
return line_in
def process_file(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment