| 328 | self.cur_section = ChangelogSection() |
| 329 | |
| 330 | def create_pr_index(self) -> None: |
| 331 | PR_NUMBER_RE = re.compile(r"{pr}`[0-9]+`") |
| 332 | for subsection_idx, subsection in enumerate(self.sections): |
| 333 | for paragraph_idx, paragraph in enumerate(subsection.paragraphs): |
| 334 | for entry_idx, entry in enumerate(paragraph.entries): |
| 335 | pr_strs = PR_NUMBER_RE.findall(entry.get_text()) |
| 336 | is_unique = len(pr_strs) == 1 |
| 337 | for pr_str in pr_strs: |
| 338 | pr = int(pr_str[5:-1]) |
| 339 | self.pr_index[pr] = PrChangelogIndex( |
| 340 | subsection_idx, paragraph_idx, entry_idx, is_unique |
| 341 | ) |
| 342 | |
| 343 | def delete_entry(self, pr_changelog_index: PrChangelogIndex) -> None: |
| 344 | subsection = self.sections[pr_changelog_index.subsection] |