using Query class for parsing of search query

This commit is contained in:
Thomas Pointhuber 2014-10-01 17:57:53 +02:00
parent 510aba5e66
commit 62d1a70c84
2 changed files with 13 additions and 56 deletions

View file

@ -39,6 +39,7 @@ class Query(object):
self.engines = []
self.languages = []
# parse query, if tags are set, which change the serch engine or search-language
def parse_query(self):
self.query_parts = []
@ -55,7 +56,8 @@ class Query(object):
parse_next = False
# part does only contain spaces, skip
if query_part.isspace():
if query_part.isspace()\
or query_part == '':
parse_next = True
self.query_parts.append(query_part)
continue