MCPcopy Index your code
hub / github.com/ryanmcgrath/twython / _transparent_params

Function _transparent_params

twython/helpers.py:14–34  ·  view source on GitHub ↗
(_params)

Source from the content-addressed store, hash-verified

12
13
14def _transparent_params(_params):
15 params = {}
16 files = {}
17 for k, v in _params.items():
18 if hasattr(v, 'read') and callable(v.read):
19 files[k] = v # pragma: no cover
20 elif isinstance(v, bool):
21 if v:
22 params[k] = 'true'
23 else:
24 params[k] = 'false'
25 elif isinstance(v, basestring) or isinstance(v, numeric_types):
26 params[k] = v
27 elif isinstance(v, list):
28 try:
29 params[k] = ','.join(v)
30 except TypeError:
31 params[k] = ','.join(map(str, v))
32 else:
33 continue # pragma: no cover
34 return params, files

Callers 3

_requestMethod · 0.85
construct_api_urlMethod · 0.85
_requestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected