This patch changes convertrules.py so that it uses a simple decorator function.
Instead of the double procedure (defining a function, and then calling
conversions.append()):
def conv(str)
# manipulate str
return str
conversions.append((version, conv, message))
when adding a new conversion rule, you can now simply write:
@rule (version, message)
def conv(str)
# manipulate str
return str
This makes more clear what parameters belong to the conversion function, and
you do not need to type the conversions.append(( )) command each time.
The decorator function does simply the conversions.append() so nothing changes
otherwise. The conversions list with the convertrules is just the same as
before. I fixed a few missing slashes in non-raw strings as well. No
translatable strings have been changed.
I verified (by diffing the output of repr() on both lists) that the
conversions list is the same as in the old situation.