X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=analysematrix.py;fp=analysematrix.py;h=1a14c4a082e563a41cf06a36c6ca116a3a478e46;hp=0000000000000000000000000000000000000000;hb=7fb5b2b86f6c9a0617208ee85211177c23d12f47;hpb=22f93a602f3584ddc6ba68114556212c90307a50 diff --git a/analysematrix.py b/analysematrix.py new file mode 100644 index 0000000..1a14c4a --- /dev/null +++ b/analysematrix.py @@ -0,0 +1,60 @@ +#!/bin/env python +# -*- coding: utf-8 -*- +#Author: Pierre Ratinaud +#Copyright (c) 2013 Pierre Ratinaud +#Lisense: GNU GPL + + + +import logging +import os +from time import time +from uuid import uuid4 + + +from chemins import PathOut +from functions import exec_rcode, check_Rresult, DoConf +from time import time, sleep +from openanalyse import OpenAnalyse + +class AnalyseMatrix : + def __init__(self, ira, tableau, parametres = None, dlg = False) : + self.tableau = tableau + self.ira = ira + self.parent = ira + self.dlg = dlg + self.parametres = parametres + self.val = False + if not 'pathout' in self.parametres : + self.pathout = PathOut(tableau.parametres['filename'], analyse_type = parametres['type'], dirout = parametres['pathout']) + else : + self.pathout = PathOut(filename = tableau.parametres['filename'], dirout = self.parametres['pathout'], analyse_type = self.parametres['type']) + + self.parametres['pathout'] = self.pathout.dirout + self.parametres['uuid'] = str(uuid4()) + self.parametres['name'] = os.path.split(self.parametres['pathout'])[1] + self.parametres['encoding'] = self.ira.syscoding + + self.t1 = time() + result_analyse = self.doanalyse() + if result_analyse is None : + self.time = time() - self.t1 + minutes, seconds = divmod(self.time, 60) + hours, minutes = divmod(minutes, 60) + self.parametres['time'] = '%.0fh %.0fm %.0fs' % (hours, minutes, seconds) + self.parametres['ira'] = self.pathout['Analyse.ira'] + DoConf().makeoptions([self.parametres['type']], [self.parametres], self.pathout['Analyse.ira']) + self.ira.history.addMatrix(self.parametres) + if dlg : + dlg.Destroy() + OpenAnalyse(self.parent, self.parametres['ira']) + #self.ira.tree.AddAnalyse(self.parametres) + self.val = 5100 + else : + self.val = False + if dlg : + dlg.Destroy() + + def doanalyse(self) : + pass +