[xiph-commits] r3229 - arkaiv/trunk/arkaiv/controllers
dcrowdy at svn.annodex.net
dcrowdy at svn.annodex.net
Mon Sep 10 05:26:17 PDT 2007
Author: dcrowdy
Date: 2007-09-10 05:26:16 -0700 (Mon, 10 Sep 2007)
New Revision: 3229
Modified:
arkaiv/trunk/arkaiv/controllers/page.py
arkaiv/trunk/arkaiv/controllers/page.pyc
Log:
Implemented addition of tags in a source ogg file (using vorbiscomment) as meta tags in the cmml file.
Modified: arkaiv/trunk/arkaiv/controllers/page.py
===================================================================
--- arkaiv/trunk/arkaiv/controllers/page.py 2007-09-07 13:39:16 UTC (rev 3228)
+++ arkaiv/trunk/arkaiv/controllers/page.py 2007-09-10 12:26:16 UTC (rev 3229)
@@ -16,6 +16,7 @@
import annodex
import logging
import subprocess
+import sys
from string import split
from socket import *
from arkaiv.controllers import *
@@ -430,9 +431,6 @@
parser.updatesourcetag(newoggname)
parser.addmetaid(newitemid)
- # Once the meta tag addition has been added to pyannodex, this stuff
- # can be replaced.
-
headinfo = {}
headinfo['itemid']= newitemid
headinfo['id'] = ""
@@ -463,10 +461,33 @@
model.addclip(clipdict)
#print cliplist
- # Extract meta info from the head and add to database
+
+ # Check whether the ogg file has any existing vorbis comments/tags
+ # and import them as meta tags
+
+ #metalist=[]
+
parser = cmmlParser()
parser.setcmmlfilename(newcmmlname)
metalist = parser.getheadinfofromcmml()
+
+ cmd = "vorbiscomment -l " + newoggname
+ runit = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE , stderr=subprocess.PIPE)
+ out, err = runit.communicate()
+
+ for line in out.splitlines():
+ metadict={}
+ print line
+ tag = line.split("=")
+ metadict['name'] = tag[0]
+ metadict['content'] = tag[1]
+ metadict['id'] = tag[0]
+ metadict['scheme'] = ""
+ metalist.append(metadict)
+
+ # Extract meta info from the head and add to database
+
+
for metadict in metalist:
metadict['headindex'] = headid
metadict['itemid'] = newitemid
@@ -687,3 +708,4 @@
return url
+
Modified: arkaiv/trunk/arkaiv/controllers/page.pyc
===================================================================
(Binary files differ)
More information about the commits
mailing list