use total_seconds() when calculating search change diff
as tested like: $ python -c "from datetime import datetime; import time; a = datetime.now(); time.sleep(0.5); b = datetime.now(); print((b-a).seconds)" 0 $ python -c "from datetime import datetime; import time; a = datetime.now(); time.sleep(0.5); b = datetime.now(); print((b-a).total_seconds())" 0.50064
This commit is contained in:
@@ -283,7 +283,7 @@ class MainWindow(Gtk.ApplicationWindow):
|
||||
|
||||
def _on_search_entry_changed(self, entry: Gtk.Entry):
|
||||
now = datetime.now()
|
||||
if (now - self.last_search_change_time).seconds < 0.5:
|
||||
if (now - self.last_search_change_time).total_seconds() < 0.5:
|
||||
while len(self.searches) > 0:
|
||||
search = self.searches.pop()
|
||||
if search:
|
||||
|
Reference in New Issue
Block a user