Diff for /cdli/cdli_files.py between versions 1.113 and 1.115

version 1.113, 2009/08/31 14:06:42 version 1.115, 2010/03/19 14:01:41
Line 90  class CDLIFileObject(CatalogAware,extVer Line 90  class CDLIFileObject(CatalogAware,extVer
     def getPNumber(self):      def getPNumber(self):
         """get the pnumber"""          """get the pnumber"""
         try:          try:
                 txt=re.match("&[Pp](\d*)\s*=([^\r\n]*)",self.getData()[0:])                  txt=re.match("&[PpSs](\d*)\s*=([^\r\n]*)",self.getData()[0:])
         except:          except:
                 txt=self.getData()[0:]                  txt=self.getData()[0:]
                                   
Line 104  class CDLIFileObject(CatalogAware,extVer Line 104  class CDLIFileObject(CatalogAware,extVer
     def getDesignation(self):      def getDesignation(self):
         """get the designation out of the file"""          """get the designation out of the file"""
         try:          try:
                 txt=re.match("&[Pp](\d*)\s*=([^\r\n]*)",self.getData()[0:])                  txt=re.match("&[PpSs](\d*)\s*=([^\r\n]*)",self.getData()[0:])
         except:          except:
                 txt=self.getData()[0:]                  txt=self.getData()[0:]
                                   
Line 318  def checkFile(filename,data,folder): Line 318  def checkFile(filename,data,folder):
     # first check the file name      # first check the file name
     fn=filename.split(".") # no extension      fn=filename.split(".") # no extension
   
     if not fn[0][0]=="P":      if not (fn[0][0]=="P" or fn[0][0]=="S"):
         return False,"P missing in the filename"          return False,"P/S missing in the filename"
     elif len(fn[0])!=7:      elif len(fn[0])!=7:
         return False,"P number has not the right length 6"          return False,"P number has not the right length 6"
     elif not checkUTF8(data):      elif not checkUTF8(data):
Line 857  class CDLIRoot(Folder): Line 857  class CDLIRoot(Folder):
         self.v_files_lastVersion.update({obj.getId():obj.getLastVersion()})          self.v_files_lastVersion.update({obj.getId():obj.getLastVersion()})
                   
         self.v_file_ids.add(obj.getId())          self.v_file_ids.add(obj.getId())
           #change everthing around to make it persistent...
           tmp = self.v_files
           self.v_files=tmp
           
           tmp2=self.v_file_ids
           self.v_file_ids=tmp2
   
           self.CDLICache.cleanCache() #be sure that the cache is clean
         logging.debug("update:"+obj.getId()+"XXX"+repr(obj))          logging.debug("update:"+obj.getId()+"XXX"+repr(obj))
                   
   
     def deleteFromBTree(self,objId):      def deleteFromBTree(self,objId):
         """delete an obj"""          """delete an obj"""
         self.v_files.pop(objId)          self.v_files.pop(objId)
Line 991  class CDLIRoot(Folder): Line 1000  class CDLIRoot(Folder):
             if line.lstrip().startswith('#lem:'):              if line.lstrip().startswith('#lem:'):
                 continue                  continue
             # ignore p-num line              # ignore p-num line
             if line.startswith('&P'):              if line.startswith('&P') or line.startswith('&S'):
                 continue                  continue
             # ignore version lines              # ignore version lines
             if line.startswith('#version'):              if line.startswith('#version'):
Line 1082  class CDLIRoot(Folder): Line 1091  class CDLIRoot(Folder):
                 lv.author=user                  lv.author=user
                 lv.versionComment="XXXXXXX"                  lv.versionComment="XXXXXXX"
           
               
           
         gen  
     def forceunlock(self,REQUEST=None,user=None,fid=None):      def forceunlock(self,REQUEST=None,user=None,fid=None):
         "break all locks"          "break all locks"
         if fid is not None:          if fid is not None:
Line 1308  class CDLIRoot(Folder): Line 1314  class CDLIRoot(Folder):
                                     
     def uploadATFfinally(self,procedure='',comment="",basketname='',unlock=None,repeat=None,RESPONSE=None):      def uploadATFfinally(self,procedure='',comment="",basketname='',unlock=None,repeat=None,RESPONSE=None):
         """nowupload the files"""          """nowupload the files"""
          
          
          
         threadName=repeat          threadName=repeat
         if not threadName or threadName=="":          if not threadName or threadName=="":
             thread=uploadATFfinallyThread()              thread=uploadATFfinallyThread()
Line 1373  class CDLIRoot(Folder): Line 1376  class CDLIRoot(Folder):
                                 
                         logging.error("uploadATFfinally - cannot update Object %s Error: %s %s"%(ob[1],sys.exc_info()[0],sys.exc_info()[1]))                          logging.error("uploadATFfinally - cannot update Object %s Error: %s %s"%(ob[1],sys.exc_info()[0],sys.exc_info()[1]))
               for x in stObj.returnValue['newPs']:                for x in stObj.returnValue['newPs']:
                     ob=self.CDLICatalog.search({'title':x})                    obj=self.getFileObject(x) #updates the object in the cache
                     try:                    logging.debug("Got:"+repr(obj))
                         self.cdliRoot.updateOrAddToFileBTree(ob[0].getObject())  
                     except:  
                  
                         logging.error("uploadATFfinally - cannot update Object %s Error: %s %s"%(x,sys.exc_info()[0],sys.exc_info()[1]))  
               if RESPONSE is not None:                if RESPONSE is not None:
                   RESPONSE.redirect(self.absolute_url())                    RESPONSE.redirect(self.absolute_url())
   

Removed from v.1.113  
changed lines
  Added in v.1.115


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>