@@ -32,12 +32,16 @@ def get_lines(filename: str = "docsbuild.log") -> list[str]:
32
32
return lines
33
33
34
34
35
- def calc_time (lines : list [str ]) -> None :
35
+ def calc_time (lines : list [str ], kind : str = "xx" ) -> None :
36
36
in_progress = False
37
37
in_progress_line = ""
38
38
39
- print ("Start | Version | Language | Build | Trigger" )
40
- print (":-- | :--: | :--: | --: | :--:" )
39
+ print (
40
+ "Start | Kind | Version | Language | Build | Trigger"
41
+ )
42
+ print (
43
+ ":-- | :--: | :--: | :--: | --: | :--:"
44
+ )
41
45
42
46
for line in lines :
43
47
line = line .strip ()
@@ -51,7 +55,7 @@ def calc_time(lines: list[str]) -> None:
51
55
fmt_duration = format_seconds (state_data ["last_build_duration" ])
52
56
reason = state_data ["triggered_by" ]
53
57
print (
54
- f"{ start :%Y-%m-%d %H:%M UTC} | { version : <7} | { language : <8} | { fmt_duration :<14} | { reason } "
58
+ f"{ start :%Y-%m-%d %H:%M UTC} | { kind : <12 } | { version : <7} | { language : <8} | { fmt_duration :<14} | { reason } "
55
59
)
56
60
57
61
if line .endswith ("Build start." ):
@@ -65,14 +69,14 @@ def calc_time(lines: list[str]) -> None:
65
69
timestamp = f"{ line [:16 ]} UTC"
66
70
_ , fmt_duration = line .removesuffix (")." ).split ("(" )
67
71
print (
68
- f"{ timestamp : <20} | --FULL- | -BUILD-- | { fmt_duration :<14} | -----------"
72
+ f"{ timestamp : <20} | { kind : <12 } | --FULL- | -BUILD-- | { fmt_duration :<14} | -----------"
69
73
)
70
74
71
75
if in_progress :
72
76
start_timestamp = f"{ in_progress_line [:16 ]} UTC"
73
77
language , version = in_progress_line .split (" " )[3 ].removesuffix (":" ).split ("/" )
74
78
print (
75
- f"{ start_timestamp : <20} | { version : <7} | { language : <8} | In progress... | ..."
79
+ f"{ start_timestamp : <20} | { kind : <12 } | { version : <7} | { language : <8} | In progress... | ..."
76
80
)
77
81
78
82
print ()
@@ -99,16 +103,16 @@ def calc_time(lines: list[str]) -> None:
99
103
print ("Build times (HTML only; English)" )
100
104
print ("=======================" )
101
105
print ()
102
- calc_time (get_lines ("docsbuild-only-html-en.log" ))
106
+ calc_time (get_lines ("docsbuild-only-html-en.log" ), "only-html-en" )
103
107
104
108
if "only-html" in args .select_output :
105
109
print ("Build times (HTML only)" )
106
110
print ("=======================" )
107
111
print ()
108
- calc_time (get_lines ("docsbuild-only-html.log" ))
112
+ calc_time (get_lines ("docsbuild-only-html.log" ), "only-html" )
109
113
110
114
if "no-html" in args .select_output :
111
115
print ("Build times (no HTML)" )
112
116
print ("=====================" )
113
117
print ()
114
- calc_time (get_lines ("docsbuild-no-html.log" ))
118
+ calc_time (get_lines ("docsbuild-no-html.log" ), "no-html" )
0 commit comments