INNER CODE UNIT · Python

print_l10n_file

rfc-st/humble · humble.py:435

def print_l10n_file(args, l10n_file, *, slice_ln=False):
    """Print the contents of a file in the specified language and exit."""
    lang_es = args.lang == "es"
    lang_idx = 1 if lang_es else 0
    l10n_file = HUMBLE_FILES[L10N_IDXS[l10n_file][lang_idx]]
    l10n_slice = SLICE_INT[2 if lang_es else 3]
    file_path = OS_PATH / HUMBLE_DIRS[1] / l10n_file
    with file_path.open(encoding="utf8") as l10n_source:
        l10n_lines = islice(l10n_source, l10n_slice, None) if slice_ln else \
            l10n_source
        for line in l10n_lines:
            prefix = f" {STYLE[0]}" if line.startswith("[") else "  "
            print(f"{prefix}{line}", end="")
    sys.exit(0)


def validate_testssl_uri(uri):
    """Check that the URI is well-formed before analyzing it.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…