Skip to content

Commit f0c4709

Browse files
committed
text wrap long descriptions
1 parent 2445be3 commit f0c4709

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

util/runparams.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
import os
4949
import re
5050
from util import msg
51-
51+
import textwrap
5252

5353
# some utility functions to automagically determine what the data
5454
# types are
@@ -316,8 +316,15 @@ def print_sphinx_tables(self, outfile="params-sphinx.inc"):
316316

317317
for key in keys:
318318
_, option = key.split('.')
319+
descr = textwrap.wrap(self.param_comments[key].strip(), 50)
320+
if len(descr) == 0:
321+
descr = [" "]
322+
319323
f.write(entry.format(option, "``{}``".format(str(self.params[key]).strip()),
320-
self.param_comments[key].strip()))
324+
descr[0]))
325+
if len(descr) > 1:
326+
for line in descr[1:]:
327+
f.write(entry.format("", "", line))
321328
f.write(separator)
322329

323330
f.write("\n")

0 commit comments

Comments
 (0)