- with open(self.pathout['selected.csv'],'r') as f :
- selected = f.read()
- selected = [int(val) for val in selected.splitlines()]
- if self.actives is None :
- with codecs.open(self.pathout['actives.csv'], 'r', self.parametres['encoding']) as f :
- self.actives = f.read()
- self.actives = self.actives.splitlines()#[act for act in self.actives.splitlines()]
- if os.path.exists(self.pathout['actives_nb.csv']) :
- with open(self.pathout['actives_nb.csv'], 'r') as f :
- act_nb = f.read()
- act_nb = act_nb.splitlines()
- dictcol = dict([[i, [self.actives[i], int(act_nb[i])]] for i, val in enumerate(self.actives)])
- else :
- dictcol = dict([[i, [act, self.corpus.getlemeff(act)]] for i, act in enumerate(self.actives)])
- #res = SelectColumn(self.ira, dictcol, self.actives, self.pathout['selected.csv'], selected = selected, dlg = True)
- #if res.ok :
- prep = PrepSimi(self.ira, self, self.parametres,self.pathout['selected.csv'], self.actives, indices_simi, wordlist = dictcol, selected = selected)
- if prep.val == wx.ID_OK :
- self.parametres = prep.parametres
-
- script = PrintSimiScript(self)
- script.make_script()
- pid = exec_rcode(self.ira.RPath, script.scriptout, wait = True)
- check_Rresult(self.ira, pid)
- if self.parametres['type_graph'] in [1,3] :
- if self.parametres['svg'] :
- filename, ext = os.path.splitext(script.filename)
- fileout = filename + '.svg'
- elif self.parametres['type_graph'] == 3 :
- fileout = script.filename
- parametres = {'gexffile' : fileout,
- 'dirout' : os.path.dirname(fileout),
- 'titre': 'Le titre',
- #'nodemin': self.param['txt_min'],
- #'nodemax': self.param['txt_max'],
- #'bargraphw' : 60*int(self.param['clnb']),
- }
- web = WebExport(self.ira, parametres)
- fileout = web.exportsimi()
- else :
- fileout = script.filename
- if os.path.exists(self.pathout['liste_graph']):
- graph_simi = read_list_file(self.pathout['liste_graph'])
- graph_simi.append([os.path.basename(fileout), script.txtgraph])
- else :
- graph_simi = [[os.path.basename(fileout), script.txtgraph]]
- print_liste(self.pathout['liste_graph'], graph_simi)
- DoConf().makeoptions([self.parametres['type']], [self.parametres], self.pathout['Analyse.ira'])
- if self.parametres['type_graph'] in [1,3] :
- if self.parametres['svg'] or self.parametres['type_graph'] == 3 :
- self.graphpan.sizer_3.Add(hl.HyperLinkCtrl(self.graphpan.panel_1, -1, fileout, URL = fileout), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
- else :
- self.graphpan.sizer_3.Add(wx.StaticBitmap(self.graphpan.panel_1, -1, wx.Bitmap(fileout, wx.BITMAP_TYPE_ANY)), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
- self.graphpan.sizer_3.Add(wx.StaticText(self.graphpan.panel_1,-1, script.txtgraph), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
- self.graphpan.sizer_3.Fit(self.graphpan.panel_1)
- self.graphpan.Layout()
- self.graphpan.panel_1.Scroll(0,self.graphpan.panel_1.GetScrollRange(wx.VERTICAL))
+ redosimi(self, evt)
+# with open(self.pathout['selected.csv'],'r') as f :
+# selected = f.read()
+# selected = [int(val) for val in selected.splitlines()]
+# if self.actives is None :
+# with codecs.open(self.pathout['actives.csv'], 'r', self.parametres['encoding']) as f :
+# self.actives = f.read()
+# self.actives = self.actives.splitlines()#[act for act in self.actives.splitlines()]
+# if os.path.exists(self.pathout['actives_nb.csv']) :
+# with open(self.pathout['actives_nb.csv'], 'r') as f :
+# act_nb = f.read()
+# act_nb = act_nb.splitlines()
+# dictcol = dict([[i, [self.actives[i], int(act_nb[i])]] for i, val in enumerate(self.actives)])
+# else :
+# dictcol = dict([[i, [act, self.corpus.getlemeff(act)]] for i, act in enumerate(self.actives)])
+# #res = SelectColumn(self.ira, dictcol, self.actives, self.pathout['selected.csv'], selected = selected, dlg = True)
+# #if res.ok :
+# prep = PrepSimi(self.ira, self, self.parametres,self.pathout['selected.csv'], self.actives, indices_simi, wordlist = dictcol, selected = selected)
+# if prep.val == wx.ID_OK :
+# self.parametres = prep.parametres
+#
+# script = PrintSimiScript(self)
+# script.make_script()
+# pid = exec_rcode(self.ira.RPath, script.scriptout, wait = True)
+# check_Rresult(self.ira, pid)
+# if self.parametres['type_graph'] in [1,3] :
+# if self.parametres['svg'] :
+# filename, ext = os.path.splitext(script.filename)
+# fileout = filename + '.svg'
+# elif self.parametres['type_graph'] == 3 :
+# fileout = script.filename
+# parametres = {'gexffile' : fileout,
+# 'dirout' : os.path.dirname(fileout),
+# 'titre': 'Le titre',
+# #'nodemin': self.param['txt_min'],
+# #'nodemax': self.param['txt_max'],
+# #'bargraphw' : 60*int(self.param['clnb']),
+# }
+# web = WebExport(self.ira, parametres)
+# fileout = web.exportsimi()
+# else :
+# fileout = script.filename
+# if os.path.exists(self.pathout['liste_graph']):
+# graph_simi = read_list_file(self.pathout['liste_graph'])
+# graph_simi.append([os.path.basename(fileout), script.txtgraph])
+# else :
+# graph_simi = [[os.path.basename(fileout), script.txtgraph]]
+# print_liste(self.pathout['liste_graph'], graph_simi)
+# DoConf().makeoptions([self.parametres['type']], [self.parametres], self.pathout['Analyse.ira'])
+# if self.parametres['type_graph'] in [1,3] :
+# if self.parametres['svg'] or self.parametres['type_graph'] == 3 :
+# self.graphpan.sizer_3.Add(hl.HyperLinkCtrl(self.graphpan.panel_1, -1, fileout, URL = fileout), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
+# else :
+# self.graphpan.sizer_3.Add(wx.StaticBitmap(self.graphpan.panel_1, -1, wx.Bitmap(fileout, wx.BITMAP_TYPE_ANY)), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
+# self.graphpan.sizer_3.Add(wx.StaticText(self.graphpan.panel_1,-1, script.txtgraph), 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
+# self.graphpan.sizer_3.Fit(self.graphpan.panel_1)
+# self.graphpan.Layout()
+# self.graphpan.panel_1.Scroll(0,self.graphpan.panel_1.GetScrollRange(wx.VERTICAL))