Browse Source

Started on clean method

Must be tested
master
Raphael Roberts 7 years ago
parent
commit
a50922e966
  1. 6
      ext_open/searcher.py

6
ext_open/searcher.py

@ -53,8 +53,10 @@ class Searcher:
self.cur.execute('SELECT * FROM ? WHERE name LIKE ?;',[self.ext,query])
return self.cur.fetchall()
def clean(self,backhistory):
pass
# TODO
self.cur.execute('SELECT update_time FROM updates WHERE ext=? ORDER BY update_time DESC LIMIT ?;',[backhistory+1])
res = self.cur.fetchall()
threshold = res[-1][0]
cur.execute('DELETE FROM {} WHERE update_time < ?;'.format(self.ext),[threshold])
if __name__ == "__main__":
init_db()
s = Searcher('py')
Loading…
Cancel
Save