[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 didn'

[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 ___ ___ Python-bugs-lis

[issue12806] argparse: Hybrid help text formatter

2016-07-04 Thread Jakub Wilk
Changes by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org

[issue12806] argparse: Hybrid help text formatter

2016-02-14 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[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 '' tag, and the CSS w

[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 ___ ___ Python-bugs-li

[issue12806] argparse: Hybrid help text formatter

2014-05-20 Thread paul j3
Changes by paul j3 : Added file: http://bugs.python.org/file35306/wrap_sample.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue12806] argparse: Hybrid help text formatter

2014-05-20 Thread paul j3
Changes by paul j3 : Removed file: http://bugs.python.org/file35236/wrap_sample.py ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[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 'li

[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 'factory'

[issue12806] argparse: Hybrid help text formatter

2013-08-08 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/m

[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 requ

[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 docstring

[issue12806] argparse: Hybrid help text formatter

2012-02-22 Thread Graylin Kim
Graylin Kim 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 wrote: > > Zbyszek Szmek added the comment: >

[issue12806] argparse: Hybrid help text formatter

2012-02-22 Thread Zbyszek Szmek
Zbyszek Szmek 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 ___

[issue12806] argparse: Hybrid help text formatter

2011-12-15 Thread Steven Bethard
Steven Bethard 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 something like that whic

[issue12806] argparse: Hybrid help text formatter

2011-09-25 Thread Zbyszek Szmek
Zbyszek Szmek 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: >>> if(list_match):

[issue12806] argparse: Hybrid help text formatter

2011-09-25 Thread Zbyszek Szmek
Zbyszek Szmek added the comment: On 09/25/2011 01:50 AM, Graylin Kim wrote: > > Graylin Kim 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 t

[issue12806] argparse: Hybrid help text formatter

2011-09-24 Thread Denilson Figueiredo de Sá
Denilson Figueiredo de Sá 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 > empty collectio

[issue12806] argparse: Hybrid help text formatter

2011-09-24 Thread Graylin Kim
Graylin Kim 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 approaches to the str

[issue12806] argparse: Hybrid help text formatter

2011-09-24 Thread Zbyszek Szmek
Zbyszek Szmek 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 this (or a variant,

[issue12806] argparse: Hybrid help text formatter

2011-09-20 Thread Denilson Figueiredo de Sá
Denilson Figueiredo de Sá 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 property white-space: pre

[issue12806] argparse: Hybrid help text formatter

2011-08-26 Thread Éric Araujo
Éric Araujo 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 -Python 2.7 __

[issue12806] argparse: Hybrid help text formatter

2011-08-21 Thread Graylin Kim
Graylin Kim 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 certainly at fault here, a

[issue12806] argparse: Hybrid help text formatter

2011-08-21 Thread Graylin Kim
New submission from Graylin Kim : 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 intelligently). The current Help