Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Made digits an integer in json data passed in PUT/POST/PATCH params
Browse files Browse the repository at this point in the history
  • Loading branch information
mahtin committed May 4, 2016
1 parent 297ade8 commit e222ad7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cli4/cli4.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ def cli4(args):
elif opt in ('-D', '--delete'):
method = 'DELETE'

digits_only = re.compile('^[0-9]+$')

# next grab the params. These are in the form of tag=value
params = {}
while len(args) > 0 and '=' in args[0]:
Expand All @@ -127,8 +129,8 @@ def cli4(args):
value = True
elif value == 'false':
value = False
# elif value.isdigit():
# value = int(value)
elif digits_only.match(value):
value = int(value)
elif value[0] is '[' and value[-1] is ']':
value = value[1:-1].split(',')
params[tag] = value
Expand Down

0 comments on commit e222ad7

Please sign in to comment.