Troubleshooting pyinstaller.

This commit is contained in:
lwark
2024-07-29 08:21:47 -05:00
parent e85a4bba6f
commit f5e34991d7
8 changed files with 103 additions and 34 deletions

View File

@@ -188,7 +188,10 @@ class App(QMainWindow):
current_month_bak = current_month_bak.with_suffix(".db")
if not current_month_bak.exists() and "demo" not in self.ctx.database_path.__str__():
logger.info("No backup found for this month, backing up database.")
shutil.copyfile(self.ctx.database_path, current_month_bak)
try:
shutil.copyfile(self.ctx.backup_path, current_month_bak)
except PermissionError as e:
logger.error(f"Couldn't backup database due to: {e}")
case "postgresql+psycopg2":
logger.warning(f"Backup function not yet implemented for psql")
current_month_bak = current_month_bak.with_suffix(".psql")

View File

@@ -85,7 +85,10 @@ class ControlsViewer(QWidget):
self.mode = self.mode_typer.currentText()
self.sub_typer.clear()
# NOTE: lookup subtypes
sub_types = ControlType.query(name=self.con_type).get_subtypes(mode=self.mode)
try:
sub_types = ControlType.query(name=self.con_type).get_subtypes(mode=self.mode)
except AttributeError:
sub_types = []
if sub_types != []:
# NOTE: block signal that will rerun controls getter and update sub_typer
with QSignalBlocker(self.sub_typer) as blocker: