3 # Generate the authors.csv file.
5 # SPDX-License-Identifier: GPL-2.0-or-later
8 Remove tasks from individual author entries from the AUTHORS file
9 for use in the "About" dialog.
17 def remove_tasks(stdinu8
):
21 # Assume the first line is blank and skip it. make-authors-short.pl
22 # skipped over the UTF-8 BOM as well. Do we need to do that here?
28 sub_m
= re
.search(r
'(.*?)\s*\{', line
)
31 all_lines
.append(sub_m
.group(1))
34 nextline
= next(stdinu8
)
35 if not re
.match(r
'^\s*$', nextline
):
37 # stderru8.write("No blank line after '}', found " + nextline)
38 all_lines
.append(nextline
)
42 all_lines
.append(line
)
47 stdinu8
= io
.TextIOWrapper(sys
.stdin
.buffer, encoding
='utf8')
48 stdoutu8
= io
.TextIOWrapper(sys
.stdout
.buffer, encoding
='utf8')
49 stderru8
= io
.TextIOWrapper(sys
.stderr
.buffer, encoding
='utf8')
51 lines
= remove_tasks(stdinu8
)
52 patt
= re
.compile("(.*)[<(]([\\s'a-zA-Z0-9._%+-]+(\\[[Aa][Tt]\\])?[a-zA-Z0-9._%+-]+)[>)]")
55 match
= patt
.match(line
)
57 name
= match
.group(1).strip()
58 mail
= match
.group(2).strip().replace("[AT]", "@")
59 stdoutu8
.write("{},{}\n".format(name
, mail
))
62 if __name__
== '__main__':