From 422e8b7bac602d8528c38b3075f7e08e8a2d6a55 Mon Sep 17 00:00:00 2001 From: Ted Ross Date: Wed, 2 Feb 2011 18:18:46 +0000 Subject: 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 --- tools/src/py/qmf-tool | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') 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) -- cgit v1.2.1