diff --git a/src/button_controler.py b/src/button_controler.py index 847725a..c90a718 100644 --- a/src/button_controler.py +++ b/src/button_controler.py @@ -16,7 +16,7 @@ def __init__(self, database_controler, ui_element): self.config_handler = ConfigHandler() self.data_exporter = DataExporter() self.updater = Updater() - self.report_df = [] + self.report_df = pd.DataFrame([]) self.daily_data = [] self.no_data = True self.past_time = False @@ -79,7 +79,7 @@ def on_date_change(self): if not work_data: self.no_data = True # self.ui_controler.show_message("No data here, nothing to do here ...") - self.report_df = [] + self.report_df = pd.DataFrame([]) return self.no_data = False work_df = self.create_work_df(work_data) @@ -168,7 +168,7 @@ def export_data(self): return succesful, message = self.data_exporter.export_data(self.report_df, report_date, overtime_report) if succesful: - self.ui_controler.show_message(f"File saved under: {file_path}") + self.ui_controler.show_message(f"File saved under: {message}") else: self.ui_controler.show_message(message) diff --git a/src/data_exporter.py b/src/data_exporter.py index 221f6da..de45afa 100644 --- a/src/data_exporter.py +++ b/src/data_exporter.py @@ -14,7 +14,7 @@ def __init__(self): self.worktime = 8 def export_data(self, df, report_date, overtime_report=True): - if not df: + if df.empty: message = f"No data to export, will no generate file..." print(message) return False, message