216 def _autocomplete(self, first_char, value):
217 if not value:
218
219 for suggestion in ['images', 'wikipedia', 'osm']:
220 if suggestion not in self.raw_text_query.disabled_engines or suggestion in categories:
221 self._add_autocomplete(first_char + suggestion)
222 return
223
224
225 for category in categories:
226 if category.startswith(value):
227 self._add_autocomplete(first_char + category.replace(' ', '_'))
228
229
230 for engine in engines:
231 if engine.startswith(value):
232 self._add_autocomplete(first_char + engine.replace(' ', '_'))
233
234
235 for engine_shortcut in engine_shortcuts:
236 if engine_shortcut.startswith(value):
237 self._add_autocomplete(first_char + engine_shortcut)
238
239