Message218395
An alternative to passing a Formatter instance to the parser is to use a wrapper function. `HelpFormatter.__init__` takes several keyword args. '_get_formatter' does not use those. However we could define:
def format_wrapper(**kwargs):
# class 'factory' used to give extra parameters
def fnc(prog):
cls = argparse.HelpFormatter
return cls(prog, **kwargs)
return fnc
and use that to set the 'width' of the formatter object.
parser = argparse.ArgumentParser( formatter_class = format_wrapper(width=40)) |
|
Date |
User |
Action |
Args |
2014-05-13 01:38:47 | paul.j3 | set | recipients:
+ paul.j3, bethard, eric.araujo, zbysz, denilsonsa, rurpy2, GraylinKim |
2014-05-13 01:38:47 | paul.j3 | set | messageid: <1399945127.13.0.661388279597.issue12806@psf.upfronthosting.co.za> |
2014-05-13 01:38:47 | paul.j3 | link | issue12806 messages |
2014-05-13 01:38:46 | paul.j3 | create | |
|