| Index: trunk/pywikipedia/replace.py |
| — | — | @@ -317,12 +317,13 @@ |
| 318 | 318 | prevent the bot of doing anything. |
| 319 | 319 | include |
| 320 | 320 | One standalone value, either the name of a dictionary in your |
| 321 | | - file or the name of a callable function that returns such a |
| 322 | | - dictionary. This dictionary may have any of the five above keys |
| 323 | | - (but not 'include' itself!), and the lists belonging to those |
| 324 | | - keys will be added to your exceptions. This way you may define |
| 325 | | - one or more basic collection of exceptions used for multiple |
| 326 | | - fixes, and add separate exceptions to each fix. |
| | 321 | + file or the name of a callable function that takes the name of |
| | 322 | + the fix as argument and returns a dictionary of exceptions. |
| | 323 | + This dictionary may have any of the five above keys (but not |
| | 324 | + 'include' itself!), and the lists belonging to those keys will |
| | 325 | + be added to your exceptions. This way you may define one or |
| | 326 | + more basic collection of exceptions used for multiple fixes, |
| | 327 | + and add separate exceptions to each fix. |
| 327 | 328 | |
| 328 | 329 | """ |
| 329 | 330 | self.generator = generator |
| — | — | @@ -811,6 +812,7 @@ |
| 812 | 813 | |
| 813 | 814 | else: |
| 814 | 815 | # Perform one of the predefined actions. |
| | 816 | + fixname = fix # Save the name for passing to exceptions function. |
| 815 | 817 | try: |
| 816 | 818 | fix = fixes.fixes[fix] |
| 817 | 819 | except KeyError: |
| — | — | @@ -833,7 +835,7 @@ |
| 834 | 836 | if 'include' in exceptions: |
| 835 | 837 | incl = exceptions['include'] |
| 836 | 838 | if callable(incl): |
| 837 | | - baseExcDict = incl() |
| | 839 | + baseExcDict = incl(fixname) |
| 838 | 840 | else: |
| 839 | 841 | try: |
| 840 | 842 | baseExcDict = incl |