Example #1
0
        def run(self):
            j = 0
            for i in self.Seq:
                paramsfilename = os.path.join(Config().readConfigEntry('bonnmotionvalidatepath'), Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i.no)))
                movementsfilename = os.path.join(Config().readConfigEntry('bonnmotionvalidatepath'), Config().readConfigEntry('tempoutputmovementsfile').replace('INDEX', str(i.no)))
                outputfilename = os.path.join(Config().readConfigEntry('bonnmotionvalidatepath'), Config().readConfigEntry('tempoutputname') + str(i.no))

                if len(i.appparameters) > 0:
                    runBonnmotionApp(Config().readConfigEntry('bonnmotionvalidatepath'), i.no, i.identifier, i.appparameters)
                else:
                    runBonnmotionApp(Config().readConfigEntry('bonnmotionvalidatepath'), i.no, i.identifier, '')            
                
                content = ''
                
                spliting = i.ordering.split(',')
                if len(spliting) > 1:                       #the app creates more than 1 file
                    for ext in spliting: 
                        f = open(outputfilename + '.' + ext)
                        content = content + f.read()        #concatenate content of all files created
                        f.close()
                else:                                       #the app creates only one file
                    f = open(outputfilename + '.' + i.ordering)
                    content = f.read()
                    f.close()
    
                if (i.md5 <> Hashes().md5(content) or i.sha1 <> Hashes().sha1(content)):
                    f2 = open(Config().readConfigEntry('tempoutputparamsfile').replace('INDEX', str(i.no)), 'r')
                    if i.appparameters != '': 
                        self.ReturnValue.append('parameters of bonnmotion:\n' + f2.read() + '\nappname: ' + i.identifier + '\nparameters of the app:\n' + i.appparameters)
                    else: 
                        self.ReturnValue.append('parameters of bonnmotion:\n' + f2.read()+'\nappname: ' + i.identifier + '\nparameters of the app: none\n')
                    f2.close()       
                j += 1 
Example #2
0
        def run(self):
            for i in self.Seq:
                for case in self.Cases:
                    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)))
                    outputfilename = os.path.join(
                        Config().readConfigEntry('bonnmotionvalidatepath'),
                        Config().readConfigEntry('tempoutputname') + str(i))

                    if 'appparams' in case:
                        runBonnmotionApp(
                            Config().readConfigEntry('bonnmotionvalidatepath'),
                            i, self.App, case['appparams'])
                    else:
                        runBonnmotionApp(
                            Config().readConfigEntry('bonnmotionvalidatepath'),
                            i, self.App, '')
                    ordering = []
                    content = ''
                    for ext in case['extensions']:
                        ordering.append(ext)
                        #open file
                        if ext != 'NULL':
                            f = open(outputfilename + '.' + ext)
                            content = content + f.read()
                            f.close()

                    #read parameters
                    f2 = open(paramsfilename)
                    params = f2.read()
                    f2.close()

                    p = {}
                    if 'appparams' in case:
                        p['appparameters'] = case['appparams']
                    else:
                        p['appparameters'] = ''
                    p['identifier'] = self.App
                    p['bmparamsfile'] = params
                    Hashes().calcHashes(p, content)
                    p['user'] = getpass.getuser()
                    p['datetime'] = datetime.datetime.now().strftime(
                        "%Y-%m-%d %H:%M")

                    tmp = ''
                    for y in ordering:
                        tmp = tmp + y + ','
                    p['ordering'] = tmp[0:-1]

                    #save in DB
                    DataAccess().save(p)
        def run(self):
            for i in self.Seq:
                for case in self.Cases:
                    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)))
                    outputfilename = os.path.join(Config().readConfigEntry('bonnmotionpath'), Config().readConfigEntry('tempoutputname') + str(i))    

                    if 'appparams' in case:
                        runBonnmotionApp(Config().readConfigEntry('bonnmotionpath'), i, self.App, case['appparams'])
                    else:
                        runBonnmotionApp(Config().readConfigEntry('bonnmotionpath'), i, self.App, '')
                    ordering = []
                    content = ''
                    for ext in case['extensions']:
                        ordering.append(ext)
                        #open file
                        f = open(outputfilename + '.' + ext)
                        content = content + f.read()
                        f.close()    

                    #read parameters
                    f2 = open(paramsfilename)
                    params = f2.read()
                    f2.close()

                    p = {}
                    if 'appparams' in case:
                        p['appparameters'] = case['appparams']
                    else:
                        p['appparameters'] = ''
                    p['identifier'] = self.App
                    p['bmparamsfile'] = params
                    Hashes().calcHashes(p, content)
                    p['user'] = getpass.getuser()
                    p['datetime'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M")

                    tmp = ''
                    for y in ordering:
                        tmp = tmp + y + ','
                    p['ordering'] = tmp[0:-1]

                    #save in DB
                    DataAccess().save(p)  
Example #4
0
        def run(self):
            j = 0
            for i in self.Seq:
                paramsfilename = os.path.join(
                    Config().readConfigEntry('bonnmotionvalidatepath'),
                    Config().readConfigEntry('tempoutputparamsfile').replace(
                        'INDEX', str(i.no)))
                movementsfilename = os.path.join(
                    Config().readConfigEntry('bonnmotionvalidatepath'),
                    Config().readConfigEntry(
                        'tempoutputmovementsfile').replace('INDEX', str(i.no)))
                outputfilename = os.path.join(
                    Config().readConfigEntry('bonnmotionvalidatepath'),
                    Config().readConfigEntry('tempoutputname') + str(i.no))

                if len(i.appparameters) > 0:
                    runBonnmotionApp(
                        Config().readConfigEntry('bonnmotionvalidatepath'),
                        i.no, i.identifier, i.appparameters)
                else:
                    runBonnmotionApp(
                        Config().readConfigEntry('bonnmotionvalidatepath'),
                        i.no, i.identifier, '')

                content = ''

                spliting = i.ordering.split(',')
                if len(spliting) > 1:  #the app creates more than 1 file
                    for ext in spliting:
                        if i.ordering != 'NULL':
                            f = open(outputfilename + '.' + ext)
                            content = content + f.read(
                            )  #concatenate content of all files created
                            f.close()
                else:  #the app creates only one file
                    if i.ordering != 'NULL':
                        f = open(outputfilename + '.' + i.ordering)
                        content = f.read()
                        f.close()

                if (i.md5 <> Hashes().md5(content)
                        or i.sha1 <> Hashes().sha1(content)):
                    f2 = open(
                        os.path.join(
                            Config().readConfigEntry('bonnmotionvalidatepath'),
                            Config().readConfigEntry(
                                'tempoutputparamsfile').replace(
                                    'INDEX', str(i.no))), 'r')
                    if i.appparameters != '':
                        self.ReturnValue.append('parameters of bonnmotion:\n' +
                                                f2.read() + '\nappname: ' +
                                                i.identifier +
                                                '\nparameters of the app:\n' +
                                                i.appparameters)
                    else:
                        self.ReturnValue.append(
                            'parameters of bonnmotion:\n' + f2.read() +
                            '\nappname: ' + i.identifier +
                            '\nparameters of the app: none\n')
                    f2.close()
                j += 1