Beispiel #1
0
    def __mark_link(self, link_id, status):
        """ Method for updating link status """

        self.manager.update(
            {'status': status},
            Condition('id', link_id)
        )
Beispiel #2
0
 def finish(self):
     self.manager.update(
         {'status': Link.Status.DONE},
         Condition('type', Link.Type.SEARCH)
     )
Beispiel #3
0
 def get_current_state(self):
     return self.select(columns=('state', ),
                        condition=Condition('id', 1)).fetchone()[0]
Beispiel #4
0
 def set_current_state(self, state):
     self.update({'id': 1, 'state': state}, Condition('id', 1))
Beispiel #5
0
 def get_waiting_links(self):
     return self.select(
         condition=Condition('status', Link.Status.WAITING)).fetchall()
Beispiel #6
0
 def get_finished_links(self):
     return self.select(
         condition=Condition('status', Link.Status.DONE)).fetchall()
Beispiel #7
0
 def get_search_link_id(self):
     return self.select(('id', ),
                        condition=Condition('type',
                                            Link.Type.SEARCH)).fetchone()[0]