Added sending logs to my remote folder.

dev
= 3 years ago
parent cadf5f4b0b
commit e3625793da
Signed by untrusted user who does not match committer: gprog
GPG Key ID: 5BE9BB58D37713F8
  1. 1
      .gitignore
  2. 1
      report_config_termplate.toml
  3. 6
      settings.toml
  4. 31
      src/il_extract.py
  5. 2
      src/il_reports.py
  6. 8
      todo.md

1
.gitignore vendored

@ -4,6 +4,7 @@ dist/
InputFiles/ InputFiles/
__pycache__/ __pycache__/
2023/ 2023/
ilr_test/
*.lnk *.lnk
*.spec *.spec

@ -1 +0,0 @@
name = "Test Name"

@ -1,11 +1,11 @@
debug = true debug = true
consolidatedBasePath = '' consolidatedBasePath = ""
[defaultLocations] [defaultLocations]
ach = '' ach = "//leafnow.com/shared/Business Solutions/Griff/Code/InfoLeaseExtract/2023/2023.03/2023.03.01/ACH"
disp = "" disp = ""
gl = "" gl = ""
lb = '' lb = "//leafnow.com/shared/Business Solutions/Griff/Code/InfoLeaseExtract/2023/2023.03/2023.03.01/LOCKBOX"
minv = "" minv = ""
niv = "" niv = ""
ren = "" ren = ""

@ -2,20 +2,25 @@ from ui_ile_main_window import Ui_MainWindow
import sys import sys
import os import os
import pandas as pd import pandas as pd
import json
from PyQt5 import QtWidgets from PyQt5 import QtWidgets
from datetime import datetime as dt from datetime import datetime as dt
import il_reports as ilx #TODO redo aliasing 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 tomllib import load
from tomli_w import dump 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: with open("settings.toml", mode='rb') as s:
settings = load(s) settings = load(s)
#if settings["debug"]: #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...") debug("Running main.py...")
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
""" """
@ -307,3 +312,21 @@ if __name__ == "__main__":
app.exec() app.exec()
except Exception as e: except Exception as e:
exception(f"HIGH LEVEL EXECPTION: {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}!")

@ -11,7 +11,7 @@ from hashlib import md5
import openpyxl as pxl import openpyxl as pxl
from tomllib import load from tomllib import load
# V3.3.3 | 06/15/23 # V3.4 | 06/15/23
with open("settings.toml", mode='rb') as s: with open("settings.toml", mode='rb') as s:
settings = load(s) settings = load(s)

@ -8,10 +8,10 @@
- [X] LOCKBOX - [X] LOCKBOX
- [X] PAY BY PHONE - [X] PAY BY PHONE
- [X] WIRES - [X] WIRES
- [ ] RETURNS ACH - [X] RETURNS ACH
- [ ] RETURNS Portal *(new addition)* - [X] RETURNS Portal *(new addition)*
- [ ] Adjust pyinstaller spec for new file structure - [X] Adjust pyinstaller spec for new file structure
- [ ] Function to recap year - [ ] Function to recap year
- [ ] Fix Logging - [ ] Fix Logging
@ -33,7 +33,5 @@ Generate monthly consolidated reports for each month in a year
- [ ] Simpify & standardize row/data parsing - [ ] Simpify & standardize row/data parsing
## Completed last commit
--- ---
Loading…
Cancel
Save