Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Clean up a bit of code and add in string coercion to the '_get_querys…

…tring' method since it would be natural to send ints as values for some of the arguments.
  • Loading branch information...
commit 348a24d91f7664bfec1cdf5ca4b401456a1345ba 1 parent 0abc7e7
@mattdeboard authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 python_usdol.py
View
9 python_usdol.py
@@ -88,13 +88,12 @@ def _get_querystring(self, **kwargs):
"""
qs = []
- for arg in kwargs:
- if kwargs[arg]:
+ for key, value in kwargs.items():
+ if value:
# `filter` is a keyword in Python, so I avoid using it by
# adding a _ to the end, then removing it here.
- key = arg.replace('_', '')
- val = kwargs[arg].replace(' ', '+')
- qs.append("$%s=%s" % (key, val))
+ qs.append("$%s=%s" %
+ (key.replace('_', ''), str(value).replace(' ', '+')))
return '?' + string.join(qs, '&')
def _get_request(self, qs='', fmt='json'):
Please sign in to comment.
Something went wrong with that request. Please try again.