add docutils in svgui plugins to launch inkscape
authorgreg
Mon, 20 Oct 2008 13:04:10 +0200
changeset 260 038eff285e00
parent 259 f527d1c3f630
child 261 5299c6746fa8
add docutils in svgui plugins to launch inkscape
fix bug in Beremiz.py when open project without buildpath
Beremiz.py
plugins/svgui/svgui.py
--- a/Beremiz.py	Fri Oct 17 14:44:41 2008 +0200
+++ b/Beremiz.py	Mon Oct 20 13:04:10 2008 +0200
@@ -55,6 +55,7 @@
         sys.exit()
     elif len(args) == 1:
         projectOpen = args[0]
+        buildpath = None
     elif len(args) == 2:
         projectOpen = args[0]
         buildpath = args[1]
--- a/plugins/svgui/svgui.py	Fri Oct 17 14:44:41 2008 +0200
+++ b/plugins/svgui/svgui.py	Mon Oct 20 13:04:10 2008 +0200
@@ -3,7 +3,7 @@
 sys.path.append(os.path.join(base_folder, "wxsvg", "SVGUIEditor"))
 sys.path.append(os.path.join(base_folder, "plcopeneditor", "graphics"))
 
-import wx
+import wx, subprocess
 
 from SVGUIGenerator import *
 from SVGUIControler import *
@@ -11,8 +11,8 @@
 from FBD_Objects import *
 
 from wxPopen import ProcessLogger
-import subprocess
 from wx.wxsvg import SVGDocument
+from docutils import *
 
 [ID_SVGUIEDITORFBDPANEL, 
 ] = [wx.NewId() for _init_ctrls in range(1)]
@@ -167,18 +167,10 @@
 
     def _StartInkscape(self):
         if not self._View:
-            svgfile = os.path.join(self.PlugPath(), "gui.svg")
-            popenargs = []
-
-            if wx.Platform == '__WXMSW__':
-                popenargs.append(os.path.join(base_folder, "Inkscape", "inkscape.exe"))
-            else:
-                popenargs.append("/usr/bin/inkscape")
-
-            if os.path.isfile(svgfile):
-                popenargs.append(svgfile)
-
-            subprocess.Popen(popenargs).pid
+		svgfile = os.path.join(self.PlugPath(), "gui.svg")		
+		if not os.path.isfile(svgfile):
+		    svgfile = None
+		open_svg(svgfile)
 
     PluginMethods = [
         {"bitmap" : os.path.join("images","HMIEditor"),