summaryrefslogtreecommitdiff
path: root/tools/src
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
commit422e8b7bac602d8528c38b3075f7e08e8a2d6a55 (patch)
treec5b3073e6053880e5e147e8501a1e18951ac3075 /tools/src
parent9991fae5ea4415b6ef760a4430658202b90264bc (diff)
downloadqpid-python-422e8b7bac602d8528c38b3075f7e08e8a2d6a55.tar.gz
Improve the detection of data types in command-line method arguments.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1066564 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tools/src')
-rwxr-xr-xtools/src/py/qmf-tool7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/src/py/qmf-tool b/tools/src/py/qmf-tool
index f22caa90c7..c01900ac62 100755
--- a/tools/src/py/qmf-tool
+++ b/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)