Message223483
| Author |
paul.j3 |
| Recipients |
BreamoreBoy, berker.peksag, bethard, denilsonsa, eric.araujo, georg.brandl, paul.j3, travistouchdown |
| Date |
2014年07月19日.22:17:09 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1405808231.2.0.00448448903294.issue9399@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|