@@ -32,12 +32,16 @@ def get_lines(filename: str = "docsbuild.log") -> list[str]:
3232 return lines
3333
3434
35- def calc_time (lines : list [str ]) -> None :
35+ def calc_time (lines : list [str ], kind : str = "xx" ) -> None :
3636 in_progress = False
3737 in_progress_line = ""
3838
39- print ("Start | Version | Language | Build | Trigger" )
40- print (":-- | :--: | :--: | --: | :--:" )
39+ print (
40+ "Start | Kind | Version | Language | Build | Trigger"
41+ )
42+ print (
43+ ":-- | :--: | :--: | :--: | --: | :--:"
44+ )
4145
4246 for line in lines :
4347 line = line .strip ()
@@ -51,7 +55,7 @@ def calc_time(lines: list[str]) -> None:
5155 fmt_duration = format_seconds (state_data ["last_build_duration" ])
5256 reason = state_data ["triggered_by" ]
5357 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 } "
5559 )
5660
5761 if line .endswith ("Build start." ):
@@ -65,14 +69,14 @@ def calc_time(lines: list[str]) -> None:
6569 timestamp = f"{ line [:16 ]} UTC"
6670 _ , fmt_duration = line .removesuffix (")." ).split ("(" )
6771 print (
68- f"{ timestamp : <20} | --FULL- | -BUILD-- | { fmt_duration :<14} | -----------"
72+ f"{ timestamp : <20} | { kind : <12 } | --FULL- | -BUILD-- | { fmt_duration :<14} | -----------"
6973 )
7074
7175 if in_progress :
7276 start_timestamp = f"{ in_progress_line [:16 ]} UTC"
7377 language , version = in_progress_line .split (" " )[3 ].removesuffix (":" ).split ("/" )
7478 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... | ..."
7680 )
7781
7882 print ()
@@ -99,16 +103,16 @@ def calc_time(lines: list[str]) -> None:
99103 print ("Build times (HTML only; English)" )
100104 print ("=======================" )
101105 print ()
102- calc_time (get_lines ("docsbuild-only-html-en.log" ))
106+ calc_time (get_lines ("docsbuild-only-html-en.log" ), "only-html-en" )
103107
104108 if "only-html" in args .select_output :
105109 print ("Build times (HTML only)" )
106110 print ("=======================" )
107111 print ()
108- calc_time (get_lines ("docsbuild-only-html.log" ))
112+ calc_time (get_lines ("docsbuild-only-html.log" ), "only-html" )
109113
110114 if "no-html" in args .select_output :
111115 print ("Build times (no HTML)" )
112116 print ("=====================" )
113117 print ()
114- calc_time (get_lines ("docsbuild-no-html.log" ))
118+ calc_time (get_lines ("docsbuild-no-html.log" ), "no-html" )
0 commit comments