|
@@ -2,6 +2,9 @@ import sys
|
|
|
import json
|
|
|
import xlrd3 as xlrd
|
|
|
from openpyxl import load_workbook
|
|
|
+from logging import getLogger
|
|
|
+
|
|
|
+logger = getLogger("pyC")
|
|
|
|
|
|
|
|
|
class Writer:
|
|
@@ -56,8 +59,12 @@ class Mover:
|
|
|
not in destination file.
|
|
|
:return:
|
|
|
"""
|
|
|
- source = self.read_xlsx(self.source_file_path, self.source_sheet)
|
|
|
- destination = self.read_xlsx(self.destination_file_path, self.destination_sheet)
|
|
|
+ try:
|
|
|
+ source = self.read_xlsx(self.source_file_path, self.source_sheet)
|
|
|
+ destination = self.read_xlsx(self.destination_file_path, self.destination_sheet)
|
|
|
+ except FileNotFoundError as e:
|
|
|
+ logger.critical(f"File not found: {e}")
|
|
|
+ return
|
|
|
destination_wb = Writer(self.destination_file_path, self.destination_sheet) # Writer class object used to update existing file
|
|
|
if add_missing_columns:
|
|
|
self.add_missing_columns(source, destination, destination_wb)
|