X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b881fc787d2823bdd8a415080b82feee90804a17..d5301e336fe89f2962c93ff60d69c25ea81dc355:/wxPython/wx/lib/wxpTag.py diff --git a/wxPython/wx/lib/wxpTag.py b/wxPython/wx/lib/wxpTag.py index e6d72dade3..65e1b58ad2 100644 --- a/wxPython/wx/lib/wxpTag.py +++ b/wxPython/wx/lib/wxpTag.py @@ -35,11 +35,11 @@ Tags of the following form are recognised: where modulename is the name of a module (possibly in package notation) to import and classname is the name of a class in that module to create an instance of. If the module tag-attribute is not -given or is an empty string, then wxPython.wx is used. The width and -height attributes are expected to be integers and will be passed to -the __init__ method of the class as a wxSize object named size. -However, if the width attribute ends with the percent (%) symbol then -the value will be used as a percentage of the available width and the +given or is an empty string, then wx is used. The width and height +attributes are expected to be integers and will be passed to the +__init__ method of the class as a wxSize object named size. However, +if the width attribute ends with the percent (%) symbol then the value +will be used as a percentage of the available width and the wxHtmlWindow will manage the size. The name-value pairs in all the nested PARAM tags are packaged up as @@ -195,7 +195,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 +203,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 +212,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