Py3 related fixes for SVGHMI UI.
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Wed, 31 May 2023 17:06:03 +0200
changeset 3818 e528b11a60cc
parent 3817 3deeda82636a
child 3819 4582f0fcf4c4
Py3 related fixes for SVGHMI UI.
docutil/docsvg.py
svghmi/ui.py
--- a/docutil/docsvg.py	Wed May 31 10:40:53 2023 +0200
+++ b/docutil/docsvg.py	Wed May 31 17:06:03 2023 +0200
@@ -77,7 +77,7 @@
     if inkpath is None:
         return None
     return list(map(int, 
-        subprocess.check_output([inkpath,"--version"]).split()[1].split('.')))
+        subprocess.check_output([inkpath,"--version"]).split()[1].split(b'.')))
 
 _inkscape_version = None
 def get_inkscape_version():
--- a/svghmi/ui.py	Wed May 31 10:40:53 2023 +0200
+++ b/svghmi/ui.py	Wed May 31 17:06:03 2023 +0200
@@ -335,7 +335,7 @@
         self.main_sizer.AddGrowableCol(0)
         self.main_sizer.AddGrowableRow(2)
 
-        self.staticmsg = wx.StaticText(self, label = _("Drag selected Widget from here to Inkscape"))
+        self.staticmsg = wx.StaticText(self.main_panel, label = _("Drag selected Widget from here to Inkscape"))
         self.preview = wx.Panel(self.main_panel, size=(-1, _preview_height + _preview_margin*2))
         self.signature_sizer = wx.BoxSizer(wx.VERTICAL)
         self.args_box = wx.StaticBox(self.main_panel, -1,
@@ -436,7 +436,7 @@
             # Get Preview panel size
             sz = self.preview.GetClientSize()
             w = self.bmp.GetWidth()
-            dc.DrawBitmap(self.bmp, (sz.width - w)/2, _preview_margin)
+            dc.DrawBitmap(self.bmp, (sz.width - w)//2, _preview_margin)
 
 
 
@@ -475,9 +475,7 @@
         status, result, _err_result = ProcessLogger(
             #self.Controler.GetCTRoot().logger,
             None,
-            '"' + inkpath + '" "' + svgpath + '" ' +
-            export_opt + ' "' + thumbpath +
-            '" -D -h ' + str(_preview_height)).spin()
+            [ inkpath, svgpath, export_opt, thumbpath, "-D", "-h", str(_preview_height)]).spin()
         if status != 0:
             self.msg = _("Inkscape couldn't generate thumbnail.")
             return False