Some fixes for Py2

This commit is contained in:
Robin Dunn
2019-09-12 11:58:38 -07:00
parent 537c5cec6e
commit 9658a8c426
4 changed files with 1314 additions and 1200 deletions

View File

@@ -1,6 +1,9 @@
import sys
import os
import glob
import six
import wx
from wx.svg import SVGimage
@@ -21,6 +24,8 @@ class SVGBitmapDisplay(wx.Panel):
def UpdateSVG(self, svg_filename):
if six.PY2 and isinstance(svg_filename, unicode):
svg_filename = svg_filename.encode(sys.getfilesystemencoding())
img = SVGimage.CreateFromFile(svg_filename)
bmp = img.ConvertToScaledBitmap(self.bmp_size, self)
self.statbmp.SetBitmap(bmp)