andrej@1565: #!/usr/bin/env python andrej@1565: # -*- coding: utf-8 -*- andrej@1565: andrej@1565: # This file is part of Beremiz, a Integrated Development Environment for andrej@1565: # programming IEC 61131-3 automates supporting plcopen standard and CanFestival. andrej@1565: # andrej@1565: # Copyright (C) 2016: Andrey Skvortsov andrej@1565: # andrej@1565: # See COPYING file for copyrights details. andrej@1565: # andrej@1565: # This program is free software; you can redistribute it and/or andrej@1565: # modify it under the terms of the GNU General Public License andrej@1565: # as published by the Free Software Foundation; either version 2 andrej@1565: # of the License, or (at your option) any later version. andrej@1565: # andrej@1565: # This program is distributed in the hope that it will be useful, andrej@1565: # but WITHOUT ANY WARRANTY; without even the implied warranty of andrej@1565: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the andrej@1565: # GNU General Public License for more details. andrej@1565: # andrej@1565: # You should have received a copy of the GNU General Public License andrej@1565: # along with this program; if not, write to the Free Software andrej@1565: # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. andrej@1565: andrej@1565: andrej@1881: from __future__ import absolute_import andrej@2239: from __future__ import unicode_literals andrej@2239: andrej@1732: import subprocess andrej@1732: import os andrej@1732: andrej@1680: import util.paths as paths andrej@1561: andrej@1736: andrej@1692: def GetCommunityHelpMsg(): andrej@1768: return _( andrej@1768: "The best place to ask questions about Beremiz/PLCOpenEditor\n" andrej@1768: "is project's mailing list: beremiz-devel@lists.sourceforge.net\n" andrej@1768: "\n" andrej@1768: "This is the main community support channel.\n" andrej@1768: "For posting it is required to be subscribed to the mailing list.\n" andrej@1768: "\n" andrej@1768: "You can subscribe to the list here:\n" andrej@1768: "https://lists.sourceforge.net/lists/listinfo/beremiz-devel" andrej@1768: ) andrej@1692: andrej@1736: andrej@1561: def GetAppRevision(): andrej@1561: rev = None andrej@1742: app_dir = paths.AbsDir(__file__) andrej@1561: try: andrej@1561: pipe = subprocess.Popen( andrej@1561: ["hg", "id", "-i"], andrej@1744: stdout=subprocess.PIPE, andrej@1744: cwd=app_dir andrej@1561: ) andrej@1561: rev = pipe.communicate()[0] andrej@1561: if pipe.returncode != 0: andrej@1561: rev = None andrej@1780: except Exception: andrej@1561: pass andrej@1735: andrej@1561: # if this is not mercurial repository andrej@1561: # try to read revision from file andrej@1561: if rev is None: andrej@1561: try: andrej@1740: f = open(os.path.join(app_dir, "revision")) andrej@1561: rev = f.readline() andrej@1780: except Exception: andrej@1561: pass andrej@1561: return rev andrej@1561: andrej@1736: andrej@1565: def GetAboutDialogInfo(): andrej@1565: import wx andrej@1565: info = wx.AboutDialogInfo() andrej@1565: andrej@1565: info.Name = "Beremiz" andrej@1565: info.Version = app_version andrej@1735: andrej@1758: info.Copyright = "" andrej@2351: info.Copyright += "(C) 2016-2018 Andrey Skvortsov\n" andrej@2351: info.Copyright += "(C) 2008-2018 Eduard Tisserant\n" andrej@1565: info.Copyright += "(C) 2008-2015 Laurent Bessard" andrej@1565: andrej@1565: info.WebSite = ("http://beremiz.org", "beremiz.org") andrej@1735: andrej@1565: info.Description = _("Open Source framework for automation, " andrej@1767: "implemented IEC 61131 IDE with constantly growing set of extensions " andrej@1767: "and flexible PLC runtime.") andrej@1735: andrej@1768: info.Developers = ( andrej@1768: "Andrey Skvortsov ", andrej@1768: "Sergey Surkov ", andrej@1768: "Edouard Tisserant ", andrej@1768: "Laurent Bessard ") andrej@1565: andrej@1768: info.License = ( andrej@1768: '\n This program is free software; you can redistribute it and/or\n' andrej@1768: ' modify it under the terms of the GNU General Public License\n' andrej@1768: ' as published by the Free Software Foundation; either version 2\n' andrej@1768: ' of the License, or (at your option) any later version.\n' andrej@1768: '\n' andrej@1768: ' This program is distributed in the hope that it will be useful,\n' andrej@1768: ' but WITHOUT ANY WARRANTY; without even the implied warranty of\n' andrej@1768: ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n' andrej@1768: ' GNU General Public License below for more details.\n' andrej@1768: '\n' andrej@1768: '\n' andrej@1768: '\n' andrej@1768: '' andrej@1768: ) andrej@1565: andrej@1565: # read license file andrej@1742: path = paths.AbsDir(__file__) andrej@1680: license_path = os.path.join(path, "COPYING") andrej@1565: if os.path.exists(license_path): andrej@1565: with open(license_path) as f: andrej@1565: info.License += f.read() andrej@1565: andrej@1569: info.Icon = wx.Icon(os.path.join(path, "images", "about_brz_logo.png"), wx.BITMAP_TYPE_PNG) andrej@1565: andrej@1768: info.Translators = ( andrej@1803: "Bengali (Bangladesh)", andrej@1803: " Adhir Dutta , 2017", andrej@1803: "", andrej@1803: andrej@1803: "Chinese", andrej@2351: " Frank Guan , 2018", andrej@2351: " Tango Wu , 2017", andrej@2351: " Yiwei Yan <523136664@qq.com>, 2018", andrej@2351: "", andrej@2351: andrej@2351: "Dutch (Netherlands)", andrej@2351: " Jordy van der Heijden , 2018", andrej@1803: "", andrej@1803: andrej@1803: "French", andrej@2351: " Edouard Tisserant , 2018", andrej@1803: " Fabien Marteau , 2017", andrej@1803: " Laurent Bessard , 2008", andrej@1803: "", andrej@1803: andrej@1803: "German", andrej@1803: " Andrey Skvortsov , 2017", andrej@2351: " Hendrik Knackstedt , 2017 ", andrej@1803: " Mark Muzenhardt , 2012", andrej@1803: "", andrej@1803: andrej@1803: "Hungarian", andrej@2351: " Krisztián Veress , 2018", andrej@1803: " Gábor Véninger , 2017", andrej@1803: "", andrej@1803: andrej@1803: "Italian", andrej@1803: " Luca Magnabosco , 2017", andrej@1803: " Manuele Conti , 2017", andrej@1803: "", andrej@1803: andrej@1803: "Korean", andrej@2351: " Ikhwan Kim , 2018", andrej@1803: " Reinhard Lee , 2012", andrej@1803: "", andrej@1803: andrej@2351: "Portuguese", andrej@1803: " Pedro Coimbra , 2017", andrej@1803: "", andrej@1803: andrej@1803: "Portuguese (Brazil)", andrej@2351: " Rodrigo Rolle , 2018", andrej@1803: " Thiago Alves , 2017", andrej@1803: "", andrej@1803: andrej@2351: "Romanian", andrej@2351: " Emil Saracutu , 2018", andrej@2351: "", andrej@2351: andrej@1803: "Russian", andrej@2351: " Andrey Skvortsov , 2018", andrej@2351: " Sergey Surkov , 2018", andrej@2351: " zx_alexis , 2017", andrej@1803: "", andrej@1803: andrej@1803: "Slovenian", andrej@2351: " Janez Pregelj , 2018", andrej@2351: " Andraz Gregorcic , 2017", andrej@1803: "", andrej@1803: andrej@1803: "Spanish", andrej@2351: " Carlos Guilarte , 2018", andrej@2351: " Yegor Yefremov , 2018", andrej@2351: " Jorge Rojas, 2018", andrej@1803: " Marcial González de Armas , 2017", andrej@2351: " Nelson Mambre , 2017", andrej@2351: "", andrej@2351: andrej@2351: "Turkish", andrej@2351: " Ibrahim Kilicarslan , 2018", andrej@1803: "", andrej@1803: andrej@1706: ) andrej@1565: return info andrej@1565: andrej@1749: andrej@1758: app_version = "1.2" andrej@1561: rev = GetAppRevision() andrej@1561: if rev is not None: andrej@1561: app_version = app_version + "-" + rev.rstrip()