Browse Source

we could handle rtsp, but we didn't update canHandle to know

what to do with them...  with this change rtsp objects are now
exported...  we had to add a rtpmimetype element so we would know
which base class to create..

[git-p4: depot-paths = "//depot/": change = 1575]
main
John-Mark Gurney 14 years ago
parent
commit
e54fdcf568
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      item.py

+ 9
- 1
item.py View File

@@ -70,7 +70,14 @@ def canHandle(fobj):
dom = xml.dom.minidom.parse(fobj)
#print 'ch:', `dom`
obj = dom.getElementsByTagName('Object')[0]
mt = getElementText(obj.getElementsByTagName('mimetype')[0])
mtel = obj.getElementsByTagName('mimetype')
rtpel = obj.getElementsByTagName('rtpmimetype')
if mtel:
mt = getElementText(mtel[0])
elif rtpel:
mt = getElementText(rtpel[0])
else:
raise ValueError('failed to find mimetpe or rtppayloadtype')

#print 'ch:', `obj`, `mt`

@@ -87,6 +94,7 @@ def detectitem(path, fobj):

klass, mt = FileDIDL.buildClassMT(ItemObject, path, mimetype=mt)

#print 'match:', `klass`, `mt`
return klass, { 'path': path, 'dom': dom }

registerklassfun(detectitem)

Loading…
Cancel
Save