author | Andrey Skvortsov <andrej.skvortzov@gmail.com> |
Tue, 28 Mar 2017 19:48:51 +0300 | |
changeset 1670 | cd03b8432541 |
parent 1581 | 2295fdc5c271 |
child 1680 | 6db967480b7d |
permissions | -rwxr-xr-x |
814 | 1 |
#!/usr/bin/env python |
2 |
# -*- coding: utf-8 -*- |
|
3 |
||
1571
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
4 |
# This file is part of Beremiz, a Integrated Development Environment for |
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
5 |
# programming IEC 61131-3 automates supporting plcopen standard and CanFestival. |
814 | 6 |
# |
1571
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
7 |
# Copyright (C) 2007: Edouard TISSERANT and Laurent BESSARD |
814 | 8 |
# |
1571
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
9 |
# See COPYING file for copyrights details. |
814 | 10 |
# |
1571
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
11 |
# This program is free software; you can redistribute it and/or |
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
12 |
# modify it under the terms of the GNU General Public License |
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
13 |
# as published by the Free Software Foundation; either version 2 |
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
14 |
# of the License, or (at your option) any later version. |
814 | 15 |
# |
1571
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
16 |
# This program is distributed in the hope that it will be useful, |
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
17 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
18 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
19 |
# GNU General Public License for more details. |
814 | 20 |
# |
1571
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
21 |
# You should have received a copy of the GNU General Public License |
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
22 |
# along with this program; if not, write to the Free Software |
486f94a8032c
fix license notices in source files and license files under GPLv2+
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1565
diff
changeset
|
23 |
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
814 | 24 |
|
25 |
import wx |
|
26 |
import os, sys, platform, time, traceback, getopt |
|
1560
4ce8492159ab
add version with commit hash to 'About' dialogs for Beremiz IDE and PLCOpenEditor
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1533
diff
changeset
|
27 |
import version |
814 | 28 |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
29 |
beremiz_dir = os.path.dirname(os.path.realpath(__file__)) |
814 | 30 |
|
31 |
__version__ = "$Revision: 1.130 $" |
|
32 |
||
33 |
if __name__ == '__main__': |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
34 |
# Usage message displayed when help request or when error detected in |
814 | 35 |
# command line |
36 |
def usage(): |
|
37 |
print "\nUsage of PLCOpenEditor.py :" |
|
38 |
print "\n %s [Filepath]\n"%sys.argv[0] |
|
39 |
||
40 |
# Parse options given to PLCOpenEditor in command line |
|
41 |
try: |
|
42 |
opts, args = getopt.getopt(sys.argv[1:], "h", ["help"]) |
|
43 |
except getopt.GetoptError: |
|
44 |
# print help information and exit: |
|
45 |
usage() |
|
46 |
sys.exit(2) |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
47 |
|
814 | 48 |
# Extract if help has been requested |
49 |
for o, a in opts: |
|
50 |
if o in ("-h", "--help"): |
|
51 |
usage() |
|
52 |
sys.exit() |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
53 |
|
814 | 54 |
# Extract the optional filename to open |
55 |
fileOpen = None |
|
56 |
if len(args) > 1: |
|
57 |
usage() |
|
58 |
sys.exit() |
|
59 |
elif len(args) == 1: |
|
60 |
fileOpen = args[0] |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
61 |
|
814 | 62 |
# Create wxApp (Need to create App before internationalization because of |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
63 |
# Windows) |
1533
aca8f43483e9
fix issues in PLCOpenEditor with moving from wxWidgets 2.8 to 3.0
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1492
diff
changeset
|
64 |
if wx.VERSION >= (3, 0, 0): |
aca8f43483e9
fix issues in PLCOpenEditor with moving from wxWidgets 2.8 to 3.0
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1492
diff
changeset
|
65 |
app = wx.App() |
aca8f43483e9
fix issues in PLCOpenEditor with moving from wxWidgets 2.8 to 3.0
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1492
diff
changeset
|
66 |
else: |
aca8f43483e9
fix issues in PLCOpenEditor with moving from wxWidgets 2.8 to 3.0
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1492
diff
changeset
|
67 |
app = wx.PySimpleApp() |
aca8f43483e9
fix issues in PLCOpenEditor with moving from wxWidgets 2.8 to 3.0
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1492
diff
changeset
|
68 |
|
814 | 69 |
|
1388
67c9a9482d24
Factorized bitmap and i18n resources loading in between PLCopenEditor and Beremiz. Now in utils/misc.py
Edouard Tisserant
parents:
1330
diff
changeset
|
70 |
from util.misc import InstallLocalRessources |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
71 |
InstallLocalRessources(beremiz_dir) |
1388
67c9a9482d24
Factorized bitmap and i18n resources loading in between PLCopenEditor and Beremiz. Now in utils/misc.py
Edouard Tisserant
parents:
1330
diff
changeset
|
72 |
|
815
e4f24593a758
Adding support for extending internationalization to extensions
laurent
parents:
814
diff
changeset
|
73 |
from docutil import * |
814 | 74 |
from IDEFrame import IDEFrame, AppendMenu |
75 |
from IDEFrame import TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU, PROJECTTREE, POUINSTANCEVARIABLESPANEL, LIBRARYTREE, PAGETITLES |
|
76 |
from IDEFrame import EncodeFileSystemPath, DecodeFileSystemPath |
|
77 |
from editors.Viewer import Viewer |
|
78 |
from PLCControler import PLCControler |
|
1030
d9e75a5b5f08
Fix bug when creating New project in PLCOpenEditor
Laurent Bessard
parents:
980
diff
changeset
|
79 |
from dialogs import ProjectDialog |
1565
894f31f8ca64
make about dialog boxes use standard wx about dialogs
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1560
diff
changeset
|
80 |
from dialogs.AboutDialog import ShowAboutDialog |
814 | 81 |
|
82 |
#------------------------------------------------------------------------------- |
|
83 |
# PLCOpenEditor Main Class |
|
84 |
#------------------------------------------------------------------------------- |
|
85 |
||
86 |
# Define PLCOpenEditor FileMenu extra items id |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
87 |
[ID_PLCOPENEDITORFILEMENUGENERATE, |
814 | 88 |
] = [wx.NewId() for _init_coll_FileMenu_Items in range(1)] |
89 |
||
90 |
class PLCOpenEditor(IDEFrame): |
|
91 |
||
92 |
# Compatibility function for wx versions < 2.6 |
|
93 |
if wx.VERSION < (2, 6, 0): |
|
94 |
def Bind(self, event, function, id = None): |
|
95 |
if id is not None: |
|
96 |
event(self, id, function) |
|
97 |
else: |
|
98 |
event(self, function) |
|
99 |
||
100 |
def _init_coll_FileMenu_Items(self, parent): |
|
101 |
AppendMenu(parent, help='', id=wx.ID_NEW, |
|
102 |
kind=wx.ITEM_NORMAL, text=_(u'New') +'\tCTRL+N') |
|
103 |
AppendMenu(parent, help='', id=wx.ID_OPEN, |
|
104 |
kind=wx.ITEM_NORMAL, text=_(u'Open') + '\tCTRL+O') |
|
105 |
AppendMenu(parent, help='', id=wx.ID_CLOSE, |
|
106 |
kind=wx.ITEM_NORMAL, text=_(u'Close Tab') + '\tCTRL+W') |
|
107 |
AppendMenu(parent, help='', id=wx.ID_CLOSE_ALL, |
|
108 |
kind=wx.ITEM_NORMAL, text=_(u'Close Project') + '\tCTRL+SHIFT+W') |
|
109 |
parent.AppendSeparator() |
|
110 |
AppendMenu(parent, help='', id=wx.ID_SAVE, |
|
111 |
kind=wx.ITEM_NORMAL, text=_(u'Save') + '\tCTRL+S') |
|
112 |
AppendMenu(parent, help='', id=wx.ID_SAVEAS, |
|
113 |
kind=wx.ITEM_NORMAL, text=_(u'Save As...') + '\tCTRL+SHIFT+S') |
|
114 |
AppendMenu(parent, help='', id=ID_PLCOPENEDITORFILEMENUGENERATE, |
|
115 |
kind=wx.ITEM_NORMAL, text=_(u'Generate Program') + '\tCTRL+G') |
|
116 |
parent.AppendSeparator() |
|
117 |
AppendMenu(parent, help='', id=wx.ID_PAGE_SETUP, |
|
118 |
kind=wx.ITEM_NORMAL, text=_(u'Page Setup') + '\tCTRL+ALT+P') |
|
119 |
AppendMenu(parent, help='', id=wx.ID_PREVIEW, |
|
120 |
kind=wx.ITEM_NORMAL, text=_(u'Preview') + '\tCTRL+SHIFT+P') |
|
121 |
AppendMenu(parent, help='', id=wx.ID_PRINT, |
|
122 |
kind=wx.ITEM_NORMAL, text=_(u'Print') + '\tCTRL+P') |
|
123 |
parent.AppendSeparator() |
|
124 |
AppendMenu(parent, help='', id=wx.ID_PROPERTIES, |
|
125 |
kind=wx.ITEM_NORMAL, text=_(u'&Properties')) |
|
126 |
parent.AppendSeparator() |
|
127 |
AppendMenu(parent, help='', id=wx.ID_EXIT, |
|
128 |
kind=wx.ITEM_NORMAL, text=_(u'Quit') + '\tCTRL+Q') |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
129 |
|
814 | 130 |
self.Bind(wx.EVT_MENU, self.OnNewProjectMenu, id=wx.ID_NEW) |
131 |
self.Bind(wx.EVT_MENU, self.OnOpenProjectMenu, id=wx.ID_OPEN) |
|
132 |
self.Bind(wx.EVT_MENU, self.OnCloseTabMenu, id=wx.ID_CLOSE) |
|
133 |
self.Bind(wx.EVT_MENU, self.OnCloseProjectMenu, id=wx.ID_CLOSE_ALL) |
|
134 |
self.Bind(wx.EVT_MENU, self.OnSaveProjectMenu, id=wx.ID_SAVE) |
|
135 |
self.Bind(wx.EVT_MENU, self.OnSaveProjectAsMenu, id=wx.ID_SAVEAS) |
|
136 |
self.Bind(wx.EVT_MENU, self.OnGenerateProgramMenu, |
|
137 |
id=ID_PLCOPENEDITORFILEMENUGENERATE) |
|
138 |
self.Bind(wx.EVT_MENU, self.OnPageSetupMenu, id=wx.ID_PAGE_SETUP) |
|
139 |
self.Bind(wx.EVT_MENU, self.OnPreviewMenu, id=wx.ID_PREVIEW) |
|
140 |
self.Bind(wx.EVT_MENU, self.OnPrintMenu, id=wx.ID_PRINT) |
|
141 |
self.Bind(wx.EVT_MENU, self.OnPropertiesMenu, id=wx.ID_PROPERTIES) |
|
142 |
self.Bind(wx.EVT_MENU, self.OnQuitMenu, id=wx.ID_EXIT) |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
143 |
|
814 | 144 |
self.AddToMenuToolBar([(wx.ID_NEW, "new", _(u'New'), None), |
145 |
(wx.ID_OPEN, "open", _(u'Open'), None), |
|
146 |
(wx.ID_SAVE, "save", _(u'Save'), None), |
|
147 |
(wx.ID_SAVEAS, "saveas", _(u'Save As...'), None), |
|
148 |
(wx.ID_PRINT, "print", _(u'Print'), None)]) |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
149 |
|
814 | 150 |
def _init_coll_HelpMenu_Items(self, parent): |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
151 |
AppendMenu(parent, help='', id=wx.ID_HELP, |
814 | 152 |
kind=wx.ITEM_NORMAL, text=_(u'PLCOpenEditor') + '\tF1') |
153 |
#AppendMenu(parent, help='', id=wx.ID_HELP_CONTENTS, |
|
154 |
# kind=wx.ITEM_NORMAL, text=u'PLCOpen\tF2') |
|
155 |
#AppendMenu(parent, help='', id=wx.ID_HELP_CONTEXT, |
|
156 |
# kind=wx.ITEM_NORMAL, text=u'IEC 61131-3\tF3') |
|
157 |
AppendMenu(parent, help='', id=wx.ID_ABOUT, |
|
158 |
kind=wx.ITEM_NORMAL, text=_(u'About')) |
|
159 |
self.Bind(wx.EVT_MENU, self.OnPLCOpenEditorMenu, id=wx.ID_HELP) |
|
160 |
#self.Bind(wx.EVT_MENU, self.OnPLCOpenMenu, id=wx.ID_HELP_CONTENTS) |
|
161 |
self.Bind(wx.EVT_MENU, self.OnAboutMenu, id=wx.ID_ABOUT) |
|
162 |
||
163 |
## Constructor of the PLCOpenEditor class. |
|
164 |
# @param parent The parent window. |
|
165 |
# @param controler The controler been used by PLCOpenEditor (default: None). |
|
166 |
# @param fileOpen The filepath to open if no controler defined (default: None). |
|
167 |
# @param debug The filepath to open if no controler defined (default: False). |
|
168 |
def __init__(self, parent, fileOpen = None): |
|
1533
aca8f43483e9
fix issues in PLCOpenEditor with moving from wxWidgets 2.8 to 3.0
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1492
diff
changeset
|
169 |
self.icon = wx.Icon(os.path.join(beremiz_dir, "images", "poe.ico"), wx.BITMAP_TYPE_ICO) |
814 | 170 |
IDEFrame.__init__(self, parent) |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
171 |
|
814 | 172 |
result = None |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
173 |
|
814 | 174 |
# Open the filepath if defined |
175 |
if fileOpen is not None: |
|
176 |
fileOpen = DecodeFileSystemPath(fileOpen, False) |
|
177 |
if os.path.isfile(fileOpen): |
|
178 |
# Create a new controller |
|
179 |
controler = PLCControler() |
|
180 |
result = controler.OpenXMLFile(fileOpen) |
|
1330
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
181 |
self.Controler = controler |
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
182 |
self.LibraryPanel.SetController(controler) |
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
183 |
self.ProjectTree.Enable(True) |
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
184 |
self.PouInstanceVariablesPanel.SetController(controler) |
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
185 |
self._Refresh(PROJECTTREE, POUINSTANCEVARIABLESPANEL, LIBRARYTREE) |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
186 |
|
814 | 187 |
# Define PLCOpenEditor icon |
1533
aca8f43483e9
fix issues in PLCOpenEditor with moving from wxWidgets 2.8 to 3.0
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1492
diff
changeset
|
188 |
self.SetIcon(self.icon) |
814 | 189 |
|
190 |
self.Bind(wx.EVT_CLOSE, self.OnCloseFrame) |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
191 |
|
814 | 192 |
self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU) |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
193 |
|
814 | 194 |
if result is not None: |
1581
2295fdc5c271
fix translation strings with multiple parameters
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1580
diff
changeset
|
195 |
(num, line) = result |
2295fdc5c271
fix translation strings with multiple parameters
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1580
diff
changeset
|
196 |
self.ShowErrorMessage(_("PLC syntax error at line {a1}:\n{a2}").format(a1 = num, a2 = line)) |
814 | 197 |
|
198 |
def OnCloseFrame(self, event): |
|
199 |
if self.Controler is None or self.CheckSaveBeforeClosing(_("Close Application")): |
|
200 |
self.AUIManager.UnInit() |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
201 |
|
814 | 202 |
self.SaveLastState() |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
203 |
|
814 | 204 |
event.Skip() |
205 |
else: |
|
206 |
event.Veto() |
|
207 |
||
208 |
def RefreshTitle(self): |
|
209 |
name = _("PLCOpenEditor") |
|
210 |
if self.Controler is not None: |
|
211 |
self.SetTitle("%s - %s"%(name, self.Controler.GetFilename())) |
|
212 |
else: |
|
213 |
self.SetTitle(name) |
|
214 |
||
215 |
#------------------------------------------------------------------------------- |
|
216 |
# File Menu Functions |
|
217 |
#------------------------------------------------------------------------------- |
|
218 |
||
219 |
def RefreshFileMenu(self): |
|
220 |
MenuToolBar = self.Panes["MenuToolBar"] |
|
221 |
if self.Controler is not None: |
|
222 |
selected = self.TabsOpened.GetSelection() |
|
223 |
if selected >= 0: |
|
224 |
graphic_viewer = isinstance(self.TabsOpened.GetPage(selected), Viewer) |
|
225 |
else: |
|
226 |
graphic_viewer = False |
|
227 |
if self.TabsOpened.GetPageCount() > 0: |
|
228 |
self.FileMenu.Enable(wx.ID_CLOSE, True) |
|
229 |
if graphic_viewer: |
|
230 |
self.FileMenu.Enable(wx.ID_PREVIEW, True) |
|
231 |
self.FileMenu.Enable(wx.ID_PRINT, True) |
|
232 |
MenuToolBar.EnableTool(wx.ID_PRINT, True) |
|
233 |
else: |
|
234 |
self.FileMenu.Enable(wx.ID_PREVIEW, False) |
|
235 |
self.FileMenu.Enable(wx.ID_PRINT, False) |
|
236 |
MenuToolBar.EnableTool(wx.ID_PRINT, False) |
|
237 |
else: |
|
238 |
self.FileMenu.Enable(wx.ID_CLOSE, False) |
|
239 |
self.FileMenu.Enable(wx.ID_PREVIEW, False) |
|
240 |
self.FileMenu.Enable(wx.ID_PRINT, False) |
|
241 |
MenuToolBar.EnableTool(wx.ID_PRINT, False) |
|
242 |
self.FileMenu.Enable(wx.ID_PAGE_SETUP, True) |
|
243 |
project_modified = not self.Controler.ProjectIsSaved() |
|
244 |
self.FileMenu.Enable(wx.ID_SAVE, project_modified) |
|
245 |
MenuToolBar.EnableTool(wx.ID_SAVE, project_modified) |
|
246 |
self.FileMenu.Enable(wx.ID_PROPERTIES, True) |
|
247 |
self.FileMenu.Enable(wx.ID_CLOSE_ALL, True) |
|
248 |
self.FileMenu.Enable(wx.ID_SAVEAS, True) |
|
249 |
MenuToolBar.EnableTool(wx.ID_SAVEAS, True) |
|
250 |
self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUGENERATE, True) |
|
251 |
else: |
|
252 |
self.FileMenu.Enable(wx.ID_CLOSE, False) |
|
253 |
self.FileMenu.Enable(wx.ID_PAGE_SETUP, False) |
|
254 |
self.FileMenu.Enable(wx.ID_PREVIEW, False) |
|
255 |
self.FileMenu.Enable(wx.ID_PRINT, False) |
|
256 |
MenuToolBar.EnableTool(wx.ID_PRINT, False) |
|
257 |
self.FileMenu.Enable(wx.ID_SAVE, False) |
|
258 |
MenuToolBar.EnableTool(wx.ID_SAVE, False) |
|
259 |
self.FileMenu.Enable(wx.ID_PROPERTIES, False) |
|
260 |
self.FileMenu.Enable(wx.ID_CLOSE_ALL, False) |
|
261 |
self.FileMenu.Enable(wx.ID_SAVEAS, False) |
|
262 |
MenuToolBar.EnableTool(wx.ID_SAVEAS, False) |
|
263 |
self.FileMenu.Enable(ID_PLCOPENEDITORFILEMENUGENERATE, False) |
|
264 |
||
265 |
def OnNewProjectMenu(self, event): |
|
266 |
if self.Controler is not None and not self.CheckSaveBeforeClosing(): |
|
267 |
return |
|
268 |
dialog = ProjectDialog(self) |
|
269 |
if dialog.ShowModal() == wx.ID_OK: |
|
270 |
properties = dialog.GetValues() |
|
271 |
self.ResetView() |
|
272 |
self.Controler = PLCControler() |
|
273 |
self.Controler.CreateNewProject(properties) |
|
274 |
self.LibraryPanel.SetController(self.Controler) |
|
1295
2ad168756c5e
Fixed bug no contextual menu displayed in left panel tree when creating new project
Laurent Bessard
parents:
1030
diff
changeset
|
275 |
self.ProjectTree.Enable(True) |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
276 |
self._Refresh(TITLE, FILEMENU, EDITMENU, PROJECTTREE, POUINSTANCEVARIABLESPANEL, |
814 | 277 |
LIBRARYTREE) |
278 |
||
279 |
def OnOpenProjectMenu(self, event): |
|
280 |
if self.Controler is not None and not self.CheckSaveBeforeClosing(): |
|
281 |
return |
|
282 |
filepath = "" |
|
283 |
if self.Controler is not None: |
|
284 |
filepath = self.Controler.GetFilePath() |
|
285 |
if filepath != "": |
|
286 |
directory = os.path.dirname(filepath) |
|
287 |
else: |
|
288 |
directory = os.getcwd() |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
289 |
|
814 | 290 |
result = None |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
291 |
|
814 | 292 |
dialog = wx.FileDialog(self, _("Choose a file"), directory, "", _("PLCOpen files (*.xml)|*.xml|All files|*.*"), wx.OPEN) |
293 |
if dialog.ShowModal() == wx.ID_OK: |
|
294 |
filepath = dialog.GetPath() |
|
295 |
if os.path.isfile(filepath): |
|
296 |
self.ResetView() |
|
297 |
controler = PLCControler() |
|
298 |
result = controler.OpenXMLFile(filepath) |
|
1330
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
299 |
self.Controler = controler |
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
300 |
self.LibraryPanel.SetController(controler) |
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
301 |
self.ProjectTree.Enable(True) |
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
302 |
self.PouInstanceVariablesPanel.SetController(controler) |
96b242e4c59d
Added support for loading XML file even if not following XSD schema (but still following XML syntax), warning user of errors in XML file
Laurent Bessard
parents:
1312
diff
changeset
|
303 |
self._Refresh(PROJECTTREE, LIBRARYTREE) |
814 | 304 |
self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU) |
305 |
dialog.Destroy() |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
306 |
|
814 | 307 |
if result is not None: |
1581
2295fdc5c271
fix translation strings with multiple parameters
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1580
diff
changeset
|
308 |
(num, line) = result |
2295fdc5c271
fix translation strings with multiple parameters
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1580
diff
changeset
|
309 |
self.ShowErrorMessage(_("PLC syntax error at line {a1}:\n{a2}").format(a1 = num, a2 = line)) |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
310 |
|
814 | 311 |
def OnCloseProjectMenu(self, event): |
312 |
if not self.CheckSaveBeforeClosing(): |
|
313 |
return |
|
314 |
self.ResetView() |
|
315 |
self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU) |
|
316 |
||
317 |
def OnSaveProjectMenu(self, event): |
|
318 |
self.SaveProject() |
|
319 |
||
320 |
def OnSaveProjectAsMenu(self, event): |
|
321 |
self.SaveProjectAs() |
|
322 |
||
323 |
def OnGenerateProgramMenu(self, event): |
|
324 |
dialog = wx.FileDialog(self, _("Choose a file"), os.getcwd(), self.Controler.GetProgramFilePath(), _("ST files (*.st)|*.st|All files|*.*"), wx.SAVE|wx.CHANGE_DIR) |
|
325 |
if dialog.ShowModal() == wx.ID_OK: |
|
326 |
filepath = dialog.GetPath() |
|
327 |
message_text = "" |
|
328 |
header, icon = _("Done"), wx.ICON_INFORMATION |
|
329 |
if os.path.isdir(os.path.dirname(filepath)): |
|
330 |
program, errors, warnings = self.Controler.GenerateProgram(filepath) |
|
1312
250c3ae0787c
Fixed bug when printing program generating errors and warnings in PLCOpenEditor
Laurent Bessard
parents:
1295
diff
changeset
|
331 |
message_text += "".join([_("warning: %s\n") % warning for warning in warnings]) |
814 | 332 |
if len(errors) > 0: |
1312
250c3ae0787c
Fixed bug when printing program generating errors and warnings in PLCOpenEditor
Laurent Bessard
parents:
1295
diff
changeset
|
333 |
message_text += "".join([_("error: %s\n") % error for error in errors]) |
814 | 334 |
message_text += _("Can't generate program to file %s!")%filepath |
335 |
header, icon = _("Error"), wx.ICON_ERROR |
|
336 |
else: |
|
337 |
message_text += _("Program was successfully generated!") |
|
338 |
else: |
|
339 |
message_text += _("\"%s\" is not a valid folder!")%os.path.dirname(filepath) |
|
340 |
header, icon = _("Error"), wx.ICON_ERROR |
|
341 |
message = wx.MessageDialog(self, message_text, header, wx.OK|icon) |
|
342 |
message.ShowModal() |
|
343 |
message.Destroy() |
|
344 |
dialog.Destroy() |
|
345 |
||
346 |
def OnPLCOpenEditorMenu(self, event): |
|
347 |
wx.MessageBox(_("No documentation available.\nComing soon.")) |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
348 |
|
814 | 349 |
def OnPLCOpenMenu(self, event): |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
350 |
open_pdf(os.path.join(beremiz_dir, "plcopen", "TC6_XML_V101.pdf")) |
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
351 |
|
814 | 352 |
def OnAboutMenu(self, event): |
1565
894f31f8ca64
make about dialog boxes use standard wx about dialogs
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1560
diff
changeset
|
353 |
info = version.GetAboutDialogInfo() |
894f31f8ca64
make about dialog boxes use standard wx about dialogs
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1560
diff
changeset
|
354 |
info.Name = "PLCOpenEditor" |
894f31f8ca64
make about dialog boxes use standard wx about dialogs
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1560
diff
changeset
|
355 |
info.Description = _("PLCOpenEditor is part of Beremiz project.\n\n" |
894f31f8ca64
make about dialog boxes use standard wx about dialogs
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1560
diff
changeset
|
356 |
"Beremiz is an ") + info.Description |
894f31f8ca64
make about dialog boxes use standard wx about dialogs
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1560
diff
changeset
|
357 |
info.Icon = wx.Icon(os.path.join(beremiz_dir, "images", "aboutlogo.png"), wx.BITMAP_TYPE_PNG) |
894f31f8ca64
make about dialog boxes use standard wx about dialogs
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1560
diff
changeset
|
358 |
ShowAboutDialog(self, info) |
814 | 359 |
|
360 |
def SaveProject(self): |
|
361 |
result = self.Controler.SaveXMLFile() |
|
362 |
if not result: |
|
363 |
self.SaveProjectAs() |
|
364 |
else: |
|
365 |
self._Refresh(TITLE, FILEMENU, PAGETITLES) |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
366 |
|
814 | 367 |
def SaveProjectAs(self): |
368 |
filepath = self.Controler.GetFilePath() |
|
369 |
if filepath != "": |
|
370 |
directory, filename = os.path.split(filepath) |
|
371 |
else: |
|
372 |
directory, filename = os.getcwd(), "%(projectName)s.xml"%self.Controler.GetProjectProperties() |
|
373 |
dialog = wx.FileDialog(self, _("Choose a file"), directory, filename, _("PLCOpen files (*.xml)|*.xml|All files|*.*"), wx.SAVE|wx.OVERWRITE_PROMPT) |
|
374 |
if dialog.ShowModal() == wx.ID_OK: |
|
375 |
filepath = dialog.GetPath() |
|
376 |
if os.path.isdir(os.path.dirname(filepath)): |
|
377 |
result = self.Controler.SaveXMLFile(filepath) |
|
378 |
if not result: |
|
379 |
self.ShowErrorMessage(_("Can't save project to file %s!")%filepath) |
|
380 |
else: |
|
381 |
self.ShowErrorMessage(_("\"%s\" is not a valid folder!")%os.path.dirname(filepath)) |
|
382 |
self._Refresh(TITLE, FILEMENU, PAGETITLES) |
|
383 |
dialog.Destroy() |
|
384 |
||
385 |
#------------------------------------------------------------------------------- |
|
386 |
# Exception Handler |
|
387 |
#------------------------------------------------------------------------------- |
|
388 |
||
389 |
Max_Traceback_List_Size = 20 |
|
390 |
||
391 |
def Display_Exception_Dialog(e_type,e_value,e_tb): |
|
392 |
trcbck_lst = [] |
|
393 |
for i,line in enumerate(traceback.extract_tb(e_tb)): |
|
394 |
trcbck = " " + str(i+1) + _(". ") |
|
395 |
if line[0].find(os.getcwd()) == -1: |
|
396 |
trcbck += _("file : ") + str(line[0]) + _(", ") |
|
397 |
else: |
|
398 |
trcbck += _("file : ") + str(line[0][len(os.getcwd()):]) + _(", ") |
|
399 |
trcbck += _("line : ") + str(line[1]) + _(", ") + _("function : ") + str(line[2]) |
|
400 |
trcbck_lst.append(trcbck) |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
401 |
|
814 | 402 |
# Allow clicking.... |
403 |
cap = wx.Window_GetCapture() |
|
404 |
if cap: |
|
405 |
cap.ReleaseMouse() |
|
406 |
||
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
407 |
dlg = wx.SingleChoiceDialog(None, |
814 | 408 |
_(""" |
1580
f37b88d3edc6
change bug report address for PLCOpenEditor to beremiz-devel@lists.sourceforge.net
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1571
diff
changeset
|
409 |
An unhandled exception (bug) occured. Bug report saved at : |
f37b88d3edc6
change bug report address for PLCOpenEditor to beremiz-devel@lists.sourceforge.net
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1571
diff
changeset
|
410 |
(%s) |
814 | 411 |
|
412 |
Please be kind enough to send this file to: |
|
1580
f37b88d3edc6
change bug report address for PLCOpenEditor to beremiz-devel@lists.sourceforge.net
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1571
diff
changeset
|
413 |
beremiz-devel@lists.sourceforge.net |
f37b88d3edc6
change bug report address for PLCOpenEditor to beremiz-devel@lists.sourceforge.net
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1571
diff
changeset
|
414 |
|
f37b88d3edc6
change bug report address for PLCOpenEditor to beremiz-devel@lists.sourceforge.net
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1571
diff
changeset
|
415 |
You should now restart program. |
f37b88d3edc6
change bug report address for PLCOpenEditor to beremiz-devel@lists.sourceforge.net
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1571
diff
changeset
|
416 |
|
f37b88d3edc6
change bug report address for PLCOpenEditor to beremiz-devel@lists.sourceforge.net
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1571
diff
changeset
|
417 |
Traceback: |
f37b88d3edc6
change bug report address for PLCOpenEditor to beremiz-devel@lists.sourceforge.net
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1571
diff
changeset
|
418 |
""") % bug_report_path + |
f37b88d3edc6
change bug report address for PLCOpenEditor to beremiz-devel@lists.sourceforge.net
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1571
diff
changeset
|
419 |
repr(e_type) + " : " + repr(e_value), |
814 | 420 |
_("Error"), |
421 |
trcbck_lst) |
|
422 |
try: |
|
423 |
res = (dlg.ShowModal() == wx.ID_OK) |
|
424 |
finally: |
|
425 |
dlg.Destroy() |
|
426 |
||
427 |
return res |
|
428 |
||
429 |
def Display_Error_Dialog(e_value): |
|
430 |
message = wx.MessageDialog(None, str(e_value), _("Error"), wx.OK|wx.ICON_ERROR) |
|
431 |
message.ShowModal() |
|
432 |
message.Destroy() |
|
433 |
||
434 |
def get_last_traceback(tb): |
|
435 |
while tb.tb_next: |
|
436 |
tb = tb.tb_next |
|
437 |
return tb |
|
438 |
||
439 |
||
440 |
def format_namespace(d, indent=' '): |
|
441 |
return '\n'.join(['%s%s: %s' % (indent, k, repr(v)[:10000]) for k, v in d.iteritems()]) |
|
442 |
||
443 |
||
444 |
ignored_exceptions = [] # a problem with a line in a module is only reported once per session |
|
445 |
||
446 |
def AddExceptHook(path, app_version='[No version]'):#, ignored_exceptions=[]): |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
447 |
|
814 | 448 |
def handle_exception(e_type, e_value, e_traceback): |
449 |
traceback.print_exception(e_type, e_value, e_traceback) # this is very helpful when there's an exception in the rest of this func |
|
450 |
last_tb = get_last_traceback(e_traceback) |
|
451 |
ex = (last_tb.tb_frame.f_code.co_filename, last_tb.tb_frame.f_lineno) |
|
452 |
if str(e_value).startswith("!!!"): |
|
453 |
Display_Error_Dialog(e_value) |
|
454 |
elif ex not in ignored_exceptions: |
|
455 |
result = Display_Exception_Dialog(e_type,e_value,e_traceback) |
|
456 |
if result: |
|
457 |
ignored_exceptions.append(ex) |
|
458 |
info = { |
|
459 |
'app-title' : wx.GetApp().GetAppName(), # app_title |
|
460 |
'app-version' : app_version, |
|
461 |
'wx-version' : wx.VERSION_STRING, |
|
462 |
'wx-platform' : wx.Platform, |
|
463 |
'python-version' : platform.python_version(), #sys.version.split()[0], |
|
464 |
'platform' : platform.platform(), |
|
465 |
'e-type' : e_type, |
|
466 |
'e-value' : e_value, |
|
467 |
'date' : time.ctime(), |
|
468 |
'cwd' : os.getcwd(), |
|
469 |
} |
|
470 |
if e_traceback: |
|
471 |
info['traceback'] = ''.join(traceback.format_tb(e_traceback)) + '%s: %s' % (e_type, e_value) |
|
472 |
last_tb = get_last_traceback(e_traceback) |
|
473 |
exception_locals = last_tb.tb_frame.f_locals # the locals at the level of the stack trace where the exception actually occurred |
|
474 |
info['locals'] = format_namespace(exception_locals) |
|
475 |
if 'self' in exception_locals: |
|
476 |
info['self'] = format_namespace(exception_locals['self'].__dict__) |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
477 |
|
814 | 478 |
output = open(path+os.sep+"bug_report_"+info['date'].replace(':','-').replace(' ','_')+".txt",'w') |
479 |
lst = info.keys() |
|
480 |
lst.sort() |
|
481 |
for a in lst: |
|
482 |
output.write(a+":\n"+str(info[a])+"\n\n") |
|
483 |
||
484 |
#sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args) |
|
485 |
sys.excepthook = handle_exception |
|
486 |
||
487 |
if __name__ == '__main__': |
|
1533
aca8f43483e9
fix issues in PLCOpenEditor with moving from wxWidgets 2.8 to 3.0
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1492
diff
changeset
|
488 |
if wx.VERSION < (3, 0, 0): |
aca8f43483e9
fix issues in PLCOpenEditor with moving from wxWidgets 2.8 to 3.0
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1492
diff
changeset
|
489 |
wx.InitAllImageHandlers() |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
490 |
|
814 | 491 |
# Install a exception handle for bug reports |
1560
4ce8492159ab
add version with commit hash to 'About' dialogs for Beremiz IDE and PLCOpenEditor
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents:
1533
diff
changeset
|
492 |
AddExceptHook(os.getcwd(), version.app_version) |
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
493 |
|
814 | 494 |
frame = PLCOpenEditor(None, fileOpen=fileOpen) |
495 |
||
496 |
frame.Show() |
|
497 |
app.MainLoop() |
|
1451
94e620cbd9de
Added Ronan Bignaux (genesis) patch to use wxversion. Fixed side effects with sys.path. Other cosmetic fixes about path included.
Edouard Tisserant
parents:
1388
diff
changeset
|
498 |