Re: [PATCH] tools/docs/checktransupdate.py: add support for scanning directory
From: Haoyang Liu
Date: Mon Mar 09 2026 - 12:43:40 EST
On 3/10/2026 12:07 AM, Jonathan Corbet wrote:
Haoyang LIU <tttturtleruss@xxxxxxxxx> writes:
Origin script can only accept a file as parameter, this commit enablesI've applied this, with one tweak:
it to scan a directory.
Usage example:
./scripts/checktransupdate.py Documentation/translations/zh_CN/dev-tools
+ else:There's no reason to break that line there, so I took the liberty of
+ # 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"))
joining it back together.
Dear Jon,
Thanks for pointing it out, I didn't notice when I make this change, and I'm sorry for that.
Sincerely,
Haoyang
Thanks,
jon