Skip to content

Commit

Permalink
add convert all
Browse files Browse the repository at this point in the history
  • Loading branch information
Dozer committed Dec 14, 2015
1 parent dcd642c commit cb42303
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions unified_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ def convert(self, query):
result = []
result += self.autocomplete(query)
result += self.convert_by_type(query)
# result += self.convert_all(query)
result += self.convert_all(query)

# sort
self.add_to_wf(result)
self.wf.send_feedback()

def convert_all(self, query):
return
result = []

if not query:
return result

for m in self.models:
result += m.convert(query)

return result

def convert_by_type(self, query):
query = str(query).strip()
Expand All @@ -46,8 +54,6 @@ def autocomplete(self, query):
if query.find(' ') >= 0:
return result

result = []

# 不是空的话有数量限制
for m in self.models:
result += m.autocomplete(query)
Expand Down

0 comments on commit cb42303

Please sign in to comment.