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

From: Jonathan Corbet

Date: Mon Mar 09 2026 - 12:47:48 EST


Haoyang Liu <tttturtleruss@xxxxxxxxx> writes:

> 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 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.
>
> Dear Jon,
>
> Thanks for pointing it out, I didn't notice when I make this change, and
> I'm sorry for that.

Not a big problem! Thanks for working to make our tools better.

jon