Skip to content
Snippets Groups Projects
Verified Commit cd8dc864 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

cleanup and comments

parent 0a601f5e
No related branches found
No related tags found
2 merge requests!324[release] Regular merge of develop,!323changes to index generator to include legacy links
Pipeline #50617 passed
......@@ -46,26 +46,23 @@ def save_legacy_from(localroot, root, filename):
legacy_from = []
os.chdir(root)
# count the number of lines
count = 0
headerCheck = False
legacy_from_flag = False
with open(filename, 'r') as f:
for line in f:
count += 1
# check for the start of the section
if line[0:12] == "legacy_from:":
legacy_from_flag = True
#legacy_from_line_start = count
# append lines from the legacy section
if legacy_from_flag and line[0:12]:
legacy_from.append(line)
# check for the end of the header
if legacy_from_flag and line[0:3] == "---":
#legacy_from_line_end = count
legacy_from_flag = False
print(legacy_from)
# change back to the local root
os.chdir(localroot)
......@@ -160,7 +157,7 @@ for folder in cardDirs:
if file[0] != "_":
print(" > Generating header for: " + fileName)
# save legacy from
# save legacy section
legacy_from = save_legacy_from(localroot, root, file)
# remove the previous header
......@@ -195,6 +192,7 @@ for folder in cardDirs:
header += " - /cards/" + root_handbook(shortcut) + "\n"
header += " - /" + folder + "/cards/" + root_handbook(shortcut) + "\n"
# include the legacy section
if len(legacy_from) > 0:
for item in legacy_from:
header += str(item)
......
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