python-babel / babel

The official repository for Babel, the Python Internationalization Library
http://babel.pocoo.org/
BSD 3-Clause "New" or "Revised" License
1.34k stars 448 forks source link

fix: check_and_call_extract_file uses the first matching method and options, instead of the first matching method and last matching options #1121

Open jpmckinney opened 3 months ago

jpmckinney commented 3 months ago

Otherwise, if I want to use a different method for one file AND use options, I can't do, for example:

[myextractor: path/file.py]
myoption = myvalue

[python: path/**.py]

The current code will match path/file.py to myextractor, but it'll use the empty options from python...

jpmckinney commented 2 months ago

I would love to, but it's very hard to figure out where/how to test this. Basically, I'd need some scaffolding to be able to provide a configuration file, source files and a custom extractor and test whether the output is as expected.