X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=functions.py;h=f38a5c523a1420370140730e29c00f31cdad6b13;hp=758f94b234a849243321b4e1bc374a3956cb39a9;hb=dcad0cc45b2c1eeda32cc42f3b40dd8e666e5dc3;hpb=3647a911117ea08f4f969720a16c58bcc7d4e809 diff --git a/functions.py b/functions.py index 758f94b..f38a5c5 100644 --- a/functions.py +++ b/functions.py @@ -35,7 +35,7 @@ def normpath_win32(path) : return path while '\\\\' in path : path = path.replace('\\\\', '\\') - if sys.platform == 'win32' and path.startswith('\\') and not path.startswith('\\\\') : + if path.startswith('\\') and not path.startswith('\\\\') : path = '\\' + path return path @@ -189,6 +189,19 @@ class History : def rmtab(self, analyse) : del self.opened[analyse['uuid']] + + def update(self, analyse) : + if 'matrix_name' in analyse : + self.matrixanalyse[analyse['uuid']].update(analyse) + elif 'corpus_name' in analyse : + self.corpus[analyse['uuid']].update(analyse) + elif 'corpus' in analyse : + self.analyses[analyse['uuid']].update(analyse) + else : + toupdate = [an for an in self.matrixanalyse[analyse['matrix']]['analyses'] if an['uuid'] == analyse['uuid']] + toupdate[0].update(analyse) + self.write() + self.read() def clean(self) : corpustodel = [corpus for corpus in self.history if not os.path.exists(corpus['ira'])] @@ -682,20 +695,21 @@ def read_list_file(filename, encoding = sys.getdefaultencoding()): def progressbar(self, maxi) : - if 'parent' in dir(self) : - parent = self.parent - else : - parent = self + ira = wx.GetApp().GetTopWindow() + parent = ira try : maxi = int(maxi) except : maxi = 1 - return wx.ProgressDialog("Traitements", + prog = wx.ProgressDialog("Traitements", "Veuillez patienter...", maximum=maxi, parent=parent, style=wx.PD_APP_MODAL | wx.PD_AUTO_HIDE | wx.PD_ELAPSED_TIME | wx.PD_CAN_ABORT ) + prog.SetIcon(ira._icon) + prog.SetSize((400,150)) + return prog def treat_var_mod(variables) :