Tools: only prompts for user input when running in a TTY

This commit is contained in:
Campbell Barton
2024-09-23 09:59:13 +10:00
parent 0e51bad197
commit a74ad65e8e

View File

@@ -13,9 +13,13 @@ Example usage:
import argparse
import dataclasses
import sys
from datetime import date
from gitea_utils import gitea_json_issues_search
IS_ATTY = sys.stdout.isatty()
@dataclasses.dataclass
class ModuleInfo:
@@ -95,7 +99,8 @@ def compile_list(severity: str) -> None:
new_label_name = label_iter["name"]
print(f"ALERT: The name of label of '{current_module_name}' changed.")
print(f"The new name is '{new_label_name}'.")
input("Press enter to continue: \n")
if IS_ATTY:
input("Press enter to continue: \n")
modules[current_module_name].buglist.append(f"[#{number}]({html_url})")
modules[current_module_name].buglist_full.append(f"* [{title}]({html_url}) - {created_at}\n")