|
13 | 13 | import datetime
|
14 | 14 | import errno
|
15 | 15 | import os
|
| 16 | +import re |
16 | 17 | from socket import gethostname
|
17 | 18 | from string import Template
|
18 | 19 | import select
|
@@ -703,27 +704,37 @@ def _get_trait_desc(self, inputs, name, spec):
|
703 | 704 | requires = spec.requires
|
704 | 705 |
|
705 | 706 | manhelpstr = ['\t%s' % name]
|
| 707 | + |
706 | 708 | try:
|
707 | 709 | setattr(inputs, name, None)
|
708 | 710 | except TraitError as excp:
|
709 | 711 | def_val = ''
|
710 | 712 | if getattr(spec, 'usedefault'):
|
711 |
| - def_val = ', nipype default value: %s' % str(getattr(spec, 'default_value')()[1]) |
| 713 | + def_arg = getattr(spec, 'default_value')()[1] |
| 714 | + def_val = ', nipype default value: %s' % def_arg |
712 | 715 | line = "(%s%s)" % (excp.info, def_val)
|
713 |
| - manhelpstr = wrap(line, 90, initial_indent=manhelpstr[0]+': ', |
| 716 | + manhelpstr = wrap(line, 70, |
| 717 | + initial_indent=manhelpstr[0]+': ', |
714 | 718 | subsequent_indent='\t\t ')
|
| 719 | + |
715 | 720 | if desc:
|
716 | 721 | for line in desc.split('\n'):
|
717 |
| - manhelpstr += wrap(line, 90, initial_indent='\t\t', |
| 722 | + line = re.sub("\s+", " ", line) |
| 723 | + manhelpstr += wrap(line, 70, |
| 724 | + initial_indent='\t\t', |
718 | 725 | subsequent_indent='\t\t')
|
| 726 | + |
719 | 727 | if xor:
|
720 | 728 | line = '%s' % ', '.join(xor)
|
721 |
| - manhelpstr += wrap(line, 90, initial_indent='\t\tmutually_exclusive: ', |
| 729 | + manhelpstr += wrap(line, 70, |
| 730 | + initial_indent='\t\tmutually_exclusive: ', |
722 | 731 | subsequent_indent='\t\t ')
|
723 |
| - if requires: # and name not in xor_done: |
| 732 | + |
| 733 | + if requires: |
724 | 734 | others = [field for field in requires if field != name]
|
725 | 735 | line = '%s' % ', '.join(others)
|
726 |
| - manhelpstr += wrap(line, 90, initial_indent='\t\trequires: ', |
| 736 | + manhelpstr += wrap(line, 70, |
| 737 | + initial_indent='\t\trequires: ', |
727 | 738 | subsequent_indent='\t\t ')
|
728 | 739 | return manhelpstr
|
729 | 740 |
|
|
0 commit comments