Fixed a minor search bug.

master
Sean B. Palmer 2008-11-20 10:25:03 +00:00
parent 1856781604
commit 4eb5bb8942
1 changed files with 3 additions and 1 deletions

View File

@ -37,7 +37,9 @@ def result(query):
def count(query): def count(query):
results = search(query) results = search(query)
if not results['responseData'] or not results['responseData']['cursor']: if not results.has_key('responseData'): return '0'
if not results['responseData'].has_key('cursor'): return '0'
if not results['responseData']['cursor'].has_key('estimatedResultCount'):
return '0' return '0'
return results['responseData']['cursor']['estimatedResultCount'] return results['responseData']['cursor']['estimatedResultCount']