Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add options to only show certain build times#307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hugovk merged 2 commits intopython:mainfromhugovk:check_times-argparse
Aug 15, 2025
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 34 additions & 14 deletionscheck_times.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,6 +10,7 @@
$ python check_times.py
"""

import argparse
import gzip
import tomllib
from pathlib import Path
Expand DownExpand Up@@ -78,17 +79,36 @@ def calc_time(lines: list[str]) -> None:


if __name__ == "__main__":
print("Build times (HTML only; English)")
print("=======================")
print()
calc_time(get_lines("docsbuild-only-html-en.log"))

print("Build times (HTML only)")
print("=======================")
print()
calc_time(get_lines("docsbuild-only-html.log"))

print("Build times (no HTML)")
print("=====================")
print()
calc_time(get_lines("docsbuild-no-html.log"))
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
)
Comment on lines +82 to +84
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We could mirror thebuild_docs.py args here?

    parser.add_argument(        "--select-output",        choices=("no-html", "only-html", "only-html-en"),        help="Choose what outputs to build.",    )

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Something like this?45f56e5

ALL_BUILDS = ("no-html", "only-html", "only-html-en")
parser.add_argument(
"--select-output",
choices=ALL_BUILDS,
nargs="*",
help="Choose what builds to show (default: all).",
)
args = parser.parse_args()
parser.suggest_on_error = True

if not args.select_output:
args.select_output = ALL_BUILDS

if "only-html-en" in args.select_output:
print("Build times (HTML only; English)")
print("=======================")
print()
calc_time(get_lines("docsbuild-only-html-en.log"))

if "only-html" in args.select_output:
print("Build times (HTML only)")
print("=======================")
print()
calc_time(get_lines("docsbuild-only-html.log"))

if "no-html" in args.select_output:
print("Build times (no HTML)")
print("=====================")
print()
calc_time(get_lines("docsbuild-no-html.log"))
Loading

[8]ページ先頭

©2009-2025 Movatter.jp