Skip to content
Prev Previous commit
Next Next commit
Add regex
  • Loading branch information
rockleona committed Nov 28, 2023
commit 53986f2e8b5c53cff69602478d27f3eb30df57cb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
- programming.po-----------------------Ongoing, 98.72 %
- windows.po---------------------------✅
- howto/ - annotations.po-----------------------✅
- argparse.po--------------------------Ongoing, 57.61 %
- argparse.po--------------------------Ongoing, 57.61 %, 💻 sweslo17
- clinic.po----------------------------✅
- cporting.po--------------------------Ongoing, 20.0 %
- curses.po----------------------------Ongoing, 17.14 %
Expand Down Expand Up @@ -223,7 +223,7 @@
- frameworks.po------------------------Ongoing, 33.33 %
- ftplib.po----------------------------Ongoing, 98.55 %
- functional.po------------------------Ongoing, 66.67 %
- functions.po-------------------------Ongoing, 67.25 %
- functions.po-------------------------Ongoing, 67.25 %, 💻 StevenHsuYL
- functools.po-------------------------Ongoing, 7.78 %
- gc.po--------------------------------Ongoing, 98.25 %
- getopt.po----------------------------Ongoing, 10.53 %
Expand All @@ -233,7 +233,7 @@
- graphlib.po--------------------------✅
- grp.po-------------------------------Ongoing, 41.38 %
- gzip.po------------------------------Ongoing, 31.15 %
- hashlib.po---------------------------Ongoing, 18.52 %
- hashlib.po---------------------------Ongoing, 18.52 %, 💻 mattwang44
- heapq.po-----------------------------✅
- hmac.po------------------------------✅
- html.entities.po---------------------✅
Expand All @@ -256,7 +256,7 @@
- inspect.po---------------------------Ongoing, 17.63 %
- internet.po--------------------------✅
- intro.po-----------------------------Ongoing, 60.0 %
- io.po--------------------------------Ongoing, 25.19 %
- io.po--------------------------------Ongoing, 25.19 %, 💻 cschan1828
- ipaddress.po-------------------------Ongoing, 1.35 %
- ipc.po-------------------------------❌
- itertools.po-------------------------Ongoing, 45.73 %
Expand Down Expand Up @@ -295,7 +295,7 @@
- os.po--------------------------------Ongoing, 18.2 %
- ossaudiodev.po-----------------------Ongoing, 20.41 %
- pathlib.po---------------------------Ongoing, 48.19 %, 💻 mindihx
- pdb.po-------------------------------Ongoing, 9.92 %
- pdb.po-------------------------------Ongoing, 9.92 %, 💻 mattwang44
- persistence.po-----------------------❌
- pickle.po----------------------------Ongoing, 13.72 %
- pickletools.po-----------------------Ongoing, 23.53 %, 💻 mattwang44
Expand Down Expand Up @@ -384,7 +384,7 @@
- tty.po-------------------------------Ongoing, 72.73 %
- turtle.po----------------------------Ongoing, 21.25 %
- types.po-----------------------------Ongoing, 5.77 %
- typing.po----------------------------Ongoing, 30.0 %
- typing.po----------------------------Ongoing, 30.0 %, 💻 rockleona
- undoc.po-----------------------------Ongoing, 22.22 %
- unicodedata.po-----------------------Ongoing, 21.88 %
- unittest.mock-examples.po------------❌, 💻 ken71301
Expand Down Expand Up @@ -419,7 +419,7 @@
- xml.sax.utils.po---------------------Ongoing, 14.29 %
- xmlrpc.client.po---------------------Ongoing, 23.0 %
- xmlrpc.po----------------------------✅
- xmlrpc.server.po---------------------Ongoing, 18.37 %
- xmlrpc.server.po---------------------Ongoing, 18.37 %, 💻 paultsaich
- zipapp.po----------------------------Ongoing, 8.82 %
- zipfile.po---------------------------Ongoing, 9.9 %
- zipimport.po-------------------------Ongoing, 8.33 %
Expand Down Expand Up @@ -472,7 +472,7 @@
- 3.1.po-------------------------------Ongoing, 35.71 %
- 3.10.po------------------------------✅
- 3.11.po------------------------------Ongoing, 94.79 %
- 3.12.po------------------------------Ongoing, 43.82 %
- 3.12.po------------------------------Ongoing, 43.82 %, 💻 mattwang44
- 3.2.po-------------------------------Ongoing, 24.32 %
- 3.3.po-------------------------------Ongoing, 47.13 %
- 3.4.po-------------------------------Ongoing, 20.35 %
Expand Down
16 changes: 10 additions & 6 deletions .scripts/summarize_progress/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
import polib
import glob
import datetime
Expand Down Expand Up @@ -36,7 +37,7 @@ def get_open_issues_count() -> int:
def get_github_issues() -> list:
NUMBER_OF_ISSUES = get_open_issues_count()

url = f"https://api.github.com/repos/python/python-docs-zh-tw/issues?per_page={NUMBER_OF_ISSUES}"
url = f"https://api.github.com/search/issues?q=repo:python/python-docs-zh-tw+type:issue+state:open&per_page={NUMBER_OF_ISSUES}"
headers = {
"Accept": "application/vnd.github+json",
"X-GitHub-Api-Version": "2022-11-28",
Expand All @@ -45,7 +46,7 @@ def get_github_issues() -> list:
result = r.json()

result_list = []
for issue in result:
for issue in result["items"]:
title_segments = issue["title"].split()

if len(title_segments) < 2:
Expand All @@ -57,11 +58,14 @@ def get_github_issues() -> list:

filename = title_segments[1].strip("`")

filename_segments = filename.split("/")
if len(filename_segments) < 2:
continue
if filename_segments[1][-3:] != ".po":
if re.fullmatch("[a-zA-z-]+/[a-zA-Z0-9._-]+.po", filename):
filename_segments = filename.split("/")
# print(filename_segments)
elif re.fullmatch("[a-zA-z-]+/[a-zA-Z0-9._-]+", filename):
filename_segments = filename.split("/")
filename_segments[1] += ".po"
else:
continue

result_list.append([filename_segments, issue["assignee"]["login"]])

Expand Down