self.dlg = dlg
self.parametres = parametres
self.val = False
- self.parametres['pathout'] = PathOut(tableau.parametres['originalpath'], analyse_type = self.parametres['type'], dirout = tableau.parametres['pathout']).mkdirout()
+ print self.parametres
if not 'pathout' in self.parametres :
- self.pathout = PathOut(tableau.parametres['originalpath'], analyse_type = self.parametres['type'], dirout = tableau.parametres['pathout'])
+ self.parametres['pathout'] = PathOut(tableau.parametres['originalpath'], analyse_type = self.parametres['type'], dirout = tableau.parametres['pathout']).mkdirout()
+ print self.parametres
+ self.pathout = PathOut(analyse_type = self.parametres['type'], dirout = self.parametres['pathout'])
+ print self.pathout.dirout
else :
self.pathout = PathOut(filename = tableau.parametres['originalpath'], dirout = self.parametres['pathout'], analyse_type = self.parametres['type'])
else :
result_analyse = False
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.addMatrixAnalyse(self.parametres)
+ if self.parametres.get('tohistory', True) :
+ 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.addMatrixAnalyse(self.parametres)
if self.dlg is not None :
self.dlg.Destroy()
- OpenAnalyse(self.parent, self.parametres['ira'])
- self.ira.tree.AddMatAnalyse(self.parametres)
+ if self.parametres.get('tohistory', True) :
+ OpenAnalyse(self.parent, self.parametres['ira'])
+ self.ira.tree.AddMatAnalyse(self.parametres)
self.val = 5100
else :
self.val = False
fgSizer5.Add( self.radio_other_dict, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
self.otherdictpath = wx.FilePickerCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, _(u"Select a file").decode('utf8'), u"*.*", wx.DefaultPosition, wx.Size( 300,-1 ), wx.FLP_DEFAULT_STYLE )
+ self.otherdictpath.SetMinSize(wx.Size(300, -1))
fgSizer5.Add( self.otherdictpath, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
+ self.otherdictpath.Enable( False )
bSizer2.Add( fgSizer5, 1, wx.EXPAND, 5 )
# Connect Events
self.Bind(wx.EVT_BUTTON, self.OnChangeDir, self.m_button1)
self.lang_choices.Bind( wx.EVT_CHOICE, self.OnChangeLangage )
- self.radio_other_dict.Bind( wx.EVT_RADIOBUTTON, self.changedictchoice )
+ self.radio_other_dict.Bind( wx.EVT_RADIOBUTTON, self.changedictchoice )
+ self.radio_default_dict.Bind( wx.EVT_RADIOBUTTON, self.changedictchoice )
+ self.otherdictpath.Bind( wx.EVT_FILEPICKER_CHANGED, self.selectdict)
self.setparametres(parametres)
self.SetSizer( bSizer1 )
self.check_tirets.SetValue(parametres['tiret'])
self.check_tolist.SetValue(parametres['tolist'])
self.check_ponct.SetValue(parametres['keep_ponct'])
+ self.defaultdictpath.SetValue(self.langues[0])
def doparametres(self) :
parametres = {}
parametres['tiret'] = self.check_tirets.GetValue()
parametres['tolist'] = self.check_tolist.GetValue()
parametres['keep_ponct'] = self.check_ponct.GetValue()
+ if self.radio_other_dict.GetValue() :
+ parametres['dictionary'] = self.otherdictpath.GetPath()
for val in parametres :
if isinstance(parametres[val], bool) :
if parametres[val] :
return parametres
def OnChangeLangage(self, evt):
- pass
+ self.defaultdictpath.SetValue(self.langues[self.lang_choices.GetSelection()])
def changedictchoice(self, evt):
- pass
+ if self.radio_default_dict.GetValue() :
+ self.otherdictpath.Enable( False )
+ self.m_sdbSizer1OK.Enable( True )
+ else :
+ self.otherdictpath.Enable( True )
+ if self.otherdictpath.GetPath() == '' :
+ self.m_sdbSizer1OK.Enable( False )
+
+ def selectdict(self, evt):
+ if self.otherdictpath.GetPath() != '' :
+ self.m_sdbSizer1OK.Enable( True )
+
class ConcordList(wx.HtmlListBox):
from functions import exec_rcode, check_Rresult
from dialog import FreqDialog
from PrintRScript import PrintRScript
+from tableau import Tableau
class SplitMatrixFromVar(AnalyseMatrix):
def doparametres(self, dlg=None) :
if val == wx.ID_OK :
self.parametres['colsel'] = dial.m_listBox1.GetSelections()
self.parametres['header'] = dial.header
+ self.parametres['tohistory'] = False
else :
self.parametres = None
dial.Destroy()
def doanalyse(self):
newtabs = self.tableau.splitfromvar(self.parametres['colsel'][0])
for mod in newtabs :
- fout = self.tableau.pathout['%s.csv' % mod].replace(u'*','')
- with open(fout, 'w') as f :
- f.write('\n'.join(['\t'.join(line) for line in newtabs[mod]]).encode(self.parent.syscoding))
- print 'done!'
\ No newline at end of file
+ tab = Tableau(self.ira, os.path.join(self.tableau.pathout['%s.csv' % mod]).replace(u'*',''))
+ if not os.path.exists(tab.pathout.dirout) :
+ os.mkdir(tab.pathout.dirout)
+ tab.linecontent = newtabs[mod]
+ tab.make_content_simple()
+ tab.parametres['matrix'] = tab.parametres['uuid']
+ self.ira.tree.OnItemAppend(tab.parametres, select = False)
\ No newline at end of file