doc: make script docgen.py compliant with PEP8, replace %-formatting with .format()