X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=functions.py;h=e93f34ed930c2f8679baa50204ca6568f6bc786f;hp=d697f1623eaa9fb46e3bee34213491b8b6347d27;hb=9420002b21cada767db876f972f6083fc542ccd2;hpb=f6e6d1cea58fe1e16aee1c8630367a890df82cea diff --git a/functions.py b/functions.py index d697f16..e93f34e 100644 --- a/functions.py +++ b/functions.py @@ -55,6 +55,7 @@ class TGen : def writetable(self, pathout, tgens, totocc): etoiles = totocc.keys() + etoiles.sort() with open(pathout, 'w') as f : line = '\t'.join([u'tgens'] + etoiles) + '\n' f.write(line.encode(self.encoding)) @@ -66,7 +67,7 @@ class TGen : while totname + `i` in tgens : i += 1 totname = totname + `i` - line = '\t'.join([totname] + [`totocc[et]` for et in etoiles]) + line = '\t'.join([totname] + [`totocc[et]` for et in etoiles]) + '\n' f.write(line.encode(self.encoding)) class History : @@ -252,8 +253,8 @@ class DoConf : txt += '%s = %s\n' % (option, `parametres[i][option]`) if outfile is None : outfile = self.configfile - with codecs.open(outfile, 'w', 'utf8') as f : - f.write(txt) + with open(outfile, 'w') as f : + f.write(txt.encode('utf8')) #self.conf.write(f) def totext(self, parametres) : @@ -674,6 +675,11 @@ def progressbar(self, maxi) : parent = self.parent else : parent = self + try : + print '###horrible hack progressbar' + maxi = int(maxi) + except : + maxi = 1 return wx.ProgressDialog("Traitements", "Veuillez patienter...", maximum=maxi,