Skip to content

Commit a5de64c

Browse files
committed
Added doc strings to scripts
1 parent 5954a38 commit a5de64c

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.github/scripts/convert_to_html_tables.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@
1212
'''
1313

1414
def find_table_points(lines):
15+
"""
16+
Find table points within a given list of lines.
17+
18+
The table points are determined by the presence of the markers:
19+
<!-- TABLE BEGINS -->
20+
<!-- TABLE ENDS -->
21+
22+
Args:
23+
lines (list): List of lines to search in.
24+
25+
Returns:
26+
tuple: A tuple of two integers containing the start and end indices of
27+
the table points.
28+
29+
Raises:
30+
SystemExit: If the table markers are not found or if the table end
31+
marker appears before the table start marker.
32+
"""
1533

1634
# Setting default return values
1735
table_start = None
@@ -42,6 +60,18 @@ def find_table_points(lines):
4260

4361

4462
def main():
63+
"""
64+
Update the index.md file with the latest contributors data.
65+
66+
This function retrieves the REPO_NAME environment variable and the
67+
CONTRIBUTORS_LOG file path. It then reads the log file and extracts the
68+
data from it. The function then reads the index.md file and calculates
69+
the table points. If the table does not exist, it creates the table
70+
header. The function then iterates over the log data and updates the
71+
table with the latest data. Finally, it updates the index.md file with
72+
the updated data and prints a success message.
73+
74+
"""
4575

4676
# Retrieving Environmental variables
4777
REPO_NAME = os.environ.get('REPO_NAME')

.github/scripts/update_index_md.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@
1212
'''
1313

1414
def find_table_points(lines):
15+
"""
16+
Find table points within a given list of lines.
17+
18+
The table points are determined by the presence of the markers:
19+
<!-- TABLE BEGINS -->
20+
<!-- TABLE ENDS -->
21+
22+
Args:
23+
lines (list): List of lines to search in.
24+
25+
Returns:
26+
tuple: A tuple of two integers containing the start and end indices of
27+
the table points.
28+
29+
Raises:
30+
SystemExit: If the table markers are not found or if the table end
31+
marker appears before the table start marker.
32+
"""
1533

1634
# Setting default return values
1735
table_start = None
@@ -42,6 +60,18 @@ def find_table_points(lines):
4260

4361

4462
def main():
63+
"""
64+
Update the index.md file with the latest contributors data.
65+
66+
This function retrieves the REPO_NAME environment variable and the
67+
CONTRIBUTORS_LOG file path. It then reads the log file and extracts the
68+
data from it. The function then reads the index.md file and calculates
69+
the table points. If the table does not exist, it creates the table
70+
header. The function then iterates over the log data and updates the
71+
table with the latest data. Finally, it updates the index.md file with
72+
the updated data and prints a success message.
73+
74+
"""
4575

4676
# Retrieving Environmental variables
4777
REPO_NAME = os.environ.get('REPO_NAME')

0 commit comments

Comments
 (0)