version 1.7, 2008/10/29 12:20:08
|
version 1.8, 2008/11/05 19:53:32
|
Line 5 from ZPublisher.BaseRequest import Reque
|
Line 5 from ZPublisher.BaseRequest import Reque
|
import logging |
import logging |
import os |
import os |
import transaction |
import transaction |
|
import pickle |
|
|
def correctFileName(filename): |
def correctFileName(filename): |
m1=filename[0:3] |
m1=filename[0:3] |
Line 150 class DownloadBasketFinallyThread(Thread
|
Line 150 class DownloadBasketFinallyThread(Thread
|
#falls die Datei gesperrit ist nimm sie in die Liste auf. |
#falls die Datei gesperrit ist nimm sie in die Liste auf. |
if not((procedure=="downloadAll") or (lockedBy=='') or (lockedBy==user)): |
if not((procedure=="downloadAll") or (lockedBy=='') or (lockedBy==user)): |
#logging.error("ret4") |
#logging.error("ret4") |
lockedFiles.append((object[0],lockedBy)) |
lockedFiles.append((object[0],str(lockedBy))) |
|
|
#if lock and lockedBy=='': |
#if lock and lockedBy=='': |
#obj=self.ctx.getFileObject(object[1].getId()) |
#obj=self.ctx.getFileObject(object[1].getId()) |
Line 175 class DownloadBasketFinallyThread(Thread
|
Line 175 class DownloadBasketFinallyThread(Thread
|
# fw.write(pout.read()) |
# fw.write(pout.read()) |
# fw.close() |
# fw.close() |
|
|
if not hasattr(self.ctx,'resultHash'): |
# if not hasattr(self.ctx,'resultHash'): |
self.ctx.resultHash={} |
# logging.debug("-------------create hash") |
self.ctx.resultHash[self.getName()]=files |
# self.ctx.resultHash={} |
|
logging.debug("-------------writing hash: %s"%self.getName()) |
|
#self.ctx.resultHash[self.getName()]=files |
|
o1 = file("/tmp/"+self.getName(),'w') |
|
pickle.dump(files, o1) |
|
o1.close() |
|
|
|
transaction.get().commit() |
if not hasattr(self.ctx,'resultLockedHash'): |
if not hasattr(self.ctx,'resultLockedHash'): |
self.ctx.resultLockedHash={} |
self.ctx.resultLockedHash={} |
self.ctx.resultLockedHash[self.getName()]=lockedFiles |
#self.ctx.resultLockedHash[self.getName()]=lockedFiles |
|
o2 = file("/tmp/"+self.getName()+'_lockedFiles','w') |
|
|
|
pickle.dump(lockedFiles, o2) |
|
o2.close() |
transaction.get().commit() |
transaction.get().commit() |
self.conn.close() |
self.conn.close() |
logging.error("---------download thread:run9") |
logging.error("---------download thread:run9") |