From: Timo Heister Date: Mon, 21 Dec 2015 23:01:40 +0000 (-0500) Subject: teach wrapcomments.py about nested lists X-Git-Tag: v8.4.0-rc2~136^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4deb311f24ad47034b4e8098f020dce9cea22e4;p=dealii.git teach wrapcomments.py about nested lists --- diff --git a/contrib/utilities/wrapcomments.py b/contrib/utilities/wrapcomments.py index 30a870e511..ddd53eefae 100755 --- a/contrib/utilities/wrapcomments.py +++ b/contrib/utilities/wrapcomments.py @@ -116,6 +116,13 @@ def format_block(lines, infostr=""): if it in thisline and thisline!=it: print ("%s warning %s not in separate line"%(infostr, it), file=sys.stderr) out.append(start + thisline) + elif starts_with_one(["* - ", "* - "],lines[idx].strip()): + if curlines!=[]: + out.extend(wrap_block(remove_junk(curlines), start)) + curlines=[] + thisline = lines[idx].strip()[2:] + out.append(start + thisline) + elif "@page" in lines[idx]: # do not break @page if curlines!=[]: @@ -423,6 +430,19 @@ lineO = [" /**", \ " */"] assert(format_block(lineI)==lineO) +# nested lists +lineI = [" /**", \ + " * Hello:", \ + " * - A", \ + " * - B", \ + " * - C", \ + " * - D", \ + " * - E", \ + " */"] +lineO = lineI +assert(format_block(lineI)==lineO) + + # now open the file and do the work