From 53d1b4a6f48a53c4c4ec4ac7031362b691c0366d Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Thu, 31 Oct 2019 21:10:28 -0700 Subject: Blacken the project (#141) --- examples/searchParserAppDemo.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'examples/searchParserAppDemo.py') diff --git a/examples/searchParserAppDemo.py b/examples/searchParserAppDemo.py index d1bf8ba..c608132 100644 --- a/examples/searchParserAppDemo.py +++ b/examples/searchParserAppDemo.py @@ -1,15 +1,24 @@ from searchparser import SearchQueryParser -products = [ "grape juice", "grape jelly", "orange juice", "orange jujubees", - "strawberry jam", "prune juice", "prune butter", "orange marmalade", - "grapefruit juice" ] +products = [ + "grape juice", + "grape jelly", + "orange juice", + "orange jujubees", + "strawberry jam", + "prune juice", + "prune butter", + "orange marmalade", + "grapefruit juice", +] + class FruitSearchParser(SearchQueryParser): def GetWord(self, word): - return { p for p in products if p.startswith(word + " ") } + return {p for p in products if p.startswith(word + " ")} def GetWordWildcard(self, word): - return { p for p in products if p.startswith(word[:-1]) } + return {p for p in products if p.startswith(word[:-1])} def GetQuotes(self, search_string, tmp_result): result = set() @@ -17,7 +26,7 @@ class FruitSearchParser(SearchQueryParser): return result def GetNot(self, not_set): - return set( products ) - not_set + return set(products) - not_set parser = FruitSearchParser() @@ -31,4 +40,4 @@ tests = """\ for t in tests: print(t.strip()) print(parser.Parse(t)) - print('') + print("") -- cgit v1.2.1