Exemplo n.º 1
0
    def postprocessLabelitPP(self, iteration):
        """
    convert pdf's and copy to working dir.
    """
        if self.verbose:
            self.logger.debug('LabelitPP::postprocessPP')
        try:
            pdf = '%s.pdf' % iteration
            jpg = pdf.replace('pdf', 'jpg')
            if os.path.exists(pdf):
                Utils.convertImage(self, pdf, jpg)
                if os.path.exists(os.path.join(self.working_dir, jpg)):
                    os.system('rm -rf %s' %
                              os.path.join(self.working_dir, jpg))
                shutil.copy(jpg, self.working_dir)
            #Look for errors if pdf not generated
            else:
                if os.path.exists('%s.log' % iteration):
                    data = Parse.ParseOutputLabelitPP(
                        self,
                        open('%s.log' % iteration, 'r').readlines())
                    if data != None:
                        self.total = data
                        return ('kill')

        except:
            self.logger.exception('**ERROR in LabelitPP.postprocessPP**')
Exemplo n.º 2
0
  def postprocessMolrep(self):
    """
    Sort Molrep data.
    """
    if self.verbose:
      self.logger.debug('AutoStats::postprocessMolrep')
    try:
      if os.path.exists('molrep_rf.ps'):
        Utils.convertImage(self,'molrep_rf.ps','molrep_rf.jpg')
        #self.molrep_log = open('molrep.doc','r').readlines()
        #data = Parse.ParseOutputMolrep(self,self.molrep_log)
        data = Parse.ParseOutputMolrep(self,open('molrep.doc','r').readlines())
      else:
        data = Parse.setMolrepFailed(self)
        self.failed = True
        self.clean = False
      data.update({'Molrep log':os.path.join(os.getcwd(),'molrep.doc'),
                   'Molrep jpg':os.path.join(os.getcwd(),'molrep_rf.jpg')})
      self.molrep_results = { 'Molrep results' : data }

    except:
      self.logger.exception('**ERROR in AutoStats.postprocessMolrep**')
Exemplo n.º 3
0
  def postprocessLabelitPP(self,iteration):
    """
    convert pdf's and copy to working dir.
    """
    if self.verbose:
      self.logger.debug('LabelitPP::postprocessPP')
    try:
      pdf = '%s.pdf'%iteration
      jpg = pdf.replace('pdf','jpg')
      if os.path.exists(pdf):
        Utils.convertImage(self,pdf,jpg)
        if os.path.exists(os.path.join(self.working_dir,jpg)):
          os.system('rm -rf %s'%os.path.join(self.working_dir,jpg))
        shutil.copy(jpg,self.working_dir)
      #Look for errors if pdf not generated
      else:
        if os.path.exists('%s.log'%iteration):
          data = Parse.ParseOutputLabelitPP(self,open('%s.log'%iteration,'r').readlines())
          if data != None:
            self.total = data
            return('kill')

    except:
      self.logger.exception('**ERROR in LabelitPP.postprocessPP**')