version 1.11, 2005/04/21 10:10:10
|
version 1.13, 2007/01/31 14:30:30
|
Line 16 from urlparse import *
|
Line 16 from urlparse import *
|
import re |
import re |
import xml.dom.minidom |
import xml.dom.minidom |
from types import * |
from types import * |
import zLOG |
import logging |
|
|
|
#ersetzt logging |
|
def logger(txt,method,txt2): |
|
"""logging""" |
|
logging.info(txt+ txt2) |
|
|
|
|
import os.path |
import os.path |
import Globals |
import Globals |
from Globals import package_home |
from Globals import package_home |
Line 85 class OSAS_add_contextData(Folder):
|
Line 92 class OSAS_add_contextData(Folder):
|
return curHandler.retStr.encode('utf-8') |
return curHandler.retStr.encode('utf-8') |
|
|
except: |
except: |
zLOG.LOG('OSAS_Root (addFileToDollection)',zLOG.ERROR,'%s %s'%sys.exc_info()[:2]) |
logger('OSAS_Root (addFileToDollection)',logging.ERROR,'%s %s'%sys.exc_info()[:2]) |
return URL |
return URL |
return urllib.urlopen(URL).read() |
return urllib.urlopen(URL).read() |
|
|
Line 149 class OSAS_add_contextData(Folder):
|
Line 156 class OSAS_add_contextData(Folder):
|
|
|
#link=TOBEDONE" |
#link=TOBEDONE" |
"""Hinzufuegen der Ressource""" |
"""Hinzufuegen der Ressource""" |
|
|
gifPath=path.replace("/mpiwg/online/","") |
gifPath=path.replace("/mpiwg/online/","") |
rawPath=path.replace("/mpiwg/online/permanent/einstein_exhibition/movies/","") |
rawPath=path.replace("/mpiwg/online/permanent/einstein_exhibition/movies/","") |
#lowresPath=path.replace("/mpiwg/online/permanent/einstein_exhibition/movies/","") |
lowresPath=path.replace("/mpiwg/online/permanent/einstein_exhibition/movies/","") |
|
|
thumbUrl="http://einst3.mpiwg-berlin.mpg.de/"+gifPath+"/"+thumb |
thumbUrl="http://einst3.mpiwg-berlin.mpg.de/"+gifPath+"/"+thumb |
link="rtsp://einst1.mpiwg-berlin.mpg.de/"+gifPath+"/"+streamingfile |
link="rtsp://einst1.mpiwg-berlin.mpg.de/"+gifPath+"/"+streamingfile |
rawFile="file:///Volumes/einstein_movies/"+rawPath+"/"+rawfile |
rawFile="file:///Volumes/einstein_movies/"+rawPath+"/"+rawfile |
Line 165 class OSAS_add_contextData(Folder):
|
Line 174 class OSAS_add_contextData(Folder):
|
server=xmlrpclib.Server(collection,allow_none=True) |
server=xmlrpclib.Server(collection,allow_none=True) |
retStr=server.addMovie(id,title,label,description,content_type,responsible,link,thumbUrl,rawFile,lowresFile,metalink,weight,credits) |
retStr=server.addMovie(id,title,label,description,content_type,responsible,link,thumbUrl,rawFile,lowresFile,metalink,weight,credits) |
except: |
except: |
zLOG.LOG('OSAS_Root (addFileToDollection2)',zLOG.ERROR,'%s %s'%sys.exc_info()[:2]) |
logger('OSAS_Root (addFileToDollection2)',logging.ERROR,'%s %s'%sys.exc_info()[:2]) |
return "An Error occured adding the resource\n", collection,params |
return "An Error occured adding the resource\n", collection,params |
|
|
#print "added" |
#print "added" |
Line 416 class OSAS_root(Folder,Implicit):
|
Line 425 class OSAS_root(Folder,Implicit):
|
|
|
dom=self.validateIndexMeta(xmlneu) |
dom=self.validateIndexMeta(xmlneu) |
if not dom: |
if not dom: |
zLOG.LOG('OSAS_Root (downloadExternalXML)',zLOG.ERROR,'cannot parse: %s', xml_url) |
logger('OSAS_Root (downloadExternalXML)',logging.ERROR,'cannot parse: %s', xml_url) |
return "error" |
return "error" |
|
|
|
|