version.py
changeset 1784 64beb9e9c749
parent 1780 c52d1460cea8
child 1803 da138c5a3063
equal deleted inserted replaced
1729:31e63e25b4cc 1784:64beb9e9c749
    21 # You should have received a copy of the GNU General Public License
    21 # You should have received a copy of the GNU General Public License
    22 # along with this program; if not, write to the Free Software
    22 # along with this program; if not, write to the Free Software
    23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    24 
    24 
    25 
    25 
    26 import subprocess, os
    26 import subprocess
       
    27 import os
       
    28 
    27 import util.paths as paths
    29 import util.paths as paths
    28 
    30 
       
    31 
    29 def GetCommunityHelpMsg():
    32 def GetCommunityHelpMsg():
    30     return  _("The best place to ask questions about Beremiz/PLCOpenEditor\n"
    33     return _(
    31 		     "is project's mailing list: beremiz-devel@lists.sourceforge.net\n"
    34         "The best place to ask questions about Beremiz/PLCOpenEditor\n"
    32                      "\n"
    35         "is project's mailing list: beremiz-devel@lists.sourceforge.net\n"
    33                      "This is the main community support channel.\n"
    36         "\n"
    34                      "For posting it is required to be subscribed to the mailing list.\n"
    37         "This is the main community support channel.\n"
    35                      "\n"
    38         "For posting it is required to be subscribed to the mailing list.\n"
    36                      "You can subscribe to the list here:\n"
    39         "\n"
    37                      "https://lists.sourceforge.net/lists/listinfo/beremiz-devel")
    40         "You can subscribe to the list here:\n"
       
    41         "https://lists.sourceforge.net/lists/listinfo/beremiz-devel"
       
    42     )
       
    43 
    38 
    44 
    39 def GetAppRevision():
    45 def GetAppRevision():
    40     rev = None
    46     rev = None
    41     app_dir=paths.AbsDir(__file__)
    47     app_dir = paths.AbsDir(__file__)
    42     try:
    48     try:
    43         pipe = subprocess.Popen(
    49         pipe = subprocess.Popen(
    44             ["hg", "id", "-i"],
    50             ["hg", "id", "-i"],
    45             stdout = subprocess.PIPE,
    51             stdout=subprocess.PIPE,
    46             cwd = app_dir
    52             cwd=app_dir
    47         )
    53         )
    48         rev = pipe.communicate()[0]
    54         rev = pipe.communicate()[0]
    49         if pipe.returncode != 0:
    55         if pipe.returncode != 0:
    50             rev = None
    56             rev = None
    51     except:
    57     except Exception:
    52         pass
    58         pass
    53     
    59 
    54     # if this is not mercurial repository
    60     # if this is not mercurial repository
    55     # try to read revision from file
    61     # try to read revision from file
    56     if rev is None:
    62     if rev is None:
    57         try:
    63         try:
    58             f = open(os.path.join(app_dir,"revision"))
    64             f = open(os.path.join(app_dir, "revision"))
    59             rev = f.readline()
    65             rev = f.readline()
    60         except:
    66         except Exception:
    61             pass
    67             pass
    62     return rev
    68     return rev
       
    69 
    63 
    70 
    64 def GetAboutDialogInfo():
    71 def GetAboutDialogInfo():
    65     import wx
    72     import wx
    66     info = wx.AboutDialogInfo()
    73     info = wx.AboutDialogInfo()
    67 
    74 
    68     info.Name = "Beremiz"
    75     info.Name = "Beremiz"
    69     info.Version = app_version
    76     info.Version = app_version
    70     
    77 
    71     info.Copyright  = "(C) 2016 Andrey Skvortsov\n"
    78     info.Copyright = ""
       
    79     info.Copyright += "(C) 2016-2017 Andrey Skvortsov\n"
    72     info.Copyright += "(C) 2008-2015 Eduard Tisserant\n"
    80     info.Copyright += "(C) 2008-2015 Eduard Tisserant\n"
    73     info.Copyright += "(C) 2008-2015 Laurent Bessard"
    81     info.Copyright += "(C) 2008-2015 Laurent Bessard"
    74 
    82 
    75     info.WebSite = ("http://beremiz.org", "beremiz.org")
    83     info.WebSite = ("http://beremiz.org", "beremiz.org")
    76     
    84 
    77     info.Description = _("Open Source framework for automation, "
    85     info.Description = _("Open Source framework for automation, "
    78                              "implemented IEC 61131 IDE with constantly growing set of extensions "
    86                          "implemented IEC 61131 IDE with constantly growing set of extensions "
    79                              "and flexible PLC runtime.")
    87                          "and flexible PLC runtime.")
    80     
       
    81     info.Developers = ("Andrey Skvortsov <andrej.skvortzov@gmail.com>",
       
    82 		       "Sergey Surkov <surkov.sv@summatechnology.ru>",
       
    83 		       "Edouard Tisserant <edouard.tisserant@gmail.com>",
       
    84 		       "Laurent Bessard <laurent.bessard@gmail.com>")
       
    85 
    88 
       
    89     info.Developers = (
       
    90         "Andrey Skvortsov <andrej.skvortzov@gmail.com>",
       
    91         "Sergey Surkov <surkov.sv@summatechnology.ru>",
       
    92         "Edouard Tisserant <edouard.tisserant@gmail.com>",
       
    93         "Laurent Bessard <laurent.bessard@gmail.com>")
    86 
    94 
    87     info.License = ('\n This program is free software; you can redistribute it and/or\n'
    95     info.License = (
    88     ' modify it under the terms of the GNU General Public License\n'
    96         '\n This program is free software; you can redistribute it and/or\n'
    89     ' as published by the Free Software Foundation; either version 2\n'
    97         ' modify it under the terms of the GNU General Public License\n'
    90     ' of the License, or (at your option) any later version.\n'
    98         ' as published by the Free Software Foundation; either version 2\n'
    91     '\n'
    99         ' of the License, or (at your option) any later version.\n'
    92     ' This program is distributed in the hope that it will be useful,\n'
   100         '\n'
    93     ' but WITHOUT ANY WARRANTY; without even the implied warranty of\n'
   101         ' This program is distributed in the hope that it will be useful,\n'
    94     ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n'
   102         ' but WITHOUT ANY WARRANTY; without even the implied warranty of\n'
    95     ' GNU General Public License below for more details.\n'
   103         ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n'
    96     '\n'
   104         ' GNU General Public License below for more details.\n'
    97     '\n'
   105         '\n'
    98     '\n'
   106         '\n'
    99     '')
   107         '\n'
       
   108         ''
       
   109     )
   100 
   110 
   101     # read license file
   111     # read license file
   102     path=paths.AbsDir(__file__)
   112     path = paths.AbsDir(__file__)
   103     license_path = os.path.join(path, "COPYING")
   113     license_path = os.path.join(path, "COPYING")
   104     license=''
   114     license = ''
   105     if os.path.exists(license_path):
   115     if os.path.exists(license_path):
   106         with open(license_path) as f:
   116         with open(license_path) as f:
   107             info.License += f.read()
   117             info.License += f.read()
   108 
   118 
   109     info.Icon = wx.Icon(os.path.join(path, "images", "about_brz_logo.png"), wx.BITMAP_TYPE_PNG)
   119     info.Icon = wx.Icon(os.path.join(path, "images", "about_brz_logo.png"), wx.BITMAP_TYPE_PNG)
   110 
   120 
   111     info.Translators = ("Russian\t- Andrey Skvortsov <andrej.skvortzov@gmail.com>",
   121     info.Translators = (
   112 	                "Korean\t- Reinhard Lee <lij3105@gmail.com>",
   122         "Russian\t- Andrey Skvortsov <andrej.skvortzov@gmail.com>",
   113 	                "German\t- Mark Muzenhardt <mark.muzenhardt@gmail.com>",
   123         "Korean\t- Reinhard Lee <lij3105@gmail.com>",
   114 	                "French\t- Laurent Bessard <laurent.bessard@gmail.com>",
   124         "German\t- Mark Muzenhardt <mark.muzenhardt@gmail.com>",
   115 	                "      \t  Fabien M <mail@fabienm.eu>",
   125         "French\t- Laurent Bessard <laurent.bessard@gmail.com>",
   116 	                "Slovenian\t- Janez Pregelj",
   126         "      \t  Fabien M <mail@fabienm.eu>",
   117 	                "Portuguese\t- Thiago Alves <thiagoralves@gmail.com>"
   127         "Slovenian\t- Janez Pregelj",
       
   128         "Portuguese\t- Thiago Alves <thiagoralves@gmail.com>"
   118     )
   129     )
   119     return info
   130     return info
   120 
   131 
   121 app_version =  "1.2"
   132 
       
   133 app_version = "1.2"
   122 rev = GetAppRevision()
   134 rev = GetAppRevision()
   123 if rev is not None:
   135 if rev is not None:
   124     app_version = app_version + "-" + rev.rstrip()
   136     app_version = app_version + "-" + rev.rstrip()
   125     
       
   126         
       
   127