From e19b3ea42c08d85e1ce3e090e67e99a2496329b1 Mon Sep 17 00:00:00 2001 From: samerbam Date: Tue, 22 Aug 2023 22:37:32 -0400 Subject: [PATCH] fix quotes error --- application/database.py | 2 +- application/thermal_print.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/database.py b/application/database.py index 817420a..d83a653 100644 --- a/application/database.py +++ b/application/database.py @@ -52,7 +52,7 @@ class TodoDatabase: def get_random_quote(self): # print(time.time()) - if time.time()-self.database["quotes_last_updated"] > 86400: + if ("quotes_last_updated" in self.database) and (time.time()-self.database["quotes_last_updated"] > 86400): self._update_quotes() quote = random.choice(self.database["quotes"]) diff --git a/application/thermal_print.py b/application/thermal_print.py index e7b60e8..eac39b5 100644 --- a/application/thermal_print.py +++ b/application/thermal_print.py @@ -36,9 +36,9 @@ import wonderwords from datetime import datetime -# from .sudoku_generator import * -# from .wordsearch_generator import WordSearch -from database import TodoDatabase +from .sudoku_generator import * +from .wordsearch_generator import WordSearch +from .database import TodoDatabase