Added create_metadata endpoint #460

Merged
jmdaweb merged 3 commits from master into master 2017-10-09 13:26:01 -07:00
Showing only changes of commit 2cb2ed4a31 - Show all commits

View file

@ -140,7 +140,7 @@ class Twython(EndpointsMixin, object):
params = params or {}
michaelhelmick commented 2017-10-09 08:56:10 -07:00 (Migrated from github.com)

Can you make this if isinstance(params, dict)

Can you make this `if isinstance(params, dict)`
func = getattr(self.client, method)
if type(params) is dict:
if isinstance(params, dict):
params, files = _transparent_params(params)
else:
params = params
@ -196,14 +196,14 @@ class Twython(EndpointsMixin, object):
error_message,
michaelhelmick commented 2017-10-09 08:55:33 -07:00 (Migrated from github.com)

Can you make this line:

if response.content != '' (spaces around operator and single quotes

Can you make this line: `if response.content != ''` (spaces around operator and single quotes
michaelhelmick commented 2017-10-09 08:55:55 -07:00 (Migrated from github.com)

content = '' Space around operators and single quotes

`content = ''` Space around operators and single quotes
error_code=response.status_code,
retry_after=response.headers.get('X-Rate-Limit-Reset'))
content=""
content = ''
try:
if response.status_code == 204:
content = response.content
else:
content = response.json()
except ValueError:
if response.content!="":
if response.content != '':
raise TwythonError('Response was not valid JSON. \
Unable to decode.')