Message193112
paul j3, thanks for reviewing my patch and giving me credit in your patch for another ticket.
Yeah, as you could see, the reason I return arg_parts and text is because the text still needs to undergo the cleanup process. You solved it by putting cleaning up in inner function.
I am thinking whether it is best to do "assert ' '.join(opt_parts) == opt_usage" inside _format_actions_usage helper function.
In that way, we can avoid returning the text. We can return only the arg_parts.
Anyway, my patch still got some unused variables, notably part_regexp and inner. My bad.
Let me check the code more deeply. See whether I can architect my patch in a better way. Maybe we can avoid building separate list inside _format_actions_usage.
Beside of that, this bug is not introduced solely by bracket character. It needs another non-space character on the right side of it.
This line is fine:
parser.add_argument ('--b', metavar="[innerpart] outerpart")
This line will fail the assertion:
parser.add_argument ('--b', metavar="[innerpart]outerpart") |
|
Date |
User |
Action |
Args |
2013-07-15 15:45:27 | vajrasky | set | recipients:
+ vajrasky, bethard, eric.araujo, ysj.ray, xuanji, tshepang, htnieman, manveru, paul.j3 |
2013-07-15 15:45:27 | vajrasky | set | messageid: <1373903127.08.0.863390237164.issue11874@psf.upfronthosting.co.za> |
2013-07-15 15:45:27 | vajrasky | link | issue11874 messages |
2013-07-15 15:45:26 | vajrasky | create | |
|