Diff for /OSA_system2/OSAS_server.py between versions 1.8 and 1.11

version 1.8, 2005/02/12 13:30:31 version 1.11, 2005/03/03 20:41:00
Line 4  import stat Line 4  import stat
 import OSAS_helpers  import OSAS_helpers
 import xmlrpclib  import xmlrpclib
 import bz2  import bz2
   import base64
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile  from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Globals import InitializeClass,package_home  from Globals import InitializeClass,package_home
 from OFS.SimpleItem import SimpleItem  from OFS.SimpleItem import SimpleItem
   
   def encodeRPC(string):
       return base64.encodestring(bz2.compress(string))
   
   
 class OSAS_storeOnlineServer(SimpleItem):  class OSAS_storeOnlineServer(SimpleItem):
Line 81  class OSAS_storeOnlineServer(SimpleItem) Line 83  class OSAS_storeOnlineServer(SimpleItem)
         """getFile"""          """getFile"""
   
         if not os.path.exists(path):          if not os.path.exists(path):
               print "sorry"
             return None              return None
   
         f=file(path,'r')          f=file(path,'r')
Line 95  class OSAS_storeOnlineServer(SimpleItem) Line 98  class OSAS_storeOnlineServer(SimpleItem)
         """get all index Metas"""          """get all index Metas"""
         ret={}          ret={}
         if os.path.exists(path+"/index.meta"):          if os.path.exists(path+"/index.meta"):
             compressed=file(path+"/index.meta","r").read()              compressed=encodeRPC(file(path+"/index.meta","r").read())
             ret["."]=('OSAS_dir',compressed)              ret["."]=('OSAS_dir',compressed)
         for dir in os.listdir(path):          for dir in os.listdir(path):
             fileType=OSAS_helpers.checkOSASFileType(os.path.join(path,dir))              fileType=OSAS_helpers.checkOSASFileType(os.path.join(path,dir))
             if os.path.exists(os.path.join(path,dir,"index.meta")):              if os.path.exists(os.path.join(path,dir,"index.meta")):
                 compressed=file(os.path.join(path,dir,"index.meta"),"r").read()                  compressed=encodeRPC(file(os.path.join(path,dir,"index.meta"),"r").read())
                 ret[dir]=('OSAS_dir',compressed)                  ret[dir]=('OSAS_dir',compressed)
             else:              else:
                 ret[dir]=(fileType,None)                  ret[dir]=(fileType,None)
         return ret          return ret
   
       def writeMetaDataFile(self,path,metadata):
           """writefiletoserver"""
           try:
               fh=file(path,"w")
               fh.write(metadata)
               fh.close
               return True
           except:
               return False
                                                               
                   
 def manage_addOSAS_storeOnlineServerForm(self):  def manage_addOSAS_storeOnlineServerForm(self):

Removed from v.1.8  
changed lines
  Added in v.1.11


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