Commit e1863434 authored by Karl Wette's avatar Karl Wette

Merge branch 'lal-python3' into 'master'

Updated doxygen script for python3

See merge request !381
parents 21333774 870c5a2b
Pipeline #26661 passed with stages
in 157 minutes and 36 seconds
from __future__ import print_function
__applicationName__ = "doxypy"
__blurb__ = """
doxypy is an input filter for Doxygen. It preprocesses python
......@@ -84,7 +86,7 @@ class FSM(object):
self.current_input = input
self.current_transition = transition
if options.debug:
print >>sys.stderr, "# FSM: executing (%s -> %s) for line '%s'" % (from_state, to_state, input)
print("# FSM: executing (%s -> %s) for line '%s'" % (from_state, to_state, input), file=sys.stderr)
callback(match)
return
......@@ -206,8 +208,8 @@ class Doxypy(object):
if self.output:
try:
if options.debug:
print >>sys.stderr, "# OUTPUT: ", self.output
print >>self.outstream, "\n".join(self.output)
print("# OUTPUT: ", self.output, file=sys.stderr)
print("\n".join(self.output), file=self.outstream)
self.outstream.flush()
except IOError:
# Fix for FS#33. Catches "broken pipe" when doxygen closes
......@@ -226,7 +228,7 @@ class Doxypy(object):
Closes the current commentblock and starts a new comment search.
"""
if options.debug:
print >>sys.stderr, "# CALLBACK: resetCommentSearch"
print("# CALLBACK: resetCommentSearch", file=sys.stderr)
self.__closeComment()
self.startCommentSearch(match)
......@@ -237,7 +239,7 @@ class Doxypy(object):
the current indentation.
"""
if options.debug:
print >>sys.stderr, "# CALLBACK: startCommentSearch"
print("# CALLBACK: startCommentSearch", file=sys.stderr)
self.defclass = [self.fsm.current_input]
self.comment = []
self.indent = match.group(1)
......@@ -249,7 +251,7 @@ class Doxypy(object):
appends the current line to the output.
"""
if options.debug:
print >>sys.stderr, "# CALLBACK: stopCommentSearch"
print("# CALLBACK: stopCommentSearch", file=sys.stderr)
self.__closeComment()
self.defclass = []
......@@ -261,7 +263,7 @@ class Doxypy(object):
Closes the open comment block, resets it and appends the current line.
"""
if options.debug:
print >>sys.stderr, "# CALLBACK: appendFileheadLine"
print("# CALLBACK: appendFileheadLine", file=sys.stderr)
self.__closeComment()
self.comment = []
self.output.append(self.fsm.current_input)
......@@ -273,7 +275,7 @@ class Doxypy(object):
well as singleline comments.
"""
if options.debug:
print >>sys.stderr, "# CALLBACK: appendCommentLine"
print("# CALLBACK: appendCommentLine", file=sys.stderr)
(from_state, to_state, condition, callback) = self.fsm.current_transition
# single line comment
......@@ -312,13 +314,13 @@ class Doxypy(object):
def appendNormalLine(self, match):
"""Appends a line to the output."""
if options.debug:
print >>sys.stderr, "# CALLBACK: appendNormalLine"
print("# CALLBACK: appendNormalLine", file=sys.stderr)
self.output.append(self.fsm.current_input)
def appendDefclassLine(self, match):
"""Appends a line to the triggering block."""
if options.debug:
print >>sys.stderr, "# CALLBACK: appendDefclassLine"
print("# CALLBACK: appendDefclassLine", file=sys.stderr)
self.defclass.append(self.fsm.current_input)
def makeCommentBlock(self):
......@@ -396,7 +398,7 @@ def optParse():
(options, filename) = parser.parse_args()
if not filename:
print >>sys.stderr, "No filename given."
print("No filename given.", file=sys.stderr)
sys.exit(-1)
return filename[0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment