Skip to content

Commit c0c174e

Browse files
committed
Refactor get_author to update names_wordlist.txt
1 parent c78668b commit c0c174e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/announce.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,14 @@ def get_authors(revision_range):
6868
pre.discard('Homu')
6969

7070
# Update doc/source/names_wordlist.txt with the names of every author
71-
names = []
72-
[names.extend(re.sub('\W+', ' ', x).split()) for x in cur.union(pre)]
7371

74-
path = os.path.sep.join(os.path.abspath(__file__).split(os.path.sep)[:-2])
72+
path = os.path.dirname(os.path.dirname(__file__))
7573
wordlist_path = os.path.join(path, 'doc', 'source', 'names_wordlist.txt')
7674

7775
with open(wordlist_path, 'w', encoding='utf-8') as wordlist:
78-
for name in names:
79-
wordlist.write('{}\n'.format(name))
76+
for name in cur.union(pre):
77+
name = re.sub('\W+', ' ', name).split()
78+
wordlist.write('{}\n'.format('\n'.join(name)))
8079

8180
# Append '+' to new authors.
8281
authors = [s + u' +' for s in cur - pre] + [s for s in cur & pre]

0 commit comments

Comments
 (0)