X-Git-Url: http://www.iramuteq.org/git?a=blobdiff_plain;f=layout.py;h=fec019793065d94813c773451540af3add2f7a8f;hb=af8c3ff85a3c867356cb6353ca0e9bfe414d5b76;hp=7c7edd987208589f26ca2521e1540dd45ad9215d;hpb=e6f6318b1ab077a97c10559b3323ccf158ae6203;p=iramuteq diff --git a/layout.py b/layout.py index 7c7edd9..fec0197 100644 --- a/layout.py +++ b/layout.py @@ -251,7 +251,7 @@ class GraphPanelAfc(wx.Panel): """ txt += write_afc_graph(self) filetmp = tempfile.mktemp() - with open(filetmp, 'w') as f : + with open(filetmp, 'w', encoding='utf8') as f : f.write(txt) pid = exec_rcode(self.ira.RPath, filetmp) check_Rresult(self.ira, pid) @@ -991,7 +991,7 @@ class GraphPanelDendro(wx.Panel): """ % (ffr(self.dictpathout['RData.RData']), ffr(self.ira.RscriptsPath['Rgraph']), ffr(fileout), width, height, svg, type_dendro, bw) tmpfile = tempfile.mktemp() # ecriture du fichier de script à éxécuter - with open(tmpfile, 'w') as f : + with open(tmpfile, 'w', encoding='utf8') as f : f.write(txt) # dialogue d'attente busy = wx.BusyInfo(_("Please wait..."), self.parent) @@ -1206,7 +1206,7 @@ def blender(self): """ # ecriture du fichier de script à éxécuter filetmp = tempfile.mktemp() - with open(filetmp, 'w') as f : + with open(filetmp, 'w', encoding='utf8') as f : f.write(txt) exec_rcode(self.ira.RPath, filetmp) GraphToJson(nodesfile, edgesfile, jsonout) @@ -1429,7 +1429,7 @@ class SimiMatLayout(DefaultMatLayout) : #self.parent.nb.SetSelection(self.parent.nb.GetPageCount() - 1) def redosimi(self,evt) : - with open(self.pathout['selected.csv'],'r') as f : + with open(self.pathout['selected.csv'],'r', encoding='utf8') as f : selected = f.read() selected = [int(val) for val in selected.splitlines()] #if self.actives is None : @@ -1442,6 +1442,7 @@ class SimiMatLayout(DefaultMatLayout) : actives = [[val, self.tableau.actives[val]] for val in self.tableau.actives] #self.tableau.make_listactives() actives = dict([[i, val] for i, val in enumerate(actives)]) + print(actives) #dictcol = dict([[i, [act, self.corpus.getlemeff(act)]] for i, act in enumerate(self.actives)]) self.dial = PrefSimi(self.parent, -1, self.parametres, self.indices, wordlist = actives, selected = selected, actives = self.tableau.listactives) self.dial.CenterOnParent() @@ -1456,7 +1457,7 @@ class SimiMatLayout(DefaultMatLayout) : indexes.append(self.dial.listcol.getColumnText(last,0)) self.column = [self.tableau.listactives.index(val) for val in indexes] self.column.sort() - with open(self.pathout['selected.csv'], 'w') as f : + with open(self.pathout['selected.csv'], 'w', encoding='utf8') as f : f.write('\n'.join([repr(val) for val in self.column])) self.make_param() self.dial.Destroy() @@ -1584,7 +1585,7 @@ class SimiMatLayout(DefaultMatLayout) : #saveAsGEXF(graph, filepath = fileout) """ % (ffr(self.pathout['RData.RData']), ffr(self.parent.RscriptsPath['simi']), fileout) filetmp = tempfile.mktemp() - with open(filetmp, 'w') as f : + with open(filetmp, 'w', encoding='utf8') as f : f.write(txt) exec_rcode(self.ira.RPath, filetmp) mss = wx.MessageDialog(self.ira, fileout, _('File exported'), wx.OK)