Skip to content
Snippets Groups Projects
Commit fc351d59 authored by morkolai's avatar morkolai
Browse files

#52 Laget funskjon som oppdaterer db basert på tid

parent 21e442a1
No related branches found
No related tags found
1 merge request!27#52 Automatisk oppdatering av kodebok basert på tid
Pipeline #73885 failed
......@@ -224,6 +224,20 @@ class Database:
).total_seconds()
return seconds_to_update
def update_codebook_auto(self):
"""
Updates Codebook if it is less than 10 til next update.
Returns
-------
sec_to_next_update : float
Seconds to next update
"""
sec_to_next_update = self.seconds_to_next_update()
if sec_to_next_update < 10:
self.update_codebook()
return sec_to_next_update
def add_code_to(self, word, mode="ascii"):
"""
Generate and insert a code for the new word in DB-table CodeBook.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment