From: Timo Heister Date: Wed, 6 Apr 2016 09:47:15 +0000 (+0200) Subject: teach wrapcomments.py about @name X-Git-Tag: v8.5.0-rc1~1137^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b1603b75f596cbe06e7cb05bcd4b220a8113dee;p=dealii.git teach wrapcomments.py about @name --- diff --git a/contrib/utilities/wrapcomments.py b/contrib/utilities/wrapcomments.py index 8a0d93f67f..b3c0c30a22 100755 --- a/contrib/utilities/wrapcomments.py +++ b/contrib/utilities/wrapcomments.py @@ -102,6 +102,8 @@ def format_block(lines, infostr=""): ops_separate_line = ["
    ", "
", "", "@{", "@}", "
"] + # separate and do not break: + ops_title_line = ["@page", "@name"] #todo: # @arg @c @cond @em @endcond @f{ @internal @name @post @pre @sa @@ -131,14 +133,15 @@ def format_block(lines, infostr=""): thisline = lines[idx].strip()[2:] out.append(start + thisline) - elif "@page" in lines[idx]: - # do not break @page + elif one_in(ops_title_line, lines[idx]): + # do not break @page, etc. if curlines!=[]: out.extend(wrap_block(remove_junk(curlines), start)) curlines=[] thisline = remove_junk([lines[idx]])[0] - if not thisline.startswith("@page") and not thisline.startswith("(@page"): - print ("%s warning %s not at start of line"%(infostr, "@page"), file=sys.stderr) + + if not thisline.split(" ")[0] in ops_title_line: + print ("%s warning title not at start of line"%(infostr), file=sys.stderr) out.append(start + thisline.strip()) elif "@ref" in lines[idx]: @@ -503,6 +506,13 @@ lineI = [" /**", \ lineO = lineI assert(format_block(lineI)==lineO) +# do not break @name: +longtext = "bla bla"*20 +lineI = [" /**", \ + " * @name " + longtext, \ + " * hello", \ + " */"] +assert(format_block(lineI)==lineI) #print (lineI)