Skip to content

Commit

Permalink
Remove if __name__ == "__main__"
Browse files Browse the repository at this point in the history
  • Loading branch information
t20100 committed Jan 21, 2025
1 parent 7d279fe commit 11c2843
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions tools/format_GH_release_notes.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
""" Fix the format of GitHub-generated release notes. """

import os.path
import re

if __name__ == "__main__":
root_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))

import re
with open(os.path.join(root_dir, 'CHANGELOG.rst'), 'r') as f:
content = f.read().split('/n')

root_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))

with open(os.path.join(root_dir, 'CHANGELOG.rst'), 'r') as f:
content = f.read().split('/n')


with open(os.path.join(root_dir,'CHANGELOG_new.rst'), 'w') as f:
for line in content:
new_line = re.sub(r'by @.+ in https://github\.com/silx-kit/silx/pull/(\d+)', r'(PR #\1)', line)
f.write(new_line)
f.write('\n')
with open(os.path.join(root_dir,'CHANGELOG_new.rst'), 'w') as f:
for line in content:
new_line = re.sub(r'by @.+ in https://github\.com/silx-kit/silx/pull/(\d+)', r'(PR #\1)', line)
f.write(new_line)
f.write('\n')

0 comments on commit 11c2843

Please sign in to comment.