diff --git a/.gitignore b/.gitignore index e8ffc6b..5f06bb7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ dist/ InputFiles/ __pycache__/ 2023/ +ilr_test/ *.lnk *.spec diff --git a/report_config_termplate.toml b/report_config_termplate.toml deleted file mode 100644 index 8995213..0000000 --- a/report_config_termplate.toml +++ /dev/null @@ -1 +0,0 @@ -name = "Test Name" diff --git a/settings.toml b/settings.toml index cdad9e2..8d429a7 100644 --- a/settings.toml +++ b/settings.toml @@ -1,11 +1,11 @@ debug = true -consolidatedBasePath = '' +consolidatedBasePath = "" [defaultLocations] -ach = '' +ach = "//leafnow.com/shared/Business Solutions/Griff/Code/InfoLeaseExtract/2023/2023.03/2023.03.01/ACH" disp = "" gl = "" -lb = '' +lb = "//leafnow.com/shared/Business Solutions/Griff/Code/InfoLeaseExtract/2023/2023.03/2023.03.01/LOCKBOX" minv = "" niv = "" ren = "" diff --git a/src/il_extract.py b/src/il_extract.py index d3b1198..f0733b4 100644 --- a/src/il_extract.py +++ b/src/il_extract.py @@ -2,20 +2,25 @@ from ui_ile_main_window import Ui_MainWindow import sys import os import pandas as pd -import json from PyQt5 import QtWidgets from datetime import datetime as dt import il_reports as ilx #TODO redo aliasing -from logging import debug, DEBUG, basicConfig, exception +from logging import debug, DEBUG, basicConfig, exception, warn from tomllib import load from tomli_w import dump +from shutil import copyfile +from pathlib import Path +from getpass import getuser with open("settings.toml", mode='rb') as s: settings = load(s) #if settings["debug"]: - basicConfig(filename='debug.log', mode='w', encoding='utf-8', level=DEBUG) + basicConfig(filename='debug.log', mode='w', encoding='utf-8', + level=DEBUG, + format="%(asctime)s %(message)s", + ) -debug("\n\n\n########################### VERSION = 3.3 ###########################\n\n\n") +debug("\n\n\n########################### VERSION = 3.4 ###########################\n\n\n") debug("Running main.py...") class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): """ @@ -307,3 +312,21 @@ if __name__ == "__main__": app.exec() except Exception as e: exception(f"HIGH LEVEL EXECPTION: {e}") + finally: + log_path = Path(os.curdir,'debug.log') + + remote_log_folder = Path( + r"\\leafnow.com\public\Business Solutions\Apps\AppSources\Logging\ILE", + ) + if not remote_log_folder.exists: + os.mkdir(remote_log_folder) + + rlog_file = f"{getuser()}_ile.log" + + try: + copyfile( + log_path, + Path(remote_log_folder, rlog_file) + ) + except Exception as e: + warn(f"Failed to save remote log: {remote_log_folder}/{rlog_file}!") diff --git a/src/il_reports.py b/src/il_reports.py index 9ce33d7..a76166e 100644 --- a/src/il_reports.py +++ b/src/il_reports.py @@ -11,7 +11,7 @@ from hashlib import md5 import openpyxl as pxl from tomllib import load -# V3.3.3 | 06/15/23 +# V3.4 | 06/15/23 with open("settings.toml", mode='rb') as s: settings = load(s) diff --git a/todo.md b/todo.md index 6ba7a89..61db168 100644 --- a/todo.md +++ b/todo.md @@ -8,10 +8,10 @@ - [X] LOCKBOX - [X] PAY BY PHONE - [X] WIRES - - [ ] RETURNS ACH - - [ ] RETURNS Portal *(new addition)* + - [X] RETURNS ACH + - [X] RETURNS Portal *(new addition)* -- [ ] Adjust pyinstaller spec for new file structure +- [X] Adjust pyinstaller spec for new file structure - [ ] Function to recap year - [ ] Fix Logging @@ -33,7 +33,5 @@ Generate monthly consolidated reports for each month in a year - [ ] Simpify & standardize row/data parsing -## Completed last commit - --- \ No newline at end of file