// First, make a new instance of the tag handler
wxPyBeginBlockThreads();
- PyObject* arg = Py_BuildValue("()");
- PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL);
+ PyObject* arg = PyTuple_New(0);
+ PyObject* obj = PyObject_CallObject(m_tagHandlerClass, arg);
Py_DECREF(arg);
- wxPyEndBlockThreads();
-
+
// now figure out where it's C++ object is...
wxPyHtmlWinTagHandler* thPtr;
- if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler")))
+ if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) {
+ wxPyEndBlockThreads();
return;
+ }
+ wxPyEndBlockThreads();
// add it,
parser->AddTagHandler(thPtr);
// First, make a new instance of the tag handler
wxPyBeginBlockThreads();
- PyObject* arg = Py_BuildValue("()");
- PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL);
+ PyObject* arg = PyTuple_New(0);
+ PyObject* obj = PyObject_CallObject(m_tagHandlerClass, arg);
Py_DECREF(arg);
- wxPyEndBlockThreads();
-
+
// now figure out where it's C++ object is...
wxPyHtmlWinTagHandler* thPtr;
- if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler")))
+ if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) {
+ wxPyEndBlockThreads();
return;
+ }
+ wxPyEndBlockThreads();
// add it,
parser->AddTagHandler(thPtr);
class wxpTagHandler(wxHtmlWinTagHandler):
def __init__(self):
+ print 'wxpTagHandler'
wxHtmlWinTagHandler.__init__(self)
self.ctx = None
def GetSupportedTags(self):
+ print 'wxpTagHandler.GetSupportedTags'
return WXPTAG+','+PARAMTAG
def HandleTag(self, tag):
+ print 'wxpTagHandler.HandleTag'
name = tag.GetName()
if name == WXPTAG:
return self.HandleWxpTag(tag)
className = tag.GetParam('CLASS')
self.ctx.classObj = getattr(self.ctx.classMod, className)
- if type(self.ctx.classObj) != types.ClassType:
+ if type(self.ctx.classObj) not in [ types.ClassType, types.TypeType]:
raise TypeError, "WXP tag attribute CLASS must name a class"
# now look for width and height