From: pierre Date: Mon, 12 Feb 2024 16:00:10 +0000 (+0100) Subject: Merge branch '3.0' of http://www.iramuteq.org/git/iramuteq into 3.0 X-Git-Url: http://www.iramuteq.org/git?a=commitdiff_plain;h=e6f6318b1ab077a97c10559b3323ccf158ae6203;hp=-c;p=iramuteq Merge branch '3.0' of iramuteq.org/git/iramuteq into 3.0 --- e6f6318b1ab077a97c10559b3323ccf158ae6203 diff --combined iramuteq.py index 5c61d5b,d0bfb72..a8afd32 --- a/iramuteq.py +++ b/iramuteq.py @@@ -56,6 -56,7 +56,7 @@@ from tabfrequence import Frequences, Fr from tableau import Tableau from tabrsimple import InputText from tabsimi import DoSimi + from tabcatego import Categorisation from tabsplitvar import SplitMatrixFromVar from tabverges import Prototypical from textaslexico import Lexico @@@ -93,6 -94,7 +94,7 @@@ ID_CHECKCORPUS = wx.Window.NewControlId ID_Tabcontent = wx.Window.NewControlId() ID_AFCM = wx.Window.NewControlId() ID_SIMI = wx.Window.NewControlId() + ID_CATE = wx.Window.NewControlId() ID_CloseTab = wx.Window.NewControlId() ID_SaveTab = wx.Window.NewControlId() ID_CreateText = wx.Window.NewControlId() @@@ -182,8 -184,8 +184,8 @@@ class printer(object) def flush(self): pass - sys.stderr = writer() - sys.stdout = printer() + #sys.stderr = writer() + #sys.stdout = printer() images_analyses = { 'textroot' : 'textroot.png', @@@ -217,7 -219,8 +219,8 @@@ 'preferences' : 'preferences.png', 'exportmetatable' : 'exportmetatable.png', 'importdmi' : 'twitter.png', - 'labbe' : 'spec.png' + 'labbe' : 'spec.png', + 'categorisation' : 'spec.png', } @@@ -235,8 -238,9 +238,10 @@@ class IraFrame(wx.Frame) wx.CLIP_CHILDREN): log.info('Starting Iramuteq... ' ) log.info('version : %s' % ConfigGlob.get('DEFAULT', 'version')) + print(size) wx.Frame.__init__(self, parent, id, title, pos, size, style) + #Font + self.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL)) # configuration self.AppliPath = AppliPath self.images_path = os.path.join(AppliPath,'images') @@@ -352,6 -356,7 +357,7 @@@ [ID_SIMI, _("Similarities Analysis"), 'simimatrix'], [ID_proto, _("Prototypical Analysis"), 'proto'], [ID_Splitfromvar, _("Split from variable"), 'subcorpusmeta'], + [ID_CATE, _("ElCaTeGoRiZatoR"), 'categorisation'], ] for analyse in matanalyses : if not isinstance(analyse, dict) : @@@ -427,7 -432,7 +433,7 @@@ # min size for the frame itself isn't completely done. # see the end up FrameManager::Update() for the test # code. For now, just hard code a frame minimum size - self.SetMinSize(wx.Size(400, 400)) + self.SetMinSize(wx.Size(800, 600)) #-------------------------------------------------------------------- # barre d'outils : le menu de petits icones en haut de la fenetre @@@ -489,10 -494,10 +495,10 @@@ #------------------------------------------------------------------------------------------------ # fichier d'historique de Iramuteq #------------------------------------------------------------------------------------------------ - #if not os.path.exists(os.path.join(UserConfigPath, 'history.db')) : - # with open(os.path.join(UserConfigPath, 'history.db'), 'w') as f : - # f.write('') - self.history = History(os.path.join(UserConfigPath, 'historyIramuteq')) + if not os.path.exists(os.path.join(UserConfigPath, 'history.db')) : + with open(os.path.join(UserConfigPath, 'history.db'), 'w') as f : + f.write('{}') + self.history = History(os.path.join(UserConfigPath, 'history.db')) # l'extension ".db" est ajoutée automatiquement par le module #------------------------------------------------------------------------------------------------ @@@ -505,7 -510,7 +511,7 @@@ Name("lefttree"). Caption(_("Historic")). Left(). - MinSize(wx.Size(200,500)). + MinSize(wx.Size(300,400)). Layer(1). Position(1). CloseButton(False). @@@ -603,6 -608,7 +609,7 @@@ self.Bind(wx.EVT_MENU, self.OnAFCM, id=ID_AFCM) self.Bind(wx.EVT_MENU, self.OnProto, id=ID_proto) self.Bind(wx.EVT_MENU, self.OnSplitVar, id = ID_Splitfromvar) + self.Bind(wx.EVT_MENU, self.OnCategorisation, id = ID_CATE) #self.Bind(wx.EVT_MENU, self.OnRCode, id=ID_RCODE) #??? #self.Bind(wx.EVT_MENU, self.OnSplitVar, id=ID_SPLITVAR) #??? #self.Bind(wx.EVT_MENU, self.OnCheckcorpus, id = ID_CHECKCORPUS) #??? @@@ -701,9 -707,10 +708,14 @@@ BestRPath = False if not CheckRPath(self.PathPath) : if sys.platform == 'win32': - BestRPath = FindRPAthWin32() - if os.path.exists(self.AppliPath + '\\R\\R') : ++ if os.path.exists(self.AppliPath + '\\R\\R\\x64\\R.exe') : + BestRPath = self.AppliPath + '\\R\\R\\bin\\x64\\R.exe' ++ elif os.path.exists(self.AppliPath + '\\R\\R\\i386\\R.exe') : ++ BestRPath = self.AppliPath + '\\R\\R\\bin\\i386\\R.exe' + else : + BestRPath = FindRPAthWin32() + elif os.path.exists(self.AppliPath + '/R/R') : + BestRPath = self.AppliPath + '/R/R' else: BestRPath = FindRPathNix() if BestRPath: @@@ -759,7 -766,7 +771,7 @@@ if not menu_pos is None : self.mb.EnableTop(menu_pos, Show) self.mb.Refresh() - self._mgr.Update() + #self._mgr.Update() #-------------------------------------------------------------------- # fin de __init__ du wx.Frame @@@ -913,13 -920,16 +925,16 @@@ Inc., 59 Temple Place - Suite 330, Bost if isinstance(parent, IraFrame) : npage = self.nb.GetPage(new) if 'parametres' in dir(npage) : - self.tree.GiveFocus(uuid=npage.parametres['uuid']) + #self.tree.GiveFocus(uuid=npage.parametres['uuid']) if npage.parametres.get('matrix', False) : self.ShowMenu('text', False) self.ShowMenu('matrix', True) elif npage.parametres.get('corpus', False) : self.ShowMenu('text') self.ShowMenu('matrix', False) + #self._mgr.Update() + #wx.CallAfter(self.nb.SendSizeEvent) + #self.Refresh() # action ou évènement ? def OnCloseTab(self, evt): @@@ -961,6 -971,9 +976,9 @@@ pane.Hide() self._mgr.GetPane(panel).Show() self._mgr.Update() + print('show a pane refresh') + wx.CallAfter(self.nb.SendSizeEvent) + self.Refresh() # action ou évènement ? def OnAcceuil(self, event): @@@ -1010,6 -1023,10 +1028,10 @@@ def OnSimiTab(self, event, matrix = None): self.analyse_matrix(DoSimi, matrix = matrix, analyse_type = 'simimatrix', dlgnb = 5) + def OnCategorisation(self, event, matrix = None) : + self.analyse_matrix(Categorisation, matrix = matrix, analyse_type = 'categorisation', dlgnb = 1) + + def OnCHDReinert(self, event, matrix = None): #if matrix is None : # matrix = self.tree.getmatrix()