]> https://gitweb.dealii.org/ - dealii.git/commitdiff
wrapcomments.py: do not break @page 518/head
authorTimo Heister <timo.heister@gmail.com>
Wed, 11 Feb 2015 15:58:31 +0000 (10:58 -0500)
committerTimo Heister <timo.heister@gmail.com>
Wed, 11 Feb 2015 15:58:31 +0000 (10:58 -0500)
contrib/utilities/wrapcomments.py

index 9dc12dc78ab4a105b611c3a95218c98ec1a57cc6..ac2c2414a787c0a3f4526ef2ccb5a314fcfce2a5 100755 (executable)
@@ -110,6 +110,16 @@ 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 "@page" in lines[idx]:
+            # do not break @page
+            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)
+            out.append(start + thisline.strip())
+
         elif "@ref" in lines[idx]:
             # @ref link "some long description"
             # is special, and we mustn't break it
@@ -388,6 +398,14 @@ lineO = [" /**", \
          "  */"]
 assert(format_block(lineI)==lineO)
 
+# do not break @page:
+longtext = "bla bla"*20
+lineI = [" /**", \
+         "  * @page " + longtext, \
+         "  * hello", \
+         "  */"]
+assert(format_block(lineI)==lineI)
+
 
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.