@@ -20,36 +20,42 @@ def main():
20
20
issue ["title" ].split ()[- 1 ]: issue ["user" ]["login" ] for issue in issues
21
21
}
22
22
23
- po_files = list ( Path ("." ).glob ("**/*.po" ))
23
+ po_files = [ file for file in Path ("." ).glob ("**/*.po" ) if ".git/" not in str ( file )]
24
24
25
25
po_files_per_directory = {
26
26
path .parent .name : set (path .parent .glob ("*.po" )) for path in po_files
27
27
}
28
28
29
29
for directory , po_files in sorted (po_files_per_directory .items ()):
30
- print ( " \n \n # " + directory )
30
+ buffer = []
31
31
folder_stats = []
32
32
for po_file in sorted (po_files ):
33
33
stats = polib .pofile (po_file )
34
34
po_file_stat = stats .percent_translated ()
35
35
if po_file_stat == 100 :
36
36
folder_stats .append (po_file_stat )
37
37
continue
38
- print (
39
- f"{ po_file .name :<30} " ,
40
- f"{ len (stats .translated_entries ()):3d} / { len (stats ):3d} " ,
41
- f"({ po_file_stat :5.1f} % translated)" ,
42
- f"{ len (stats .fuzzy_entries ())} fuzzy" if stats .fuzzy_entries () else "" ,
43
- f"Réservé par { reservations [str (po_file )]} "
44
- if str (po_file ) in reservations
45
- else "" ,
38
+ buffer .append (
39
+ f"- { po_file .name :<30} "
40
+ + f"{ len (stats .translated_entries ()):3d} / { len (stats ):3d} "
41
+ + f"({ po_file_stat :5.1f} % translated)"
42
+ + (
43
+ f", { len (stats .fuzzy_entries ())} fuzzy"
44
+ if stats .fuzzy_entries ()
45
+ else ""
46
+ )
47
+ + (
48
+ f", réservé par { reservations [str (po_file )]} "
49
+ if str (po_file ) in reservations
50
+ else ""
51
+ )
46
52
)
47
53
folder_stats .append (po_file_stat )
48
- # TODO: Have the percentage printed next to the folder name
49
- print ("\n {}% done." . format ( round ( statistics . mean ( folder_stats ), 2 ) ))
54
+ print ( f" \n \n # { directory } ( { statistics . mean ( folder_stats ):.2f } % done) \n " )
55
+ print ("\n " . join ( buffer ))
50
56
51
57
52
- if __name__ == ' __main__' :
58
+ if __name__ == " __main__" :
53
59
# TODO: Add PR handling
54
60
# TODO: Add total from all folders
55
61
main ()
0 commit comments