[issue12806] argparse: Hybrid help text formatter

2021-01-04 Thread David Steele
David Steele added the comment: For those looking for a solution now, see https://pypi.org/project/argparse-formatter/ -- ___ Python tracker ___

[issue12806] argparse: Hybrid help text formatter

2020-09-07 Thread David Steele
David Steele added the comment: I've submitted FlexiHelpFormatter as PR22129. This adds the FlexiHelpFormatter class to argparse. It supports wrapping text, while preserving paragraphs. Bullet lists are supported. There are a number of differences, relative to the latest patch in the issue

[issue12806] argparse: Hybrid help text formatter

2020-09-07 Thread David Steele
Change by David Steele : -- keywords: +patch pull_requests: +21210 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22129 ___ Python tracker ___

[issue12806] argparse: Hybrid help text formatter

2019-10-22 Thread David Steele
David Steele added the comment: I came across this thread after making a simple argparse formatter for preserving paragraphs. The submissions here look better than that effort. Here is a quick, hacky look at the patches from one perspective. I wanted to prefer ParagraphFormatterML, but

[issue12806] argparse: Hybrid help text formatter

2018-09-25 Thread Perette Barella
Perette Barella added the comment: I would find this a useful feature. -- nosy: +perette ___ Python tracker ___ ___

[issue12806] argparse: Hybrid help text formatter

2016-07-04 Thread Jakub Wilk
Changes by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing

[issue12806] argparse: Hybrid help text formatter

2016-02-14 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue12806] argparse: Hybrid help text formatter

2016-02-13 Thread Stephan Sokolow
Stephan Sokolow added the comment: @GraylinKim: In the interest of people like myself who wander in here via Google, would you mind stating, for the record, what license argparse_formatter.py is under? -- nosy: +ssokolow ___ Python tracker

[issue12806] argparse: Hybrid help text formatter

2014-07-30 Thread paul j3
paul j3 added the comment: In http://bugs.python.org/issue22029 argparse CSS white-space: like control for individual text blocks I propose a set of `str` subclasses that can be used to define the wrapping style of individual text blocks. The idea is adapted from the HTML 'pre' tag, and the

[issue12806] argparse: Hybrid help text formatter

2014-07-16 Thread Mark Lawrence
Mark Lawrence added the comment: Apparently #13923 is related to this. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12806 ___

[issue12806] argparse: Hybrid help text formatter

2014-05-20 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: Added file: http://bugs.python.org/file35306/wrap_sample.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12806 ___

[issue12806] argparse: Hybrid help text formatter

2014-05-20 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: Removed file: http://bugs.python.org/file35236/wrap_sample.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12806 ___

[issue12806] argparse: Hybrid help text formatter

2014-05-12 Thread paul j3
paul j3 added the comment: 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

[issue12806] argparse: Hybrid help text formatter

2014-05-12 Thread paul j3
paul j3 added the comment: An alternative to adding a 'ParagraphFormatter' class to 'argparse', is to format the individual text blocks PRIOR to passing them to the 'parser', and use the 'RawTextHelpFormatter'. In the attached script I use a simple function that applies 'textwrap' to each

[issue12806] argparse: Hybrid help text formatter

2013-08-08 Thread paul j3
Changes by paul j3 ajipa...@gmail.com: -- nosy: +paul.j3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12806 ___ ___ Python-bugs-list mailing list

[issue12806] argparse: Hybrid help text formatter

2012-11-23 Thread rurpy the second
rurpy the second added the comment: I happened upon this issue while Googling for a formatter with the behavior described here. I put together a formatter derived from the code submitted by GraylinKim (2011-08-22) and offer it for consideration (though it is missing some things like

[issue12806] argparse: Hybrid help text formatter

2012-11-23 Thread rurpy the second
rurpy the second added the comment: Additional comment loosely related to the ParagraphFormatter offered in previous comment... [If this is not the right venue -- perhaps a new issue or one of the python mail lists would be better -- please tell me.] I notice that argparse.ArgumentParser

[issue12806] argparse: Hybrid help text formatter

2012-02-22 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl added the comment: I suppose here is where I should volunteer to update the patch file... @GraylinKim: do you still intend to work on this? -- ___ Python tracker rep...@bugs.python.org

[issue12806] argparse: Hybrid help text formatter

2012-02-22 Thread Graylin Kim
Graylin Kim graylin@gmail.com added the comment: I'd be willing to at some point but I cannot see myself getting around to it in the near future. If someone else wants to offer an implementation that would be great. On Wed, Feb 22, 2012 at 10:42 AM, Zbyszek Szmek

[issue12806] argparse: Hybrid help text formatter

2011-12-15 Thread Steven Bethard
Steven Bethard steven.beth...@gmail.com added the comment: As I understand it the current proposal is: * Wrap each paragraph separately * Don't wrap any lines indented by at least one additional space This sounds like a useful formatter. I would probably call it PargraphWrappingFormatter or

[issue12806] argparse: Hybrid help text formatter

2011-09-25 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl added the comment: On 09/25/2011 01:50 AM, Graylin Kim wrote: Graylin Kimgraylin@gmail.com added the comment: I fully support taking blank line based line-wrapping approach and agree with Zbyszek's suggested indentation approach as well. I am not sure

[issue12806] argparse: Hybrid help text formatter

2011-09-25 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl added the comment: [I now see that roundup ate half of my reply. I have no idea why, because the e-mail is formatted correctly. Maybe I'll have more luck this time, but since there's no preview, I must try to see.] On 09/25/2011 01:50 AM, Graylin Kim wrote:

[issue12806] argparse: Hybrid help text formatter

2011-09-24 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl added the comment: This is a great idea! I think that this formatter is much more useful than the default one. I was pretty surprised the first time I added a multi-paragraph epilog to a program and it got all jumbled into a single line. I would vote to make

[issue12806] argparse: Hybrid help text formatter

2011-09-24 Thread Graylin Kim
Graylin Kim graylin@gmail.com added the comment: I fully support taking blank line based line-wrapping approach and agree with Zbyszek's suggested indentation approach as well. I am not sure why they didn't occur to me at the time but they are certainly a more effective and widely adopted

[issue12806] argparse: Hybrid help text formatter

2011-09-24 Thread Denilson Figueiredo de Sá
Denilson Figueiredo de Sá denilso...@gmail.com added the comment: Good catch, I had intended on '-' being a valid list item character. It clearly needs to be escaped. Either escaped, or it can be the first character in the set. but I happen to like list() and dict() instead of [] and {} for

[issue12806] argparse: Hybrid help text formatter

2011-09-20 Thread Denilson Figueiredo de Sá
Denilson Figueiredo de Sá denilso...@gmail.com added the comment: I was about to suggest this feature. I had the exact same need: a formatter that preserves newlines (and maybe whitespace), but that also automatically wraps the lines. In other words, the behavior would be similar to CSS

[issue12806] argparse: Hybrid help text formatter

2011-08-26 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Steven: What do you think? GraylinKim: You can open a feature request for message preview on the metatracker (see “Report Tracker Problem” in the sidebar). -- nosy: +bethard, eric.araujo type: - feature request versions: +Python 3.3

[issue12806] argparse: Hybrid help text formatter

2011-08-21 Thread Graylin Kim
New submission from Graylin Kim graylin@gmail.com: When using argparse I frequently run into situations where my helper text is a mix of prose and bullets or options. I need the RawTextFormatter for the bullets, and I need the default formatter for the prose (so the line wraps

[issue12806] argparse: Hybrid help text formatter

2011-08-21 Thread Graylin Kim
Graylin Kim graylin@gmail.com added the comment: I just noticed that the example output above repeats with a different indent. The attached formatter isn't broken, I just messed up the editing on my post. The repeated text isn't part of the output (and shouldn't be there). While I'm