[xiph-commits] r2936 - cmmlwiki/trunk/cmmlwiki

shans at svn.annodex.net shans at svn.annodex.net
Thu Jun 14 17:33:16 PDT 2007


Author: shans
Date: 2007-06-14 17:33:12 -0700 (Thu, 14 Jun 2007)
New Revision: 2936

Modified:
   cmmlwiki/trunk/cmmlwiki/play.py
Log:
Added descriptions to CMML tag output.  Note that this won't work with any
current version of pyannodex.  The following patch to pyannodex will enable 
this functionality:

=== modified file 'src/py_anx.c'
--- old/src/py_anx.c    2006-08-27 08:15:01 +0000
+++ new/src/py_anx.c    2007-06-14 07:13:24 +0000
@@ -298,6 +298,20 @@
 }
 
 static void
+pydesc_to_clip(PyObject *pydesc, AnxClip *clip)
+{
+  PyObject *cdata;
+
+  if (pydesc == NULL) return;
+  
+  cdata = get_object(pydesc, "cdata");
+  if (PyString_Check(cdata)) {
+    clip->desc_text = PyString_AsString(cdata);
+  }
+  Py_DECREF(pydesc);
+}
+
+static void
 pyclip_to_clip(PyObject *pyclip, AnxClip *clip)
{
        /* Set the clip structure properly */
@@ -310,7 +324,7 @@
        /* Img */

        /* Desc */
-
+  pydesc_to_clip(get_object(pyclip, "desc"), clip);
        /* Meta */
 }



Modified: cmmlwiki/trunk/cmmlwiki/play.py
===================================================================
--- cmmlwiki/trunk/cmmlwiki/play.py	2007-06-14 09:21:07 UTC (rev 2935)
+++ cmmlwiki/trunk/cmmlwiki/play.py	2007-06-15 00:33:12 UTC (rev 2936)
@@ -58,8 +58,10 @@
 
     inspector.cur.execute(sql)
     for row in inspector.cur.fetchall():
-        clip = annodex.Clip(anchor=annodex.Anchor(text="%(clips.a_text)s" % row,
-                                                  href="%(clips.a_href)s" % row))
+        clip = annodex.Clip(anchor=annodex.Anchor(
+                        text="%(clips.a_text)s" % row,
+                        href="%(clips.a_href)s" % row), 
+                        desc=annodex.Desc(desc="%(clips.desc)s" % row))
         anx.insert(clip, row['clips.start_time']);
 
     # Generate Annodex media



More information about the commits mailing list