Skip to content

Commit

Permalink
Some test prints
Browse files Browse the repository at this point in the history
  • Loading branch information
AVHopp committed Jul 31, 2024
1 parent 7ad0887 commit c8843ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def add_version_to_selector_page(version: str) -> None:
Args:
version: The version that should be added.
"""
print("I am in the version")
indent = " "
new_line = (
f"{indent}<li><a href="
Expand All @@ -72,15 +73,18 @@ def add_version_to_selector_page(version: str) -> None:
lines = f.readlines()
for ind, line in enumerate(lines):
# Search for the version number in the current line
print(line)
if version_number := re.search(pattern, line):
# Memorize whether we saw a larger version number, implying that this is
# a hotfix
if Version(version_number.group()) > Version(version):
print("Found larger version")
last_version_index = ind
# Add the already existing line
modified_lines.append(line)

if "Stable" in line:
print("Found stable")
stable_index = ind
# We never found a larger number than the current, so we just insert after stable
index = last_version_index + 1 if last_version_index != -1 else stable_index + 1
Expand Down Expand Up @@ -151,6 +155,7 @@ def check_for_hotfix(tags: list[str], version: str):
chosen_method = sys.argv[1]
version = sys.argv[2]
if chosen_method == "selector_page":
print("Adding stuff to selector page")
add_version_to_selector_page(version)
elif chosen_method == "html":
adjust_version_to_html(version)
Expand Down

0 comments on commit c8843ce

Please sign in to comment.