Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3279bd2

Browse files
authored
Merge pull request#32 from raulcd/show_tutorial_progress
show tutorial progress
2 parents37cf5a2 +497bce7 commit3279bd2

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

‎Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ help:
3434
@echo" pot Create/Update POT files from source files"
3535
@echo" serve Serve a built documentation on http://localhost:8000"
3636
@echo" spell Check spelling, storing output in$(POSPELL_TMP_DIR)"
37+
@echo" progress To compute current progression on the tutorial"
3738
@echo""
3839

3940

@@ -202,3 +203,7 @@ clean:
202203
rm -fr$(VENV)
203204
rm -rf$(POSPELL_TMP_DIR)
204205
find -name'*.mo' -delete
206+
207+
.PHONY: progress
208+
progress: venv
209+
$(VENV)/bin/python scripts/print_percentage.py

‎requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Sphinx==2.2.0
22
blurb
3+
polib
34
pospell
45
powrap
56
python-docs-theme

‎scripts/print_percentage.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python
2+
3+
importglob
4+
importos
5+
6+
importpolib# fades
7+
8+
PO_DIR=os.path.abspath(
9+
os.path.join(
10+
os.path.dirname(__file__),
11+
'..',
12+
))
13+
14+
15+
defmain():
16+
forpofilenameinglob.glob(PO_DIR+'**/tutorial/*.po'):
17+
po=polib.pofile(pofilename)
18+
file_per=po.percent_translated()
19+
print(f"{pofilename} :::{file_per}%")
20+
21+
22+
if__name__=="__main__":
23+
main()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp