def run(self):
     for i in self.Seq:
         modelname = readModelnameFromParamsFile(Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i)))
         
         runBonnmotionModel(Config().readConfigEntry('bonnmotionpath'), i, modelname)
         
         paramsfilename = os.path.join(Config().readConfigEntry('bonnmotionpath'), Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i)))
         movementsfilename = os.path.join(Config().readConfigEntry('bonnmotionpath'), Config().readConfigEntry('tempoutputmovementsfile').replace('INDEX', str(i)))
         try:
             #open movements file
             f = gzip.open(movementsfilename, 'rb')
             movements_content = f.read()
             f.close()  
         except IOError as ex:
             print >> sys.stderr, ex  
             print >> sys.stderr, "that means bonnmotion has not generated any output"
             print >> sys.stderr, "parameter file:"
             fd = open(os.path.join(os.getcwd(), Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i))))
             print >> sys.stderr, fd.read()
             fd.close()
             sys.exit(1);
         
         p = {}
         p['identifier'] = modelname
         #read parameters
         f2 = open(paramsfilename)
         p['bmparamsfile'] = f2.read()
         f2.close()
         #create checksum
         Hashes().calcHashes(p, movements_content)
         p['user'] = getpass.getuser()
         p['datetime'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
         
         #save in DB
         DataAccess().save(p) 
Exemple #2
0
        def run(self):
            j = 0
            for i in self.Seq:
                modelname = readModelnameFromParamsFile(
                    os.path.join(
                        Config().readConfigEntry('bonnmotionvalidatepath'),
                        Config().readConfigEntry(
                            'tempoutputparamsfile').replace('INDEX', str(i))))

                runBonnmotionModel(
                    Config().readConfigEntry('bonnmotionvalidatepath'), i,
                    modelname)

                movementsfilename = os.path.join(
                    Config().readConfigEntry('bonnmotionvalidatepath'),
                    Config().readConfigEntry(
                        'tempoutputmovementsfile').replace('INDEX', str(i)))
                f = gzip.open(movementsfilename, 'rb')
                movements_content = f.read()
                f.close()

                if (self.Md5[j] <> Hashes().md5(movements_content)
                        or self.Sha1[j] <> Hashes().sha1(movements_content)):
                    f2 = open(
                        os.path.join(
                            Config().readConfigEntry('bonnmotionvalidatepath'),
                            Config().readConfigEntry(
                                'tempoutputparamsfile').replace(
                                    'INDEX', str(i))), 'r')
                    self.ReturnValue.append(f2.read())
                    f2.close()

                j += 1
 def run(self):
     for i in self.Seq:
         modelname = readModelnameFromParamsFile(os.path.join(Config().readConfigEntry('bonnmotionvalidatepath'), Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i))))
         
         runBonnmotionModel(Config().readConfigEntry('bonnmotionvalidatepath'), i, modelname)
         
         paramsfilename = os.path.join(Config().readConfigEntry('bonnmotionvalidatepath'), Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i)))
         movementsfilename = os.path.join(Config().readConfigEntry('bonnmotionvalidatepath'), Config().readConfigEntry('tempoutputmovementsfile').replace('INDEX', str(i)))
         try:
             #open movements file
             f = gzip.open(movementsfilename, 'rb')
             movements_content = f.read()
             f.close()  
         except IOError as ex:
             print >> sys.stderr, ex  
             print >> sys.stderr, "that means bonnmotion has not generated any output"
             print >> sys.stderr, "parameter file:"
             fd = open(os.path.join(Config().readConfigEntry('bonnmotionvalidatepath'), Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i))))
             print >> sys.stderr, fd.read()
             fd.close()
             sys.exit(1);
         
         p = {}
         p['identifier'] = modelname
         #read parameters
         f2 = open(paramsfilename)
         p['bmparamsfile'] = f2.read()
         f2.close()
         #create checksum
         Hashes().calcHashes(p, movements_content)
         p['user'] = getpass.getuser()
         p['datetime'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
         
         #save in DB
         DataAccess().save(p) 
Exemple #4
0
 def run(self):
     for i in self.Seq:
         modelname = readModelnameFromParamsFile(
             os.path.join(
                 Config().readConfigEntry('bonnmotionvalidatepath'),
                 Config().readConfigEntry(
                     'tempoutputparamsfile').replace('INDEX', str(i))))
         runBonnmotionModel(self.path, i, modelname)
 def run(self):
     j = 0
     for i in self.Seq:
         modelname = readModelnameFromParamsFile(Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i)))
         
         runBonnmotionModel(Config().readConfigEntry('bonnmotionvalidatepath'), i, modelname)
         
         movementsfilename = os.path.join(Config().readConfigEntry('bonnmotionvalidatepath'), Config().readConfigEntry('tempoutputmovementsfile').replace('INDEX', str(i)))
         
         f = gzip.open(movementsfilename, 'rb')
         movements_content = f.read()
         f.close()    
         
         if (self.Md5[j] <> Hashes().md5(movements_content) or self.Sha1[j] <> Hashes().sha1(movements_content)):
             f2 = open(Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i)), 'r')
             self.ReturnValue.append(f2.read())
             f2.close()
         
         j += 1    
 def run(self):
     for i in self.Seq:
         modelname = readModelnameFromParamsFile(Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i)))
         runBonnmotionModel(self.path, i, modelname)