Batch support bug fixes

This commit is contained in:
Madison May
2014-12-18 15:38:08 -05:00
parent ed22d53895
commit 916a82b227
6 changed files with 14 additions and 28 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ import indicoio.config as config
JSON_HEADERS = {'Content-type': 'application/json', 'Accept': 'text/plain'}
Version, version, __version__, VERSION = ('0.4.11',) * 4
Version, version, __version__, VERSION = ('0.4.12',) * 4
from indicoio.text.sentiment import political, posneg
from indicoio.text.sentiment import posneg as sentiment
+2 -1
View File
@@ -24,7 +24,8 @@ def api_handler(arg, url, batch=False, auth=None):
data_dict = json.dumps({'data': arg})
if batch:
url += "/batch"
auth = auth_query()
if not auth:
auth = auth_query()
response = requests.post(url, data=data_dict, headers=JSON_HEADERS, auth=auth).json()
results = response.get('results', False)
if not results: