|
4 | 4 | from the issue assignees, and rewrites the schedule table in README.md. |
5 | 5 | """ |
6 | 6 |
|
| 7 | +from __future__ import annotations |
| 8 | + |
7 | 9 | import json |
8 | 10 | import os |
9 | 11 | import re |
@@ -77,6 +79,10 @@ def parse_date_from_title(title: str) -> str: |
77 | 79 | m = re.search(r"(\d{1,2}-\d{1,2}-\d{4})", title) |
78 | 80 | if m: |
79 | 81 | return m.group(1) |
| 82 | + # 2-digit year MM-DD-YY e.g. 06-19-26 |
| 83 | + m = re.search(r"(\d{1,2}-\d{1,2}-(\d{2}))$", title) |
| 84 | + if m and len(m.group(2)) == 2: |
| 85 | + return m.group(1)[:-2] + "20" + m.group(2) |
80 | 86 | # "Month D, YYYY" or "Month DD YYYY" |
81 | 87 | m = re.search(rf"({_MONTHS})\s+(\d{{1,2}}),?\s+(\d{{4}})", title) |
82 | 88 | if m: |
@@ -119,10 +125,16 @@ def build_row(issue: dict) -> dict | None: |
119 | 125 |
|
120 | 126 | # For manually-created issues the guest name may be in the title |
121 | 127 | # e.g. "Open Source Friday - Guest Name - MM-DD-YYYY" |
| 128 | + if not guest_name: |
| 129 | + # First try Calendly-style body: "Name: Angela Wen @handle" |
| 130 | + m = re.search(r"Name:\s+(.+?)(?:\s*@\S+)?\s*$", body, re.MULTILINE) |
| 131 | + if m: |
| 132 | + guest_name = m.group(1).strip() |
| 133 | + |
122 | 134 | if not guest_name: |
123 | 135 | parts = [p.strip() for p in re.split(r"\s+-\s+", title)] |
124 | 136 | # Remove the leading "Open Source Friday..." segment and trailing date segment |
125 | | - candidates = [p for p in parts[1:] if not re.search(r"\d{4}", p)] |
| 137 | + candidates = [p for p in parts[1:] if not re.search(r"\d{4}|\d{2}$", p)] |
126 | 138 | if candidates: |
127 | 139 | guest_name = candidates[0] |
128 | 140 |
|
|
0 commit comments