Diff for /versionedFile/extVersionedFile.py between versions 1.9 and 1.10

version 1.9, 2007/09/10 19:27:55 version 1.10, 2007/09/14 12:06:55
Line 197  class extVersionedFileFolder(Folder,ECHO Line 197  class extVersionedFileFolder(Folder,ECHO
         if RESPONSE:          if RESPONSE:
             RESPONSE.redirect(self.REQUEST['URL1'])              RESPONSE.redirect(self.REQUEST['URL1'])
   
       def importVersionedFileFolderForm(self):
           """form fuer versionedFileFolder import"""
           pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','importVersionedFileFolderForm.zpt')).__of__(self)
           return pt()
       
       def importVersionedFileFolder(self,path,RESPONSE=None):
           """import contents of a versionedFileFolder on the server"""
           vff = getattr(self.aq_parent, path, None)
           if vff is None:
               return "SORRY, unable to import %s"%path
           
           tmpPath=tempfile.mktemp()
           if not os.path.exists(tempfile.tempdir):
               os.mkdir(tempfile.tempdir) 
   
           if not os.path.exists(tmpPath):
               os.mkdir(tmpPath) 
   
           for (vfn, vf) in vff.getVersionedFiles():
               if vf.meta_type == 'versionedFile':
                   title = vf.title
                   author = vf.author
                   vc = getattr(vf.comment, "")
                   # save file to filesystem
                   savePath=os.path.join(tmpPath,title)
                   fh=file(savePath,"w")
                   fh.write(lastV.getData())
                   fh.close()
                   # and read in again
                   fh = file(savePath)
                   self.addFile(vC=vc, file=fh, author=author)
                   
               else:
                   logging.error("importvff: unable to import %s of type %s!"%(vfn,vf.meta_type))
           
           shutil.rmtree(tmpPath)
   
           if RESPONSE:
               RESPONSE.redirect(self.REQUEST['URL1'])
   
     zipThreads={}      zipThreads={}
     zipThreads2={}      zipThreads2={}
   

Removed from v.1.9  
changed lines
  Added in v.1.10


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