Skip to content

Commit 124693f

Browse files
committed
Keep build_docs() near main()
1 parent 6c194eb commit 124693f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

build_docs.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,20 @@ def parse_languages_from_config():
11041104
return languages
11051105

11061106

1107+
def format_seconds(seconds: float) -> str:
1108+
hours, remainder = divmod(seconds, 3600)
1109+
minutes, seconds = divmod(remainder, 60)
1110+
hours, minutes, seconds = int(hours), int(minutes), round(seconds)
1111+
1112+
match (hours, minutes, seconds):
1113+
case 0, 0, s:
1114+
return f"{s}s"
1115+
case 0, m, s:
1116+
return f"{m}m {s}s"
1117+
case h, m, s:
1118+
return f"{h}h {m}m {s}s"
1119+
1120+
11071121
def build_docs(args) -> bool:
11081122
"""Build all docs (each languages and each versions)."""
11091123
versions = parse_versions_from_devguide()
@@ -1151,20 +1165,6 @@ def build_docs(args) -> bool:
11511165
return all_built_successfully
11521166

11531167

1154-
def format_seconds(seconds: float) -> str:
1155-
hours, remainder = divmod(seconds, 3600)
1156-
minutes, seconds = divmod(remainder, 60)
1157-
hours, minutes, seconds = int(hours), int(minutes), round(seconds)
1158-
1159-
match (hours, minutes, seconds):
1160-
case 0, 0, s:
1161-
return f"{s}s"
1162-
case 0, m, s:
1163-
return f"{m}m {s}s"
1164-
case h, m, s:
1165-
return f"{h}h {m}m {s}s"
1166-
1167-
11681168
def main():
11691169
"""Script entry point."""
11701170
args = parse_args()

0 commit comments

Comments
 (0)