Merge pull request #1078 from kvch/result-engines-set

results: make engines of results set
This commit is contained in:
Adam Tauber 2017-11-03 20:18:51 +01:00 committed by GitHub
commit dd900b25a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ class ResultContainer(object):
result['parsed_url'] = result['parsed_url']._replace(scheme="http") result['parsed_url'] = result['parsed_url']._replace(scheme="http")
result['url'] = result['parsed_url'].geturl() result['url'] = result['parsed_url'].geturl()
result['engines'] = [result['engine']] result['engines'] = set([result['engine']])
# strip multiple spaces and cariage returns from content # strip multiple spaces and cariage returns from content
if result.get('content'): if result.get('content'):
@ -227,7 +227,7 @@ class ResultContainer(object):
duplicated['positions'].append(position) duplicated['positions'].append(position)
# add engine to list of result-engines # add engine to list of result-engines
duplicated['engines'].append(result['engine']) duplicated['engines'].add(result['engine'])
# using https if possible # using https if possible
if duplicated['parsed_url'].scheme != 'https' and result['parsed_url'].scheme == 'https': if duplicated['parsed_url'].scheme != 'https' and result['parsed_url'].scheme == 'https':