def view_log_messages(self): if self.log_dlgHlpr: dlg = self.log_dlgHlpr.qtDlg dlgUI = self.log_dlgHlpr.dlgUI else: dlg = QtWidgets.QDialog(self.app_win) dlg.setModal(False) dlgUI = Ui_LogviewDlg() dlgUI.setupUi(dlg) dlg.setWindowTitle('PyCal - Log Viewer') dlgHlpr = LogviewDlgHelper(pcgl.get_log_filename(), dlg, dlgUI) self.log_dlgHlpr = dlgHlpr dlg.show()
if success: logging.info('PyCal configuration loaded from: ' + cfg_root_path) else: logging.error('Error loading PyCal configuration files from ' + cfg_root_path) else: cfg = None return success, cfg if __name__ == '__main__': # need to get this done right away so log file can be written os.makedirs(pcgl.get_root(), exist_ok=True) logging.basicConfig(filename=pcgl.get_log_filename(), format='%(asctime)s %(levelname)s: %(message)s', level=logging.DEBUG, datefmt='%Y-%m-%d %I:%M:%S %Z') logging.info('*--------------------------------------------------------------------------------*') logging.info('PyCal Starting...') logging.disable(logging.DEBUG) load_ok, cfg = initialize_app() app = QtWidgets.QApplication(sys.argv) appMainWindow = PyCalMainWindow() main_win = Ui_MainWindow() main_win.setupUi(appMainWindow)