Mercurial > hg
comparison mercurial/minirst.py @ 10937:a9d5943d2a30
minirst: removed unnecessary initindent variable
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Sun, 18 Apr 2010 15:47:49 +0200 |
parents | 2853c891ac41 |
children | 0a2c6948f5f4 |
comparison
equal
deleted
inserted
replaced
10936:2853c891ac41 | 10937:a9d5943d2a30 |
---|---|
287 defindent = indent + hang * ' ' | 287 defindent = indent + hang * ' ' |
288 text = ' '.join(map(str.strip, block['lines'][1:])) | 288 text = ' '.join(map(str.strip, block['lines'][1:])) |
289 return "%s\n%s" % (term, textwrap.fill(text, width=width, | 289 return "%s\n%s" % (term, textwrap.fill(text, width=width, |
290 initial_indent=defindent, | 290 initial_indent=defindent, |
291 subsequent_indent=defindent)) | 291 subsequent_indent=defindent)) |
292 initindent = subindent = indent | 292 subindent = indent |
293 if block['type'] == 'bullet': | 293 if block['type'] == 'bullet': |
294 if block['lines'][0].startswith('| '): | 294 if block['lines'][0].startswith('| '): |
295 # Remove bullet for line blocks and add no extra | 295 # Remove bullet for line blocks and add no extra |
296 # indention. | 296 # indention. |
297 block['lines'][0] = block['lines'][0][2:] | 297 block['lines'][0] = block['lines'][0][2:] |
319 option, arg, rest = m.groups() | 319 option, arg, rest = m.groups() |
320 subindent = indent + (len(option) + len(arg)) * ' ' | 320 subindent = indent + (len(option) + len(arg)) * ' ' |
321 | 321 |
322 text = ' '.join(map(str.strip, block['lines'])) | 322 text = ' '.join(map(str.strip, block['lines'])) |
323 return textwrap.fill(text, width=width, | 323 return textwrap.fill(text, width=width, |
324 initial_indent=initindent, | 324 initial_indent=indent, |
325 subsequent_indent=subindent) | 325 subsequent_indent=subindent) |
326 | 326 |
327 | 327 |
328 def format(text, width, indent=0, keep=None): | 328 def format(text, width, indent=0, keep=None): |
329 """Parse and format the text according to width.""" | 329 """Parse and format the text according to width.""" |