-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdaily_report.py
25 lines (22 loc) · 958 Bytes
/
daily_report.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from os.path import join
from tweet import generate_txt
from sys import argv
from os import getcwd
from urllib.parse import quote
from pickle import load
with open(file=join(getcwd(), 'markdown.pickle'), mode='rb') as f:
markdown_table_dict: dict[str, str] = load(file=f)
update_data = generate_txt()
release_note_md = str()
for key, value in update_data.items():
if key not in markdown_table_dict.keys():
continue
print(key, flush=True)
release_note_md += f'## {key}\n'
release_note_md += value[0].split('\n', maxsplit=1)[1].replace('\n', ' \n') + '\n'
release_note_md += f' {markdown_table_dict[key]} \n'
release_note_md += (
f'}.png)\n \n')
with open(file=join(getcwd(), 'daily_report.md'), mode='w', encoding='utf-8') as f:
f.write(release_note_md)