[issue23298] Add ArgumentParser.add_mutually_dependence_group

2015-01-21 Thread dongwm

New submission from dongwm:

Sometimes I need to use argparse like this:


 parser = argparse.ArgumentParser(prog='PROG')
 group = parser.add_mutually_dependence_group()
 group.add_argument('--foo')
 group.add_argument('--bar')
 parser.parse_args(['--foo', 'f', '--bar', 'b'])
Namespace(bar='b', foo='f')
 parser.parse_args(['--foo', 'f'])
PROG: error: --foo dependence on --bar
 parser.parse_args(['--bar', 'b'])
PROG: error: --bar dependence on --foo

I have some optional argument. but if any argument in a group was present on 
the command line. i need the others must also was present on. so i think 
``add_mutually_dependence_group`` does make sense.

--
components: Library (Lib)
files: argparse_lib.patch
keywords: patch
messages: 234475
nosy: bethard, dongwm
priority: normal
severity: normal
status: open
title: Add ArgumentParser.add_mutually_dependence_group
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file37814/argparse_lib.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23298
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23298] Add ArgumentParser.add_mutually_dependence_group

2015-01-21 Thread dongwm

Changes by dongwm ciici...@gmail.com:


Added file: http://bugs.python.org/file37816/argparse_test.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23298
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23298] Add ArgumentParser.add_mutually_dependence_group

2015-01-21 Thread dongwm

Changes by dongwm ciici...@gmail.com:


Added file: http://bugs.python.org/file37815/argparse_doc.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23298
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20457] Use partition and enumerate make getopt easier

2014-02-24 Thread dongwm

dongwm added the comment:

Oh, really no big improvement in function, but I have been using the 
functionality provided by python.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20457
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20457] Use partition and enumerate make getopt easier

2014-02-20 Thread dongwm

dongwm added the comment:

Yes, it has tests. I just modified do_longs and short_has_arg. In 
Lib/test/test_getopt.py, test_do_longs and test_short_has_arg can do it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20457
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com




[issue20457] Use partition and enumerate make getopt easier

2014-02-20 Thread dongwm

dongwm added the comment:

I have signed the contributor agreement form. The new version of the official 
web site seem some css style display problems.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20457
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20457] Use partition and enumerate make getopt easier

2014-01-31 Thread dongwm

Changes by dongwm ciici...@gmail.com:


--
components: Library (Lib)
files: getopt_2.7_3.X.path
nosy: dongwm
priority: normal
severity: normal
status: open
title: Use partition and enumerate make getopt easier
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file33833/getopt_2.7_3.X.path

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20457
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20457] Use partition and enumerate make getopt easier

2014-01-31 Thread dongwm

Changes by dongwm ciici...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file33834/getopt_3.3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20457
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20444] Reduce logging.config.Converting duplication of code

2014-01-31 Thread dongwm

dongwm added the comment:

yes, Your modification is better

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20444
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20444] Reduce logging.config.Converting duplication of code

2014-01-29 Thread dongwm

Changes by dongwm ciici...@gmail.com:


--
components: Library (Lib)
files: logging_config.patch
keywords: patch
nosy: dongwm
priority: normal
severity: normal
status: open
title: Reduce logging.config.Converting duplication of code
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file33808/logging_config.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20444
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com