version 1.12, 2006/03/19 03:27:21
|
version 1.14, 2006/03/28 19:56:31
|
Line 757 class CDLIFileObject(versionedFileObject
|
Line 757 class CDLIFileObject(versionedFileObject
|
security.declarePublic('getDesignation') |
security.declarePublic('getDesignation') |
def getDesignation(self): |
def getDesignation(self): |
"""get the designation out of the file""" |
"""get the designation out of the file""" |
txt=re.search("&[Pp](.*)= (.*)",self.data) |
try: |
|
txt=re.search("&[Pp](.*)= (.*)",self.data[0:]) |
|
except: |
|
print self.getId() |
|
txt=self.data[0:] |
|
print str(txt) |
|
|
|
return "ERROR" |
try: |
try: |
return txt.group(2) |
return txt.group(2) |
except: |
except: |
Line 970 class CDLIFileFolder(versionedFileFolder
|
Line 976 class CDLIFileFolder(versionedFileFolder
|
|
|
return ret |
return ret |
|
|
|
def checkCatalog(self,fn): |
|
"""check if fn is in the catalog""" |
|
|
|
|
def uploadATF(self,upload,basketId=0,RESPONSE=None): |
def uploadATF(self,upload,basketId=0,RESPONSE=None): |
"""upload an atf file""" |
"""upload an atf file""" |
Line 983 class CDLIFileFolder(versionedFileFolder
|
Line 992 class CDLIFileFolder(versionedFileFolder
|
changed=[] |
changed=[] |
errors=[] |
errors=[] |
newPs=[] |
newPs=[] |
|
psNotInCatalog=[] |
basketNameFromFile, numberOfFiles=splitatf(upload,dir) |
basketNameFromFile, numberOfFiles=splitatf(upload,dir) |
|
|
if basketId == '0': |
if basketId == '0': |
Line 999 class CDLIFileFolder(versionedFileFolder
|
Line 1009 class CDLIFileFolder(versionedFileFolder
|
|
|
|
|
for fn in os.listdir(dir): |
for fn in os.listdir(dir): |
|
|
|
if self.checkCatalog(fn): |
|
psNotInCatalog.append(fn) |
|
|
|
|
founds=self.CDLICatalog.search({'title':fn}) |
founds=self.CDLICatalog.search({'title':fn}) |
|
|
if len(founds)==0: |
if len(founds)==0: |
Line 1149 class CDLIFileFolder(versionedFileFolder
|
Line 1164 class CDLIFileFolder(versionedFileFolder
|
|
|
#os.write(tf,obj.getLastVersion().data) |
#os.write(tf,obj.getLastVersion().data) |
if RESPONSE: |
if RESPONSE: |
RESPONSE.write(obj.getLastVersion().data) |
RESPONSE.write(obj.getLastVersion().data[0:]) |
#os.close(tf) |
#os.close(tf) |
#RESPONSE.redirect(self.absolute_url()+"/downloadFile?fn="%tfilename) |
#RESPONSE.redirect(self.absolute_url()+"/downloadFile?fn="%tfilename) |
return True |
return True |