version 1.1, 2011/07/19 12:43:26
|
version 1.2, 2011/07/20 09:33:34
|
Line 15 from Products.cdli.cdli_files import CDL
|
Line 15 from Products.cdli.cdli_files import CDL
|
import pickle |
import pickle |
|
|
class StoreObject: |
class StoreObject: |
|
|
|
|
returnValue={} |
returnValue={} |
def __init__(self,storeId): |
def __init__(self,storeId): |
self.storeId= storeId |
self.storeId= storeId |
Line 29 class StoreObject:
|
Line 31 class StoreObject:
|
class uploadATFThread: |
class uploadATFThread: |
"""class for checking the files befor uploading""" |
"""class for checking the files befor uploading""" |
|
|
|
DEBUG=True |
|
|
def checkFile(self,filename,data,folder): |
def checkFile(self,filename,data,folder): |
"""check the files""" |
"""check the files""" |
# first check the file name |
# first check the file name |
Line 56 class uploadATFThread:
|
Line 60 class uploadATFThread:
|
iter=fh.readlines() |
iter=fh.readlines() |
|
|
for lineTmp in iter: |
for lineTmp in iter: |
#if fileCount>10: |
if (self.DEBUG==True) and (fileCount>10): |
# break; |
break; |
lineTmp=lineTmp.replace(codecs.BOM_UTF8,'') # make sure that all BOM are removed.. |
lineTmp=lineTmp.replace(codecs.BOM_UTF8,'') # make sure that all BOM are removed.. |
for line in lineTmp.split("\r"): |
for line in lineTmp.split("\r"): |
#logging.info("Deal with: %s"%line) |
#logging.info("Deal with: %s"%line) |
Line 80 class uploadATFThread:
|
Line 84 class uploadATFThread:
|
fileCount+=1 |
fileCount+=1 |
print fileCount |
print fileCount |
nf.close() #close file |
nf.close() #close file |
#if fileCount>10: |
if (self.DEBUG==True) and (fileCount>10): |
# break |
break |
|
|
filename=line[1:].split("=")[0].rstrip()+".atf" |
filename=line[1:].split("=")[0].rstrip()+".atf" |
if dir: |
if dir: |
Line 111 class uploadATFThread:
|
Line 115 class uploadATFThread:
|
logging.getLogger().setLevel(logging.DEBUG) |
logging.getLogger().setLevel(logging.DEBUG) |
|
|
|
|
def set(self,uploadId,basketId,username,serverport="8080"): |
def set(self,uploadId,basketId,username,serverport="29080"): |
"""set start values for the thread""" |
"""set start values for the thread""" |
self.result=file("/tmp/"+str(uploadId)+".out","w") |
self.result=file("/tmp/"+str(uploadId)+".out","w") |
self.uploadId=uploadId |
self.uploadId=uploadId |
Line 306 def checkUTF8(data):
|
Line 310 def checkUTF8(data):
|
return False |
return False |
|
|
if __name__ == "__main__": |
if __name__ == "__main__": |
|
if len(sys.argv)<5: |
|
print """Usage: procedure uploadId comment basketName unlock username |
|
uploadId: Ticket ID von uploadATF |
|
basketName: name of the basket |
|
username: username |
|
port of a running zope (not the zeo) |
|
""" |
|
|
upload = uploadATFThread() |
upload = uploadATFThread() |
x=sys.argv; |
x=sys.argv; |
print x |
print x |