[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.11 v2 1/5] qmp-shell: Use optparse module
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH for-2.11 v2 1/5] qmp-shell: Use optparse module |
Date: |
Tue, 15 Aug 2017 10:59:44 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Tue, Aug 08, 2017 at 05:39:31PM -0300, Eduardo Habkost wrote:
> It makes command-line parsing and generation of help text much
> simpler.
>
> The optparse module is deprecated since Python 2.7, but argparse
> is not available in Python 2.6 (the minimum Python version
> required for building QEMU).
>
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> Changes v1 -> v2:
> * Use optparse module, as the minimum Python version for building
> QEMU is 2.6
> * Reported-by: Stefan Hajnoczi <address@hidden>
> * Suggested-by: "Daniel P. Berrange" <address@hidden>
I no longer suggest this approach :-)
I'd prefer if we just bundled a copy of 'argparse.py' in the
local scripts/thirdparty directory, and add that to the
python import path, if the system python lacks argparse.
eg if we had $QEMU-GIT/scripts/thirdparty/argparse.py you can
use:
try:
import argparse
except:
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../thirdparty"))
import argparse
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
[Qemu-devel] [PATCH for-2.11 v2 2/5] qmp-shell: Pass split cmdargs to __build_cmd(), Eduardo Habkost, 2017/08/08
[Qemu-devel] [PATCH for-2.11 v2 3/5] qmp-shell: execute_cmdargs() method, Eduardo Habkost, 2017/08/08
[Qemu-devel] [PATCH for-2.11 v2 4/5] qmp-shell: Accept QMP command as argument, Eduardo Habkost, 2017/08/08
[Qemu-devel] [PATCH for-2.11 v2 5/5] Remove scripts/qmp/qmp, Eduardo Habkost, 2017/08/08