From 68ea7237ce6269849a52f182c3fdf85fcac5d323 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 4 Jun 2013 16:10:17 +0000 Subject: [PATCH] Py3 and Phoenix fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wx/lib/inspection.py | 5 +++-- wx/py/filling.py | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/wx/lib/inspection.py b/wx/lib/inspection.py index 1c7f0f79..65bf491c 100644 --- a/wx/lib/inspection.py +++ b/wx/lib/inspection.py @@ -9,7 +9,7 @@ # Copyright: (c) 2007 by Total Control Software # Licence: wxWindows license # -# Tags: phoenix-port, documented +# Tags: py3-port, phoenix-port, documented #---------------------------------------------------------------------------- # NOTE: This class was originally based on ideas sent to the @@ -28,6 +28,7 @@ import wx.py import wx.stc #import wx.aui as aui import wx.lib.agw.aui as aui +import wx.lib.six as six import wx.lib.utils as utils import sys import inspect @@ -627,7 +628,7 @@ class InspectionInfoPanel(wx.stc.StyledTextCtrl): def Fmt(self, name, value): - if isinstance(value, (str, unicode)): + if isinstance(value, six.string_types): return " %s = '%s'" % (name, value) else: return " %s = %s" % (name, value) diff --git a/wx/py/filling.py b/wx/py/filling.py index 0a216f7b..d2923186 100644 --- a/wx/py/filling.py +++ b/wx/py/filling.py @@ -111,10 +111,10 @@ class FillingTree(wx.TreeCtrl): def objGetChildren(self, obj): """Return dictionary with attributes or contents of object.""" - busy = wx.BusyCursor() otype = type(obj) - if isinstance(obj, dict) \ - or 'BTrees' in six.text_type(type(obj)) and hasattr(obj, 'keys')) \: + if (isinstance(obj, dict) + or 'BTrees' in six.text_type(otype) + and hasattr(obj, 'keys')): return obj d = {} if isinstance(obj, (list, tuple)): @@ -209,8 +209,8 @@ class FillingTree(wx.TreeCtrl): # and first level children of a namepace. if (isinstance(obj, dict) or 'BTrees' in six.text_type(type(obj)) - and hasattr(obj, 'keys')) \ - and ((item != self.root and parent != self.root) + and hasattr(obj, 'keys') + and (item != self.root and parent != self.root) or (parent == self.root and not self.rootIsNamespace)): name = '[' + name + ']' # Apply dot syntax to multipart names.