Skip to content

Commit ed117aa

Browse files
committed
Update f-String Error and Add Shell Script
1 parent 5182be8 commit ed117aa

File tree

4 files changed

+157
-8
lines changed

4 files changed

+157
-8
lines changed

.scripts/mark_file.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
WORK_DIR=.scripts
4+
cd $WORK_DIR
5+
6+
source utils/install_poetry.sh
7+
8+
poetry lock
9+
poetry install
10+
poetry run bash -c "
11+
python mark_file/main.py
12+
13+
"

.scripts/mark_file/main.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import polib
22
import os
33
import datetime
4-
import argparse
54
import requests
65

76

@@ -25,8 +24,7 @@ def entry_check(pofile):
2524
def get_github_issue():
2625
NUMBER_OF_ISSUES = 100
2726

28-
url = f"https://api.github.com/repos/python/python-docs-zh-tw/issues?per_page={
29-
NUMBER_OF_ISSUES}"
27+
url = f"https://api.github.com/repos/python/python-docs-zh-tw/issues?per_page={NUMBER_OF_ISSUES}"
3028
headers = {
3129
"Accept": "application/vnd.github+json",
3230
"X-GitHub-Api-Version": "2022-11-28"
@@ -64,7 +62,7 @@ def get_github_issue():
6462

6563
def format_line_file(filename, result):
6664
tmp = f" - {filename}"
67-
tmp = f"{tmp}{"-" * (40-len(tmp))}{result}\r"
65+
tmp = f"{tmp}{'-' * (40-len(tmp))}{result}\r"
6866
return tmp
6967

7068

@@ -108,6 +106,6 @@ def format_line_directory(dirname):
108106
writeliner.append(format_line_file(filename, result))
109107

110108
file = open(
111-
f"mark_file/dist/mark_file_{datetime.datetime.today().strftime("%Y%m%d_%H%M%S")}.md", "w")
109+
f"mark_file/dist/mark_file_{datetime.datetime.today().strftime('%Y%m%d_%H%M%S')}.md", "w")
112110
file.writelines(writeliner)
113111
file.close()

.scripts/poetry.lock

+140-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.scripts/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ python = "^3.10"
1010
polib = "1.1.1"
1111
googletrans = "3.1.0a0"
1212
translate-toolkit = "3.8.1"
13-
13+
requests="2.31.0"
1414

1515
[build-system]
1616
requires = ["poetry-core"]

0 commit comments

Comments
 (0)