Re: argparse action on default values

2014-01-09 Thread Chris Angelico
On Thu, Jan 9, 2014 at 5:20 AM, Florian Lindner wrote: > def norm_path(*parts): > """ Returns the normalized, absolute, expanded and joined path, assembled > of all parts. """ > parts = [ str(p) for p in parts ] > return os.path.abspath(os.path.expanduser(os.path.join(*parts))) Apolo

Re: argparse action on default values

2014-01-08 Thread Terry Reedy
On 1/8/2014 1:20 PM, Florian Lindner wrote: I use argparse from Python 3.3.3 with a custom action that normalizes path arguments: This works fine when there is actually a --config=path supplied. But it's not being applied on default arguments. This behavior is how I interpret the doc. http:

Re: argparse action on default values

2014-01-08 Thread Peter Otten
Florian Lindner wrote: > I use argparse from Python 3.3.3 with a custom action that normalizes path arguments: > > http://docs.python.org/3/library/argparse.html#action > > def norm_path(*parts): > """ Returns the normalized, absolute, expanded and joined path, assembled of all parts. """

argparse action on default values

2014-01-08 Thread Florian Lindner
Hello, I use argparse from Python 3.3.3 with a custom action that normalizes path arguments: http://docs.python.org/3/library/argparse.html#action def norm_path(*parts): """ Returns the normalized, absolute, expanded and joined path, assembled of all parts. """ parts = [ str(p) for p i