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