Feneric / doxypypy

A more Pythonic version of doxypy, a Doxygen filter for Python.
GNU General Public License v2.0
149 stars 49 forks source link

Needed a workaround to handle function decorators #66

Closed fa-vio closed 5 years ago

fa-vio commented 5 years ago

Hello, I am using function decorators in my code, which get misinterpreted by Doxygen. For example, a SocketIO decorator with a namespace:

@socketio.on('some_event', namespace='/test')
def event_handler(data):
    """
        DOCSTRING HERE
    """

is recognized as a namespace itself, and the docstring is not associated to the function. I tried to add ad-hoc aliases to the Doxyfile so that it gets ignored by Doxygen's parser, without success. Any suggestions?

fa-vio commented 5 years ago

Should anyone ever have the same issue, a workaround I've been using is to discard decorators from the "intermediate" source file generated by doxypypy, before it gets processed by Doxygen. To do so, just filter doxypypy's output through sed in your filter script, like

#!/bin/sh
doxypypy -a -c -t 4 $1 | sed -e '/socketio.on/d' -e '/someother/d'

This trick does the job.