Author: tross
Date: Wed Feb  2 18:18:46 2011
New Revision: 1066564

URL: http://svn.apache.org/viewvc?rev=1066564&view=rev
Log:
Improve the detection of data types in command-line method arguments.

Modified:
    qpid/trunk/qpid/tools/src/py/qmf-tool

Modified: qpid/trunk/qpid/tools/src/py/qmf-tool
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/tools/src/py/qmf-tool?rev=1066564&r1=1066563&r2=1066564&view=diff
==============================================================================
--- qpid/trunk/qpid/tools/src/py/qmf-tool (original)
+++ qpid/trunk/qpid/tools/src/py/qmf-tool Wed Feb  2 18:18:46 2011
@@ -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)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to