Esempio n. 1
0
 def doSearch(self, query):
     self.log.debug("Search query: %s" % query)
     try:
         self._syncOneChangeFromQuery(query)
     except Exception as e:
         return self.error(e.message)
     with self.db.getSession() as session:
         try:
             changes = session.getChanges(query)
         except gertty.search.SearchSyntaxError as e:
             return self.error(e.message)
         except sqlalchemy.exc.OperationalError as e:
             return self.error(e.message)
         except Exception as e:
             return self.error(str(e))
         change_key = None
         if len(changes) == 1:
             change_key = changes[0].key
     try:
         if change_key:
             view = view_change.ChangeView(self, change_key)
         else:
             view = view_change_list.ChangeListView(self, query)
         self.changeScreen(view)
     except gertty.view.DisplayError as e:
         return self.error(e.message)
Esempio n. 2
0
 def onSelect(self, button, change_key):
     try:
         view = view_change.ChangeView(self.app, change_key)
         self.app.changeScreen(view)
     except gertty.view.DisplayError as e:
         self.app.error(str(e))