Skip to content

Commit 3915132

Browse files
committed
build: remove extra <p></p> generated by blank lines.
1 parent 6ac6516 commit 3915132

File tree

1 file changed

+42
-26
lines changed

1 file changed

+42
-26
lines changed

roundup/admin.py

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,32 @@ def help_commands_html(self, indent_re=indent_re):
261261
for command in commands:
262262
h = _(command.__doc__).split('\n')
263263
name = command.__name__[3:]
264-
usage = h[0].replace('<','&lt;').replace('>','&gt;')[7:]
264+
# first line is "<name> <params and stuff>
265+
usage = h[0][len(name) + 1:].replace('<','&lt;').replace('>','&gt;')[7:]
265266
print("""
266267
<tr><td valign=top><strong>%(name)s</strong></td>
267-
<td><tt>- %(usage)s</tt>
268-
<pre>""" % locals())
268+
<td><p><tt>%(usage)s</tt></p>
269+
""" % locals())
269270
indent = indent_re.match(h[1])
270271
if indent: indent = len(indent.group(1)) # noqa: E701
271-
for line in h[1:]:
272+
lines_to_process = len(h[1:])
273+
print('<p>')
274+
for lineno, line in enumerate(h[1:]):
272275
line = line.replace('<','&lt;').replace('>','&gt;')
273276
if indent:
274-
print(line[indent:])
277+
clean_line = line[indent:]
275278
else:
276-
print(line)
277-
print('</pre></td></tr>\n')
279+
clean_line = line
280+
if not clean_line:
281+
print('</p><p>')
282+
continue
283+
if clean_line.startswith(' '): # indented example line
284+
print("<pre>%s</pre>" % clean_line)
285+
else:
286+
print(clean_line)
287+
if lineno == lines_to_process:
288+
print('</p>')
289+
print('</td></tr>\n')
278290
print("</table>")
279291

280292
def help_all(self):
@@ -857,6 +869,7 @@ def do_find(self, args):
857869
def do_genconfig(self, args, update=False):
858870
''"""Usage: genconfig filename
859871
Create a new tracker config file with default values in filename.
872+
See also updateconfig.
860873
"""
861874
if len(args) < 1:
862875
raise UsageError(_('Not enough arguments supplied'))
@@ -1211,10 +1224,13 @@ def do_import(self, args, import_files=True):
12111224
The files used in the import are:
12121225
12131226
<class>.csv
1214-
This must define the same properties as the class (including
1215-
having a "header" line with those property names.)
1227+
This must define the same properties as the class
1228+
(including having a "header" line with those
1229+
property names.)
1230+
12161231
<class>-journals.csv
1217-
This defines the journals for the items being imported.
1232+
This defines the journals for the items
1233+
being imported.
12181234
12191235
The imported nodes will have the same nodeid as defined in the
12201236
import file, thus replacing any existing content.
@@ -1597,10 +1613,10 @@ def do_pack(self, args):
15971613
A period is specified using the suffixes "y", "m", and "d". The
15981614
suffix "w" (for "week") means 7 days.
15991615
1600-
"3y" means three years
1601-
"2y 1m" means two years and one month
1602-
"1m 25d" means one month and 25 days
1603-
"2w 3d" means two weeks and three days
1616+
"3y" means three years
1617+
"2y 1m" means two years and one month
1618+
"1m 25d" means one month and 25 days
1619+
"2w 3d" means two weeks and three days
16041620
16051621
Date format is "YYYY-MM-DD" eg:
16061622
2001-01-01
@@ -2086,22 +2102,22 @@ def do_table(self, args):
20862102
explicitly defined by defining the property as "name:width".
20872103
For example::
20882104
2089-
roundup> table priority id,name:10
2090-
Id Name
2091-
1 fatal-bug
2092-
2 bug
2093-
3 usability
2094-
4 feature
2105+
roundup> table priority id,name:10
2106+
Id Name
2107+
1 fatal-bug
2108+
2 bug
2109+
3 usability
2110+
4 feature
20952111
20962112
Also to make the width of the column the width of the label,
20972113
leave a trailing : without a width on the property. For example::
20982114
2099-
roundup> table priority id,name:
2100-
Id Name
2101-
1 fata
2102-
2 bug
2103-
3 usab
2104-
4 feat
2115+
roundup> table priority id,name:
2116+
Id Name
2117+
1 fata
2118+
2 bug
2119+
3 usab
2120+
4 feat
21052121
21062122
will result in a the 4 character wide "Name" column.
21072123
"""

0 commit comments

Comments
 (0)