X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpython%2Ftaglist.c;h=44d5c239dd845c886b3c384d49331e5aa3622225;hb=d9e7b27c4c906d5962d53cc00b060c48ddb1b5e3;hp=d606ab3a8d17e02e561f32a5ecb169b4fe254239;hpb=3477d799207e51e1cde8d1d8792ae838cc1f2835;p=swftools.git diff --git a/lib/python/taglist.c b/lib/python/taglist.c index d606ab3..44d5c23 100644 --- a/lib/python/taglist.c +++ b/lib/python/taglist.c @@ -77,6 +77,13 @@ PyObject * taglist_new2(TAG*tag) TAG* taglist_getTAGs(PyObject*self) { PyObject* tagmap = tagmap_new(); + TAG* tag = taglist_getTAGs2(self, tagmap, 1); + Py_DECREF(tagmap); + return tag; +} +//---------------------------------------------------------------------------- +TAG* taglist_getTAGs2(PyObject*self, PyObject*tagmap, int addDependencies) +{ if(!PY_CHECK_TYPE(self,&TagListClass)) { PyErr_SetString(PyExc_Exception, setError("Not a taglist (%08x).", self)); return 0; @@ -92,16 +99,30 @@ TAG* taglist_getTAGs(PyObject*self) mylog(" %08x(%d) taglist_getTAGs", (int)self, self->ob_refcnt); for(t=0;ttaglist, t); - tag = tag_getTAG(item, tag, tagmap); - if(!tag) { - //pass through errors - Py_DECREF(tagmap); - return 0; + if(addDependencies) { + PyObject* deps = tag_getDependencies(item); + int l = PyList_Size(deps); + int t; + for(t=0;tob_refcnt, list, list->ob_refcnt); if (PyArg_Parse(list, "O!", &TagClass, &tag)) { - list = tag_getDependencies(tag); - int l = PyList_Size(list); - int t; - for(t=0;tob_refcnt, tag, tag->ob_refcnt); PyList_Append(taglist->taglist, tag);