File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 55
66def _count (pot ) -> tuple [int , int ]:
77 pot = pofile (pot )
8- string_count = 0
98 word_count = 0
109 for entry in pot :
11- string_count += 1
1210 word_count += len (entry .msgid .split ())
13- return string_count , word_count
11+ return len ( pot ) , word_count
1412
1513
1614def get_counts (dir : Path ) -> tuple [int , int ]:
@@ -20,7 +18,13 @@ def get_counts(dir: Path) -> tuple[int, int]:
2018 for file in files :
2119 if file .endswith ('.pot' ):
2220 pot = root .joinpath (root , file )
23- strings , words = _count (pot )
21+ strings , words = _count (pot . read_text () )
2422 total_string_count += strings
2523 total_word_count += words
2624 return total_string_count , total_word_count
25+
26+
27+ if __name__ == '__main__' :
28+ print (
29+ get_counts (Path (__file__ ).parent .joinpath ('clones/cpython/Doc/build/gettext' ))
30+ )
You can’t perform that action at this time.
0 commit comments