X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b881fc787d2823bdd8a415080b82feee90804a17..16541a4ef4c409e27a047f898f9d770bdcfa9f30:/wxPython/wx/lib/wxpTag.py diff --git a/wxPython/wx/lib/wxpTag.py b/wxPython/wx/lib/wxpTag.py index e6d72dade3..d362fb365f 100644 --- a/wxPython/wx/lib/wxpTag.py +++ b/wxPython/wx/lib/wxpTag.py @@ -25,7 +25,7 @@ You don\'t need to use anything in this module directly, just importing it will create the tag handler and add it to any wxHtmlWinParsers created from that time forth. -Tags of the following form are recognised: +Tags of the following form are recognised:: @@ -161,7 +161,7 @@ class wxpTagHandler(wx.html.HtmlWinTagHandler): self.ParseInner(tag) # create the object - parent = self.GetParser().GetWindow() + parent = self.GetParser().GetWindowInterface().GetHTMLWindow() if parent: obj = apply(self.ctx.classObj, (parent,), @@ -169,7 +169,8 @@ class wxpTagHandler(wx.html.HtmlWinTagHandler): obj.Show(True) # add it to the HtmlWindow - self.GetParser().GetContainer().InsertCell(wx.html.HtmlWidgetCell(obj, self.ctx.floatWidth)) + self.GetParser().GetContainer().InsertCell( + wx.html.HtmlWidgetCell(obj, self.ctx.floatWidth)) self.ctx = None return True @@ -195,7 +196,7 @@ class wxpTagHandler(wx.html.HtmlWinTagHandler): # check for something that should be evaluated - elif value[0] in '[{(' or value[:2] == 'wx': + elif value and value[0] in '[{(' or value[:2] == 'wx': saveVal = value try: value = eval(value, self.ctx.classMod.__dict__) @@ -203,7 +204,7 @@ class wxpTagHandler(wx.html.HtmlWinTagHandler): value = saveVal # convert to wx.Colour - elif value[0] == '#': + elif value and value[0] == '#': try: red = int('0x'+value[1:3], 16) green = int('0x'+value[3:5], 16) @@ -212,7 +213,8 @@ class wxpTagHandler(wx.html.HtmlWinTagHandler): except: pass - self.ctx.kwargs[str(name)] = value + if self.ctx: + self.ctx.kwargs[str(name)] = value return False