From ffcc9b8c02b74d7f6fb9f0c56ba50fb4e44e227a Mon Sep 17 00:00:00 2001 From: kramm Date: Sat, 31 Jan 2004 20:05:22 +0000 Subject: [PATCH] some fixes, added "verbose" constant. --- lib/python/SWF.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/lib/python/SWF.c b/lib/python/SWF.c index d11925f..2a5b903 100644 --- a/lib/python/SWF.c +++ b/lib/python/SWF.c @@ -151,6 +151,8 @@ static PyObject* f_load(PyObject* self, PyObject* args) swf->taglist->firstTag = swf->swf.firstTag; swf->taglist->searchTag = swf->swf.firstTag; swf->taglist->lastTag = swf->swf.firstTag; + while(swf->taglist->lastTag->next) + swf->taglist->lastTag = swf->taglist->lastTag->next; swf->taglist->currentID = 1; swf->taglist->char2id = (PyDictObject*)PyDict_New(); swf->taglist->id2char = (PyDictObject*)PyDict_New(); @@ -592,12 +594,14 @@ static PyObject* tag_getattr(PyObject * self, char* a) if(id==tagfunctions[t].id) { mylog("tag_getattr: id %d found\n", id); ret = Py_FindMethod(tagfunctions[t].f, self, a); - break; + if(!ret) return ret; + ret = FindMethodMore(ret, common_tagfunctions, self, a); + mylog("tag_getattr %08x(%d) %s: %08x\n", (int)self, self->ob_refcnt, a, ret); + return ret; } } - - /* search in the functions common to all tags */ - FindMethodMore(ret, common_tagfunctions, self, a); + + ret = Py_FindMethod(common_tagfunctions, self, a); mylog("tag_getattr %08x(%d) %s: %08x\n", (int)self, self->ob_refcnt, a, ret); return ret; @@ -818,8 +822,19 @@ static PyTypeObject TagClass = }; //---------------------------------------------------------------------------- +static PyObject* module_verbose(PyObject* self, PyObject* args) +{ + if (!PyArg_ParseTuple(args,"i", &verbose)) + return NULL; + return Py_BuildValue("s", 0); +} + + static PyMethodDef SWFMethods[] = { + /* Module functions */ + {"verbose", module_verbose, METH_VARARGS, "Set the module verbosity"}, + /* SWF creation*/ {"load", f_load, METH_VARARGS, "Load a SWF from disc."}, {"create", (PyCFunction)f_create, METH_KEYWORDS, "Create a new SWF from scratch."}, -- 1.7.10.4