25 Feb
2015
25 Feb
'15
9:41 a.m.
On 02/25/2015 08:32 AM, Dan Smith wrote:
+class VersionAction(argparse.Action):
- def __call__(self, parser, namespace, value, option_string=None):
args = (CHIRP_VERSION,
platform.get_platform().os_version_string(),
sys.version.split()[0])
print "CHIRP %s on %s (Python %s)" % args
sys.exit(1)
It's not okay, IMHO, to exit() from a library call.
It's no different than argparse.parse_args exiting when using the --help option.
Overall, I don't think it's worth having a separate module for just this little thing. I'd just put it in __init__.py, or in chirp_common.
chirp_common is already pretty busy. __init__.py gets made static my setup.py (right?). I do not see anything wrong with having a small module like this, since it's shared between chirpc and chirpw.
Maybe merge it with logger.py (as it's shared too)? I just realized that we _really_ want to record this information in our log files.
--
Zach Welch
Mandolin Creek Farm
www.mandolincreekfarm.com
farm: 541-453-4131
cell: 541-740-3410