Skip to content

Commit 3426e31

Browse files
CopilotMishkatIT
andcommitted
Fix README update issue - remove hardcoded placeholder in regex pattern
Co-authored-by: MishkatIT <125080003+MishkatIT@users.noreply.github.com>
1 parent 1a323c0 commit 3426e31

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

update_readme.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ def update_readme(stats, last_known_info=None, update_source=None):
281281
readme_content = re.sub(progress_pattern, progress_replacement, readme_content, flags=re.DOTALL)
282282

283283
# Update the "Updated On" column for each platform
284-
updated_on_pattern = rf'({platform_name}.*?<td align="center">\d+.*?<td align="center">\d+\.\d+%.*?<td align="center">).*?;sljdkf.*?</td>'
284+
# Pattern matches: platform name -> any content -> progress badge -> updated on cell
285+
updated_on_pattern = rf'({platform_name}.*?Progress-{percentage}%25.*?<td align="center">).*?</td>'
285286
updated_on_replacement = rf'\g<1>{date_str}</td>'
286287
readme_content = re.sub(updated_on_pattern, updated_on_replacement, readme_content, flags=re.DOTALL)
287288

@@ -292,6 +293,14 @@ def update_readme(stats, last_known_info=None, update_source=None):
292293
readme_content
293294
)
294295

296+
# Update the "Updated On" column in the footer (total row)
297+
readme_content = re.sub(
298+
r'(TOTAL.*?<td align="center"><strong>100%</strong></td>\s*<td align="center">).*?</td>',
299+
rf'\g<1>{current_date}</td>',
300+
readme_content,
301+
flags=re.DOTALL
302+
)
303+
295304
# Update key highlights if Codeforces is the top platform
296305
if isinstance(effective_counts.get('Codeforces'), int):
297306
cf_count = effective_counts['Codeforces']

0 commit comments

Comments
 (0)