@@ -431,28 +431,22 @@ def _str_header(self, name, symbol='-'):
431
431
return [name , len (name )* symbol ]
432
432
433
433
def _str_indent (self , doc , indent = 4 ):
434
- out = []
435
- for line in doc :
436
- out += [' ' * indent + line ]
437
- return out
434
+ return [' ' * indent + line for line in doc ]
438
435
439
436
def _str_signature (self ):
440
437
if self ['Signature' ]:
441
438
return [self ['Signature' ].replace ('*' , r'\*' )] + ['' ]
442
- else :
443
- return ['' ]
439
+ return ['' ]
444
440
445
441
def _str_summary (self ):
446
442
if self ['Summary' ]:
447
443
return self ['Summary' ] + ['' ]
448
- else :
449
- return []
444
+ return []
450
445
451
446
def _str_extended_summary (self ):
452
447
if self ['Extended Summary' ]:
453
448
return self ['Extended Summary' ] + ['' ]
454
- else :
455
- return []
449
+ return []
456
450
457
451
def _str_param_list (self , name ):
458
452
out = []
@@ -525,8 +519,7 @@ def _str_index(self):
525
519
out += [' :%s: %s' % (section , ', ' .join (references ))]
526
520
if output_index :
527
521
return out
528
- else :
529
- return ''
522
+ return ''
530
523
531
524
def __str__ (self , func_role = '' ):
532
525
out = []
@@ -546,23 +539,11 @@ def __str__(self, func_role=''):
546
539
return '\n ' .join (out )
547
540
548
541
549
- def indent (str , indent = 4 ):
550
- indent_str = ' ' * indent
551
- if str is None :
552
- return indent_str
553
- lines = str .split ('\n ' )
554
- return '\n ' .join (indent_str + l for l in lines )
555
-
556
-
557
542
def dedent_lines (lines ):
558
543
"""Deindent a list of lines maximally"""
559
544
return textwrap .dedent ("\n " .join (lines )).split ("\n " )
560
545
561
546
562
- def header (text , style = '-' ):
563
- return text + '\n ' + style * len (text ) + '\n '
564
-
565
-
566
547
class FunctionDoc (NumpyDocString ):
567
548
def __init__ (self , func , role = 'func' , doc = None , config = {}):
568
549
self ._f = func
0 commit comments