Skip to content

Commit

Permalink
Support whitespace characters in query
Browse files Browse the repository at this point in the history
  • Loading branch information
emi80 committed Nov 17, 2014
1 parent 0c8184d commit fcc213b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions indexfile/cli/indexfile_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ def run(index):
indices = []
query = args.get('<query>')
if query:
list_sep = ':'
list_sep = r'[:\s]'
kwargs = {}
for qry in query:
match = re.match("(?P<key>[^=<>!]*)=(?P<value>.*)", qry)
kwargs[match.group('key')] = match.group('value')
if list_sep in kwargs[match.group('key')]:
kwargs[match.group('key')] = match.group(
'value').split(list_sep)
match = re.match(r'(?P<key>[^=<>!]*)=(?P<value>.*)', qry, re.DOTALL)
kwargs[match.group('key')] = match.group('value')
if re.search(list_sep, kwargs[match.group('key')], re.MULTILINE):
kwargs[match.group('key')] = re.split(list_sep, match.group(
'value'))
indices.append(index.lookup(exact=exact, **kwargs))
else:
indices.append(index)
Expand Down

0 comments on commit fcc213b

Please sign in to comment.