--- OSA_system2/OSAS_server.py 2005/11/29 13:21:33 1.19 +++ OSA_system2/OSAS_server.py 2007/01/31 14:30:29 1.21 @@ -8,11 +8,20 @@ import base64 from Products.PageTemplates.PageTemplateFile import PageTemplateFile from Globals import InitializeClass,package_home from OFS.SimpleItem import SimpleItem -import zLOG +import logging import sys +#ersetzt logging +def logger(txt,method,txt2): + """logging""" + logging.info(txt+ txt2) + + + def encodeRPC(string): return base64.encodestring(bz2.compress(string)) +def decodeRPC(string): + return bz2.decompress(base64.decodestring(string)) class OSAS_storeOnlineServer(SimpleItem): @@ -150,8 +159,11 @@ class OSAS_storeOnlineServer(SimpleItem) ret[dir]=(fileType,None) return ret - def writeMetaDataFile(self,path,metadata): + def writeMetaDataFile(self,path,metadata,compressed=None): """writefiletoserver""" + if compressed: + metadata=decodeRPC(metadata) + try: fh=file(path,"w") fh.write(metadata) @@ -163,9 +175,9 @@ class OSAS_storeOnlineServer(SimpleItem) def generateMovieThumb(self,input,output): """generate Movie""" - zLOG.LOG("SERVER",zLOG.INFO,"/usr/local/bin/thumbbite.pl %s %s"%(input,output)) + logger("SERVER",logging.INFO,"/usr/local/bin/thumbbite.pl %s %s"%(input,output)) ret=os.popen("/usr/local/bin/thumbbite.pl %s %s"%(input,output)) - zLOG.LOG("SERVER",zLOG.INFO,ret) + logger("SERVER",logging.INFO,ret) return "ok" def manage_addOSAS_storeOnlineServerForm(self):