This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients bethard, d0n, paul.j3, r.david.murray
Date 2014-06-20.16:59:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1403283567.91.0.970332230534.issue21805@psf.upfronthosting.co.za>
In-reply-to
Content
Another approach would be make the 'argparse' argument a 'switch' command, and act on it after parsing.  Roughly what I have in mind is:

    parser.add_argument('--verbosity', dest='switch_verbosity, action='store_true', help='....'%config_defaults['verbose'])
    ....
    args = parser.parse_args()

    verbosity = config_defaults['verbose']
    if args.switch_verbosity:
       verbosity = not verbosity

In other words, you don't need to do all of the manipulation of values in 'argparse' itself.  Its primary purpose is to decipher what the user wants, and secondarily to guide him (with help, error messages, etc).
History
Date User Action Args
2014-06-20 16:59:27paul.j3setrecipients: + paul.j3, bethard, r.david.murray, d0n
2014-06-20 16:59:27paul.j3setmessageid: <1403283567.91.0.970332230534.issue21805@psf.upfronthosting.co.za>
2014-06-20 16:59:27paul.j3linkissue21805 messages
2014-06-20 16:59:27paul.j3create