summaryrefslogtreecommitdiff
path: root/qpid/tools
diff options
context:
space:
mode:
authorTed Ross <tross@apache.org>2011-02-02 18:18:46 +0000
committerTed Ross <tross@apache.org>2011-02-02 18:18:46 +0000
commitc7740b10d0b4fe5fe1b4fbabf6804ca815d1ebea (patch)
tree616fc8130eddf444441dd8f572e77819bc3cd58f /qpid/tools
parent1e77b7bcf6766afbf161137284edbf2a6a255447 (diff)
downloadqpid-python-c7740b10d0b4fe5fe1b4fbabf6804ca815d1ebea.tar.gz
Improve the detection of data types in command-line method arguments.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1066564 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/tools')
-rwxr-xr-xqpid/tools/src/py/qmf-tool7
1 files changed, 6 insertions, 1 deletions
diff --git a/qpid/tools/src/py/qmf-tool b/qpid/tools/src/py/qmf-tool
index f22caa90c7..c01900ac62 100755
--- a/qpid/tools/src/py/qmf-tool
+++ b/qpid/tools/src/py/qmf-tool
@@ -306,7 +306,12 @@ class QmfData:
methodName = tokens[1]
args = []
for arg in tokens[2:]:
- if arg[0] == '{' or arg[0] == '[' or arg.isdigit():
+ ##
+ ## If the argument is a map, list, boolean, integer, or floating (one decimal point),
+ ## run it through the Python evaluator so it is converted to the correct type.
+ ##
+ if arg[0] == '{' or arg[0] == '[' or arg == "True" or arg == "False" \
+ or (arg.count('.') < 2 and arg.replace('.','').isdigit()):
args.append(eval(arg))
else:
args.append(arg)