Re: [PATCH] tools/docs/checktransupdate.py: add support for scanning directory

From: Jonathan Corbet

Date: Mon Mar 09 2026 - 12:13:06 EST


Haoyang LIU <tttturtleruss@xxxxxxxxx> writes:

> Origin script can only accept a file as parameter, this commit enables
> it to scan a directory.
>
> Usage example:
> ./scripts/checktransupdate.py Documentation/translations/zh_CN/dev-tools

I've applied this, with one tweak:

> + else:
> + # check if the files are directories or files
> + new_files = []
> + for file in files:
> + if os.path.isfile(file):
> + new_files.append(file)
> + elif os.path.isdir(file):
> + # for directories, list all files in the directory and its subfolders
> + new_files.extend(list_files_with_excluding_folders(
> + file, [], "rst"))

There's no reason to break that line there, so I took the liberty of
joining it back together.


Thanks,

jon