Message223483
As Steven notes, the patch lacks tests. It also lacks documentation.
The 2 things that this class does different from 'version' are
- write without passing the text through 'textwrap'
- write to a user defined file
There is a difference in opinion between Éric and Steven as to whether the class should use write directly or use the HelpFormatter.
I don't think it needs further action at this time. There doesn't seem to be a lot of interest in it. Also there are a number of ways of accomplishing the task without adding an Action class.
- the class is a simple adaptation of the 'version' class
- a user defined class works just as well
- 'version' with Raw formatter, and shell redirection also works
- it is also easy to write the text to a file after parse_args.
I've attached a file that illustrates a number of these alternatives. It includes a 'callable' class.
-----------------
The discussion got me thinking about a selective version of the RAW formatting, analogous to the HTML <pre> tag. With this the user could mark a given text (description, epilog, help, version etc) as pre-formatted, without having to change the formatter_class.
parser.add_argument('--license', action='version',
version=Pre(formatted_text))
I probably should submit that in a new issue. |
|
Date |
User |
Action |
Args |
2014-07-19 22:17:11 | paul.j3 | set | recipients:
+ paul.j3, georg.brandl, bethard, eric.araujo, denilsonsa, BreamoreBoy, travistouchdown, berker.peksag |
2014-07-19 22:17:11 | paul.j3 | set | messageid: <1405808231.2.0.00448448903294.issue9399@psf.upfronthosting.co.za> |
2014-07-19 22:17:11 | paul.j3 | link | issue9399 messages |
2014-07-19 22:17:10 | paul.j3 | create | |
|