|
|
| version 1.65, 2007/02/08 10:46:36 | version 1.67, 2007/03/19 18:34:01 |
|---|---|
| Line 25 from BTrees.OOBTree import OOBTree | Line 25 from BTrees.OOBTree import OOBTree |
| import logging | import logging |
| import transaction | import transaction |
| import copy | import copy |
| import codecs | |
| def unique(s): | def unique(s): |
| """Return a list of the elements in s, but without duplicates. | """Return a list of the elements in s, but without duplicates. |
| Line 1449 def splitatf(fh,dir=None,ext=None): | Line 1450 def splitatf(fh,dir=None,ext=None): |
| i=0 | i=0 |
| for lineTmp in fh.readlines(): | for lineTmp in fh.readlines(): |
| 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.log("Deal with: %s"%line) | |
| if ext: | if ext: |
| i+=1 | i+=1 |
| if (i%100)==0: | if (i%100)==0: |
| Line 1534 class CDLIFileFolder(extVersionedFileFol | Line 1537 class CDLIFileFolder(extVersionedFileFol |
| return ret | return ret |
| def getFile(self,fn): | |
| """get the content of the file fn""" | |
| founds=self.CDLICatalog.search({'title':fn}) | |
| if not founds: | |
| return [] | |
| else: | |
| obj=founds[0].getObject().getLastVersion() | |
| logging.error(obj.getData()) | |
| return obj.getData()[0:] | |
| def checkCatalog(self,fn): | def checkCatalog(self,fn): |
| """check if fn is in the catalog""" | """check if fn is in the catalog""" |
| #TODO add checkCatalog | #TODO add checkCatalog |
| Line 1556 class CDLIFileFolder(extVersionedFileFol | Line 1569 class CDLIFileFolder(extVersionedFileFol |
| return pt(search=list,author=author) | return pt(search=list,author=author) |
| def getAllPNumbers(self): | |
| """get a list of all files (resp their p-numbers) stored""" | |
| ret=[x.getId for x in self.CDLICatalog()] | |
| return ret | |
| def findObjectsFromList(self,enterList=None,display=False,start=None,upload=None,list=None,basketName=None,numberOfObjects=None,RESPONSE=None): | def findObjectsFromList(self,enterList=None,display=False,start=None,upload=None,list=None,basketName=None,numberOfObjects=None,RESPONSE=None): |
| """findObjectsFromList (, TAB oder LINE separated)""" | """findObjectsFromList (, TAB oder LINE separated)""" |