Fixed toml write error and updated pyinstaller spec to include new settings.

dev 3.3
= 3 years ago
parent 1bb12c722a
commit 5b03a6c7a9
Signed by untrusted user who does not match committer: gprog
GPG Key ID: 5BE9BB58D37713F8
  1. 2
      IL Extract.spec
  2. 29
      src/il_extract.py

@ -8,7 +8,7 @@ a = Analysis(
['src/il_extract.py'],
pathex=['src'],
binaries=[],
datas=[('src/assets/*', 'assets'), ('settings.json', '.')],
datas=[('src/assets/*', 'assets'), ('settings.toml', '.')],
hiddenimports=[],
hookspath=[],
hooksconfig={},

@ -6,7 +6,7 @@ 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
from logging import debug, DEBUG, basicConfig, exception
from tomllib import load
from tomli_w import dump
@ -35,7 +35,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
# The location that the outputfile will be saved at
self.outputFile = ""
# Load the settings.toml
with open("settings.toml") as s:
with open("settings.toml", mode="rb") as s:
self.settings = load(s)
# Set the current report type to ACH as default
@ -221,7 +221,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
if self.settings["defaultLocations"][self.curReportType] == '':
self.settings["defaultLocations"][self.curReportType] = ('/').join(self.inputFile.split('/')[:-1])
debug(f"checked_for_saved: saved new deafult location | {self.curReportType} | {self.settings['defaultLocations'][self.curReportType]}")
with open('settings.toml', 'w') as s:
with open('settings.toml', 'wb') as s:
# Save changes to the setting
dump(self.settings, s)
@ -294,13 +294,16 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
if __name__ == "__main__":
# Defines the app
app = QtWidgets.QApplication(sys.argv)
# Sets the style
app.setStyle("Fusion")
# Builds the main window
window = MainWindow()
window.setWindowTitle("IL Extract")
window.show()
# Starts the app
app.exec()
try:
# Defines the app
app = QtWidgets.QApplication(sys.argv)
# Sets the style
app.setStyle("Fusion")
# Builds the main window
window = MainWindow()
window.setWindowTitle("IL Extract")
window.show()
# Starts the app
app.exec()
except Exception as e:
exception(f"HIGH LEVEL EXECPTION: {e}")

Loading…
Cancel
Save