Shows AboutDialog even if revisions.tx is missing
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Thu, 07 Mar 2024 21:50:33 +0100
changeset 3909 c29a95aebfbf
parent 3907 394c130196b0
child 3910 aa6b3e6eb90f
Shows AboutDialog even if revisions.tx is missing
BeremizIDE.py
dialogs/AboutDialog.py
--- a/BeremizIDE.py	Thu Mar 07 21:19:45 2024 +0100
+++ b/BeremizIDE.py	Thu Mar 07 21:50:33 2024 +0100
@@ -980,8 +980,12 @@
         info = wx.adv.AboutDialogInfo()
         info = version.GetAboutDialogInfo(info)
         info.Name = "Beremiz"
-        with open(ThirdPartyPath("revisions.txt")) as f:
-            revisions=f.read()
+        try:
+            with open(ThirdPartyPath("revisions.txt")) as f:
+                revisions=f.read()
+        except Exception as e:
+            revisions="Can't load revisions.txt: "+str(e)
+        finally:
             info.SetVersion(info.GetVersion(), longVersion=revisions)
 
         info.Description = _("Open Source framework for automation, "
--- a/dialogs/AboutDialog.py	Thu Mar 07 21:19:45 2024 +0100
+++ b/dialogs/AboutDialog.py	Thu Mar 07 21:50:33 2024 +0100
@@ -1,36 +1,11 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-# This file is part of Beremiz, a Integrated Development Environment for
-# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
-# This file is based on code written for Whyteboard project.
-#
 # Copyright (c) 2009, 2010 by Steven Sproat
 # Copyright (c) 2016 by Andrey Skvortsov <andrej.skvortzov@gmail.com>
-#
+# Copyright (c) 2024 by Edouard Tisserant
+
 # See COPYING file for copyrights details.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-#
-
-
-"""
-This module contains classes extended from wx.Dialog used by the GUI.
-"""
-
-
 
 import os
 import wx
@@ -40,8 +15,7 @@
 
 class AboutDialog(wx.Dialog):
     """
-    A replacement About Dialog for Windows, as it uses a generic frame that
-    well...sucks.
+    Simpler replacement of About Dialog that shows LongVersion
     """
     def __init__(self, parent, info):
         title = _("About") + " " + info.Name
@@ -173,7 +147,4 @@
 
 
 def ShowAboutDialog(parent, info):
-    if os.name == "nt":
-        AboutDialog(parent, info)
-    else:
-        wx.adv.AboutBox(info)
+    AboutDialog(parent, info)