Merge branch 'master' of http://www.netdig.org/git/iramuteq
authorpierre <ratinaud@univ-tlse2.fr>
Mon, 28 Jan 2013 23:08:23 +0000 (00:08 +0100)
committerpierre <ratinaud@univ-tlse2.fr>
Mon, 28 Jan 2013 23:08:23 +0000 (00:08 +0100)
1  2 
iramuteq.py

diff --combined iramuteq.py
@@@ -53,13 -53,13 +53,13 @@@ from tabverges import Verge
  #from textafcuci import AfcUci
  #from textchdalc import AnalyseAlceste
  from analysetxt import Alceste
- from textdist import PamTxt
+ from textdist import AnalysePam
  from textstat import Stat
  from textaslexico import Lexico
  from textsimi import SimiTxt, SimiFromCluster
  from textwordcloud import WordCloud
  from profile_segment import ProfileSegment
- from textcheckcorpus import checkcorpus
#from textcheckcorpus import checkcorpus
  from openanalyse import OpenAnalyse
  from corpus import BuildFromAlceste, Builder
  from sheet import MySheet
@@@ -124,15 -124,16 +124,15 @@@ CreateIraDirectory(UserConfigPath, Appl
  #fichiers log pour windows (py2exe)
  log = logging.getLogger('iramuteq')
  fh = logging.FileHandler(os.path.join(UserConfigPath,'stdout.log'))
 -ch = logging.StreamHandler()
  formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
 -ch.setFormatter(formatter)
  fh.setFormatter(formatter)
  log.addHandler(fh)
 -if sys.platform != 'win32' or sys.platform != 'darwin':
 +if sys.platform != 'win32' and sys.platform != 'darwin':
 +    ch = logging.StreamHandler()
 +    ch.setFormatter(formatter)
      log.addHandler(ch)
  log.setLevel(logging.INFO)
  
 -
  class writer(object):
      def write(self, data):
          if data.strip() != '' :
@@@ -239,7 -240,7 +239,7 @@@ class IraFrame(wx.Frame)
          analyse_menu.Append(ID_Chi2, u"Chi2")
          #analyse_menu.Append(ID_Student, u"t de Student")
          menu_classif = wx.Menu()
-         menu_classif.Append(ID_CHDAlceste, u"Méthode Alceste")
+         menu_classif.Append(ID_CHDAlceste, u"Méthode GNEPA")
          menu_classif.Append(ID_CHDSIM, u"Par matrice des distances")
          analyse_menu.AppendMenu(-1, u"Classification", menu_classif)
          analyse_menu.Append(ID_AFCM, u"AFCM")
          analyse_menu.Append(ID_RCODE, u"Code R...")
  
          text_menu = wx.Menu()
-         text_menu.Append(ID_CHECKCORPUS, u"Vérifier le corpus")
+         #text_menu.Append(ID_CHECKCORPUS, u"Vérifier le corpus")
          text_menu.Append(ID_TEXTSTAT, u"Statistiques textuelles")
          text_menu.Append(ID_ASLEX, u"Spécificités et AFC")
          #text_menu.Append(ID_TEXTAFCM, u"AFC sur UCI / Vocabulaire")
          menu_classiftxt = wx.Menu()
-         menu_classiftxt.Append(ID_TEXTALCESTE, u"Méthode Alceste")
+         menu_classiftxt.Append(ID_TEXTALCESTE, u"Méthode GNEPA")
          menu_classiftxt.Append(ID_TEXTPAM, u"Par matrice des distances")
          text_menu.AppendMenu(-1, u"Classification", menu_classiftxt)
          text_menu.Append(ID_SimiTxt, u'Analyse de similitude') 
          self.Bind(wx.EVT_MENU, self.OnCHDAlceste, id=ID_CHDAlceste)
          self.Bind(wx.EVT_MENU, self.OnAFCM, id=ID_AFCM)
          self.Bind(wx.EVT_MENU, self.OnRCode, id=ID_RCODE)
-         self.Bind(wx.EVT_MENU, self.OnCheckcorpus, id = ID_CHECKCORPUS)
+         #self.Bind(wx.EVT_MENU, self.OnCheckcorpus, id = ID_CHECKCORPUS)
          self.Bind(wx.EVT_MENU, self.OnTextStat, id=ID_TEXTSTAT)
          self.Bind(wx.EVT_MENU, self.OnTextSpec, id=ID_ASLEX)
          self.Bind(wx.EVT_MENU, self.OnTextAfcm, id=ID_TEXTAFCM)
          if self.SysEncoding == 'mac-roman' : self.SysEncoding = 'MacRoman'
          self.type = ''
  
+ ##############################################################@
+         self.DisEnSaveTabAs(False)
+         self.ShowMenu(_("View"), False)
+         self.ShowMenu(_("Spreadsheet analysis"), False)
+         self.ShowMenu(_("Text analysis"), False)
+    
+         self._mgr.Update()
+         self.DataPop = False
+         self.DataTxt = False
+         self.Text = ''
+         self.lexique = None
+         self.corpus = None
+     def finish_init(self) :
          try :
              self.pref.read(self.ConfigPath['preferences'])
              if IsNew(self) :
              UpgradeConf(self)
              self.pref.read(self.ConfigPath['preferences'])
              New = True
+         self.sound = self.pref.getboolean('iramuteq', 'sound')
+         self.check_update = self.pref.getboolean('iramuteq', 'checkupdate')
+         self.version = ConfigGlob.get('DEFAULT', 'version')
          #configuration des chemins de R
          self.PathPath = ConfigParser()
          self.PathPath.read(ConfigPath['path'])
@@@ -466,21 -486,7 +485,7 @@@ vous devez signaler le chemin de l'éxe
              if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
                   evt.Veto()
              dlg.Destroy()
-         self.DataPop = False
-         self.DataTxt = False
-         self.Text = ''
-         self.sound = self.pref.getboolean('iramuteq', 'sound')
-         self.check_update = self.pref.getboolean('iramuteq', 'checkupdate')
-         self.version = ConfigGlob.get('DEFAULT', 'version')
-         self.lexique = None
-         self.corpus = None
- ##############################################################@
-         self.DisEnSaveTabAs(False)
-         self.ShowMenu(_("View"), False)
-         self.ShowMenu(_("Spreadsheet analysis"), False)
-         self.ShowMenu(_("Text analysis"), False)
-    
-         self._mgr.Update()
  
      def OnVerif(self, evt) :
          pack = CheckRPackages(self)
@@@ -881,11 -887,11 +886,11 @@@ Voulez-vous fermer quand même ?""
          except:
              BugReport(self)
  
-     def OnCheckcorpus(self, evt):
-         try :
-             checkcorpus(self)
-         except :
-             BugReport(self)
#    def OnCheckcorpus(self, evt):
#        try :
#            checkcorpus(self)
#        except :
#            BugReport(self)
  
      def OnTextStat(self, event, corpus = None):
              print 'PAS DE BUG SUR TEXT STAT'
          except:
              BugReport(self)
  
-     def OnPamSimple(self, event):
+     def OnPamSimple(self, event, corpus = None):
          try:
-             self.Text = PamTxt(self)
+             if corpus is None :
+                 corpus = self.tree.getcorpus()
+             self.Text = AnalysePam(self, corpus, parametres = {'type' : 'pamtxt'}, dlg = progressbar(self,6))
              if self.Text.val == wx.ID_OK:
                  PlaySound(self)
          except:
              BugReport(self)
+     def SimiCluster(self, parametres = {}, fromprof = False, pathout = '', listactives = [], actives = [], tableau = None) :
+         DoSimi(self, param = parametres, fromprof =  fromprof, pathout = pathout, listactives = listactives, actives = actives, tableau = tableau)
      
      def OnSimi(self,evt):
-         try :
+         #try :
              #print 'ATTENTION !!!! VERGES'
+             print 'PLUS DE BUG SUR SIMI'
              self.res = DoSimi(self, param = None)
              #self.res = Verges(self)
              if self.res.val == wx.ID_OK :
                   PlaySound(self)
-         except :
-             BugReport(self)
+         #except :
+         #    BugReport(self)
  #################################################################
  
      def OnHelp(self, event):
@@@ -1147,6 -1159,7 +1158,7 @@@ class MySplashScreen(wx.SplashScreen)
      def ShowMain(self):
          frame = IraFrame(None, -1, "IRaMuTeQ " + ConfigGlob.get('DEFAULT', 'version'), size=(1100, 800))
          frame.Show()
+         frame.finish_init()
          frame.Upgrade()
          frame.OnOpenFromCmdl()
  #        if self.fc.IsRunning():