From: Leandro Lucarella Date: Sun, 6 Mar 2005 22:17:33 +0000 (+0000) Subject: Bugfix para que convierta enteros y floats. X-Git-Tag: svn_import~62 X-Git-Url: https://git.llucax.com/software/sercom-old.git/commitdiff_plain/7fe408796a1240cc4d740307778515ecd0637e55?ds=sidebyside;hp=8c3359a287dd86c03b874aef2bbfcf2e95c4ad4b Bugfix para que convierta enteros y floats. --- diff --git a/src/sc_dbq b/src/sc_dbq index 1c90a3f..2b06334 100755 --- a/src/sc_dbq +++ b/src/sc_dbq @@ -20,8 +20,14 @@ def args2dict(l, conn): for arg in l: key, val = arg.split('=') if val == 'None': val = None - if val == 'True': val = True - if val == 'False': val = False + elif val == 'True': val = True + elif val == 'False': val = False + elif val.isdigit(): + val = int(val) + else: + try: + val = float(val) + except ValueError: pass d[key] = val return d