[cvs-annodex] commit (/annodex): cmmlwiki/trunk/view.cgi

conrad nobody at lists.annodex.net
Fri Apr 15 11:27:05 EST 2005


Update of /annodex (new revision 1257)

Modified files:
   cmmlwiki/trunk/view.cgi

Log Message:
add <link rel="edit" /> tag
(why the hell didn't i commit this on wendesday?)


Modified: cmmlwiki/trunk/view.cgi
===================================================================
--- cmmlwiki/trunk/view.cgi	2005-04-14 13:51:57 UTC (rev 1256)
+++ cmmlwiki/trunk/view.cgi	2005-04-15 01:27:00 UTC (rev 1257)
@@ -12,6 +12,8 @@
 preamble = """<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 """
 
+edit_base = "/cmmlwiki/edit"
+
 def content_type (ct):
     print "Content-Type: %s\n" % ct
     sys.stdout.flush()
@@ -77,7 +79,7 @@
     #for row in cur.fetchall():
     #    clip = annodex.Clip(anchor=annodex.Anchor(text="%(a_href)s" % row,
     #                                              href="%(a_href)s" % row))
-    #    anx.insert(clip, row['start_time']);
+    #    anx.insert(clip, npt2timestamp(row['start_time']));
 
     # Generate Annodex media
     while 1:
@@ -86,7 +88,7 @@
             break
 
 
-def make_cmml(ixp):
+def make_cmml(ixp, project_name):
     def key_isprintable (dict, key):
         return (dict.has_key(key) and dict[key] != None and dict[key] != '')
 
@@ -100,9 +102,11 @@
 
     print """<cmml>
 <head>
-<title>CMML Wiki</title>
+<title>%s - CMML Wiki</title>
+<link rel="edit" href="%s/%s" />
 </head>
-"""
+""" % (project_name, edit_base, project_name)
+#""" % project_name
   
     con = sqlite.connect(db)
     cur = con.cursor()
@@ -132,8 +136,7 @@
 </cmml>
 """
 
-def get_ixp(path_info):
-    project_name = path_info[1:]
+def get_ixp(project_name):
     con = sqlite.connect(db)
     cur = con.cursor()
     sql = 'SELECT * FROM projects WHERE name="%s"' % project_name
@@ -165,10 +168,11 @@
       t = 0.0
 
     path_info = os.getenv ('PATH_INFO')
-    ixp = get_ixp (path_info)
+    project_name = path_info[1:]
+    ixp = get_ixp (project_name)
 
     if (accept == "text/x-cmml"):
-      make_cmml(ixp)
+      make_cmml(ixp, project_name)
     else:
       anxenc (ixp, id, t)
 


-- 
conrad



More information about the cvs-annodex mailing list