Skip to content

Commit d231858

Browse files
committed
Adding debug and version information to doxycommentview
The README says: Furthermore you can display the doxygen version used at the top of the output using `--version` and the warnings emitted by doxygen at the bottom of the output by means of `--debug`.
1 parent 83118ee commit d231858

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

addon/doxycommentview/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ The relevant settings, such as alias definitions, will be taken from the Doxyfil
2727
If desired you can set the port for the webserver using `--port` and
2828
point to the location of the doxygen binary using `--doxygen`
2929

30+
Furthermore you can display the doxygen version used at the top of the output using `--version` and
31+
the warnings emitted by doxygen at the bottom of the output by means of `--debug`.
32+
3033
Once the server is started, point your browser to the index page
3134

3235
firefox http://localhost:8000/index.html

addon/doxycommentview/doxycommentview.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,19 @@ def main():
2828
parser.add_argument('--port', type=int, default=8000, help='Port number to run the server on')
2929
parser.add_argument('--doxygen', type=str, default='doxygen', help='Path to doxygen executable')
3030
parser.add_argument('--doxyfile', type=str, default='Doxyfile', help='Path to Doxyfile to use')
31+
parser.add_argument('--debug', action="store_true", help='Display warnings')
32+
parser.add_argument('--version', action="store_true", help='Display doxygen version used')
3133
args = parser.parse_args()
3234

3335
PORT = args.port
3436
DOXYGEN = args.doxygen
3537
DOXYFILE = args.doxyfile
38+
DEBUG = args.debug
39+
VERSION = args.version
40+
41+
if VERSION:
42+
VERSION_STR = subprocess.run([DOXYGEN, '-v'], \
43+
capture_output=True, text=True, encoding="utf-8")
3644

3745
class RequestHandler(http.server.SimpleHTTPRequestHandler):
3846
def do_POST(self):
@@ -50,7 +58,13 @@ def do_POST(self):
5058
self.send_response(200)
5159
self.send_header('Content-type', 'text/html')
5260
self.end_headers()
61+
if VERSION:
62+
self.wfile.write(VERSION_STR.stdout.encode())
63+
self.wfile.write("<hr>".encode())
5364
self.wfile.write(result.stdout.encode())
65+
if DEBUG:
66+
self.wfile.write("<hr>".encode())
67+
self.wfile.write(result.stderr.replace('\n','<br>').encode())
5468

5569
httpd = socketserver.TCPServer(("", PORT), RequestHandler)
5670

0 commit comments

Comments
 (0)