version 1.18, 2005/04/06 09:18:41
|
version 1.21, 2005/11/25 17:49:53
|
Line 14 import bz2
|
Line 14 import bz2
|
import os |
import os |
import os.path |
import os.path |
import stat |
import stat |
|
import Ft.Xml.XPath |
import xml.dom.minidom |
import xml.dom.minidom |
from types import * |
from types import * |
import xmlrpclib |
import xmlrpclib |
Line 158 class OSAS_storeOnline(SimpleItem):
|
Line 159 class OSAS_storeOnline(SimpleItem):
|
path=os.path.normpath(path) |
path=os.path.normpath(path) |
|
|
try: |
try: |
|
dom = NonvalidatingReader.parseString(server.getFile(indexMeta),"http://www.mpiwg-berlin.mpg.de/") |
|
|
dom=xml.dom.minidom.parseString(server.getFile(indexMeta)) |
|
except: |
except: |
zLOG.LOG("OSAS_browser (findEntryInIndexMeta)",zLOG.ERROR,"Cannot parse: %s"%indexMeta) |
zLOG.LOG("OSAS_browser (findEntryInIndexMeta)",zLOG.ERROR,"Cannot parse: %s"%indexMeta) |
return None |
return None |
Line 173 class OSAS_storeOnline(SimpleItem):
|
Line 174 class OSAS_storeOnline(SimpleItem):
|
searchPath=searchPath[1:] |
searchPath=searchPath[1:] |
#ist path ein directory? |
#ist path ein directory? |
xpath="/resource/dir[name='%s' and path='%s']"%(name,searchPath) |
xpath="/resource/dir[name='%s' and path='%s']"%(name,searchPath) |
|
dirs=Ft.Xml.XPath.Evaluate(xpath,contextNode=dom) |
|
|
dirs=xml.xpath.Evaluate(xpath,dom) |
|
|
|
if len(dirs)>0: |
if len(dirs)>0: |
return dirs[0].toxml |
return dirs[0].toxml |
Line 182 class OSAS_storeOnline(SimpleItem):
|
Line 183 class OSAS_storeOnline(SimpleItem):
|
#ist path ein file? |
#ist path ein file? |
xpath="/resource/file[name='%s' and path='%s']"%(name,searchPath) |
xpath="/resource/file[name='%s' and path='%s']"%(name,searchPath) |
|
|
dirs=xml.xpath.Evaluate(xpath,dom) |
|
|
|
|
dirs=Ft.Xml.XPath.Evaluate(xpath,contextNode=dom) |
if len(dirs)>0: |
if len(dirs)>0: |
return dirs[0].toxml() |
return dirs[0].toxml() |
|
|
Line 214 class OSAS_storeOnline(SimpleItem):
|
Line 215 class OSAS_storeOnline(SimpleItem):
|
|
|
#teste ob schon im cache zur Zeit kein chache wenn index.meta file nicht im selben ordner wie path. |
#teste ob schon im cache zur Zeit kein chache wenn index.meta file nicht im selben ordner wie path. |
|
|
if self._v_metaFiles.has_key(startPath) and (self._v_metaFiles[realPath][0]==stats[stat.ST_MTIME]) and (path==""): |
#if self._v_metaFiles.has_key(startPath) and (self._v_metaFiles[realPath][0]==stats[stat.ST_MTIME]) and (path==""): |
|
# |
return self._v_metaFiles[startPath][1] |
# return self._v_metaFiles[startPath][1] |
|
|
try: |
try: |
dom=xml.dom.minidom.parseString(server.getFile(indexMeta)) |
dom=xml.dom.minidom.parseString(server.getFile(indexMeta)) |
Line 320 class OSAS_storeOnline(SimpleItem):
|
Line 321 class OSAS_storeOnline(SimpleItem):
|
return None |
return None |
|
|
#teste ob schon im cache |
#teste ob schon im cache |
if self._v_fileSystem.has_key(realPath) and (self._v_fileSystem[realPath][0]==stats[stat.ST_MTIME]): |
#if self._v_fileSystem.has_key(realPath) and (self._v_fileSystem[realPath][0]==stats[stat.ST_MTIME]): |
|
# |
return self._v_fileSystem[realPath][1] |
# return self._v_fileSystem[realPath][1] |
|
|
indexMetas=server.getAllIndexMetasOfSubDirs(realPath) |
indexMetas=server.getAllIndexMetasOfSubDirs(realPath) |
dir=indexMetas.keys() |
dir=indexMetas.keys() |
Line 348 class OSAS_storeOnline(SimpleItem):
|
Line 349 class OSAS_storeOnline(SimpleItem):
|
|
|
if metaDataStr: |
if metaDataStr: |
display=metaData.getDisplayFieldsAsStr(metaDataStr) |
display=metaData.getDisplayFieldsAsStr(metaDataStr) |
dom=xml.dom.minidom.parseString(metaDataStr) |
|
|
|
if len(xml.xpath.Evaluate("/file/meta/video-file",dom))>0: |
dom = NonvalidatingReader.parseString(metaDataStr,"http://www.mpiwg-berlin.mpg.de/") |
|
if len(Ft.Xml.XPath.Evaluate("/file/meta/video-file",contextNode=dom))>0: |
fileType='OSAS_videoFile' |
fileType='OSAS_videoFile' |
|
|
else: |
else: |