Diff for /OSAS/OSA_system/OSAS_show.py between versions 1.31 and 1.35

version 1.31, 2005/05/04 14:06:32 version 1.35, 2008/01/18 20:36:28
Line 11  from Products.PageTemplates.PageTemplate Line 11  from Products.PageTemplates.PageTemplate
 from Products.PageTemplates.PageTemplate import PageTemplate  from Products.PageTemplates.PageTemplate import PageTemplate
 from AccessControl import ClassSecurityInfo  from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass,package_home  from Globals import InitializeClass,package_home
   import zLOG
   
 class OSAS_ShowOnline(SimpleItem):  class OSAS_ShowOnline(SimpleItem):
     security=ClassSecurityInfo()      security=ClassSecurityInfo()
Line 108  class OSAS_StoreOnline(SimpleItem): Line 109  class OSAS_StoreOnline(SimpleItem):
         """rescale thumbs of images in path"""          """rescale thumbs of images in path"""
   
         dlpath = re.sub('/mpiwg/online/','',self.REQUEST['path'])          dlpath = re.sub('/mpiwg/online/','',self.REQUEST['path'])
         os.popen("ssh archive@nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat -src=/mpiwg/online -dest=/mpiwg/temp/online/scaled/thumb -dir=%s -scaleto=90 -sync >> /tmp/sc.out &"%dlpath )          ret=os.popen("ssh archive@nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat -src=/mpiwg/online -dest=/mpiwg/temp/online/scaled/thumb -dir=%s -scaleto=100 -sync >> /tmp/sc.out &"%dlpath )
         #os.popen("ssh archive@nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/thumb 90 --replace >> /tmp/sc.out &"% re.sub('/mpiwg/online/','',self.REQUEST['path']))          #os.popen("ssh archive@nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat.pl %s /mpiwg/temp/online/scaled/thumb 90 --replace >> /tmp/sc.out &"% re.sub('/mpiwg/online/','',self.REQUEST['path']))
       zLOG.LOG("OSAS_StoreOnline (rescleThumbs)",zLOG.INFO,ret.read())
       zLOG.LOG("OSAS_StoreOnline (rescleThumbs)",zLOG.INFO,"ssh archive@nausikaa2.rz-berlin.mpg.de /usr/local/mpiwg/scripts/scaleomat -src=/mpiwg/online -dest=/mpiwg/temp/online/scaled/thumb -dir=%s -scaleto=100 -sync >> /tmp/sc.out &"%dlpath)
         self.REQUEST.SESSION['path']=self.REQUEST['path']          self.REQUEST.SESSION['path']=self.REQUEST['path']
         #return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1'])          #return self.REQUEST.RESPONSE.redirect(self.REQUEST['URL1'])
         pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','OSAS_scaled.zpt')).__of__(self)          pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','OSAS_scaled.zpt')).__of__(self)
Line 341  import tempfile Line 343  import tempfile
 tempfile.tempdir="/var/tmp"  tempfile.tempdir="/var/tmp"
   
 exclusion=[".HSResource","lost+found","Network Trash Folder","TheFindByContentFolder","TheVolumeSettingsFolder"]  exclusion=[".HSResource","lost+found","Network Trash Folder","TheFindByContentFolder","TheVolumeSettingsFolder"]
   
 class fsentry(Implicit, Persistent, RoleManager):  class fsentry(Implicit, Persistent, RoleManager):
       """File entry class"""        """File entry class"""
       path = ""        path = ""
Line 571  class filesystem2(Implicit, Persistent, Line 574  class filesystem2(Implicit, Persistent,
       def loadfs(self,start):        def loadfs(self,start):
         """analyse filesystem"""          """analyse filesystem"""
         for line in self.getfs(start):          for line in self.getfs(start):
                       logging.debug("loadfs: reading %s"%repr(line))
         g=re.search(r"(.*/)(.*)\n",line)          g=re.search(r"(.*/)(.*)\n",line)
         if not g==None:          if not g==None:
                   try:                    try:
Line 579  class filesystem2(Implicit, Persistent, Line 582  class filesystem2(Implicit, Persistent,
                         file=g.group(2)                          file=g.group(2)
                   except:                    except:
                         """nothing"""                          """nothing"""
                     logging.debug("loadfs: file=%s"%repr(file))
                     #if file[0] in ('.',':'):
                         # skip dot-files
                     #    continue
                   if self.node.has_key(path):                    if self.node.has_key(path):
                  elements=self.node[path]                   elements=self.node[path]
                  elements.append(file)                   elements.append(file)
Line 649  class browse(Implicit, Persistent, RoleM Line 656  class browse(Implicit, Persistent, RoleM
       def filterExcluded(self,dir):        def filterExcluded(self,dir):
       ret=[]        ret=[]
       for item in dir:        for item in dir:
         if not item in exclusion:                  if not ((item in exclusion) or (item[0] in ('.',':'))):
             ret.append(item)               ret.append(item) 
       return ret        return ret
           
Line 1253  def isScannedDocument(self,path): Line 1260  def isScannedDocument(self,path):
       """returns TRUE, wenn path der Stammordner eines gescannten Documents ist"""        """returns TRUE, wenn path der Stammordner eines gescannten Documents ist"""
       try:        try:
             f = file(path+"/index.meta","r")              f = file(path+"/index.meta","r")
               logging.debug("isscanneddocument: file=%s"%f)
             lines = f.read()              lines = f.read()
         
             try:              try:
                   dom = xml.dom.minidom.parseString(lines)                    dom = xml.dom.minidom.parseString(lines)
                   content_type=getText(dom.getElementsByTagName("content-type")[0].childNodes)                     content_type=getText(dom.getElementsByTagName("content-type")[0].childNodes) 
                     logging.debug("isscanneddocument: content_type=%s"%content_type)
                   if (content_type=="scanned-document") or (content_type=="scanned document") or (content_type=="fulltext document"):                    if (content_type=="scanned-document") or (content_type=="scanned document") or (content_type=="fulltext document"):
                         return 1                          return 1
                   else:                    else:

Removed from v.1.31  
changed lines
  Added in v.1.35


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