X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=iramuteq.py;h=53667d42b4f3ab040e8eb08528e18eddf25b2224;hp=ed574e4d0b4f29d2811f407a5d7bce9803b192be;hb=5fe741965178c0b1728560ee8787a26ce903f142;hpb=12b4b71c8c8feb6154abc04dfa9bb93a521ef789 diff --git a/iramuteq.py b/iramuteq.py index ed574e4..53667d4 100644 --- a/iramuteq.py +++ b/iramuteq.py @@ -124,16 +124,15 @@ CreateIraDirectory(UserConfigPath, AppliPath) #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() != '' : @@ -148,6 +147,10 @@ sys.stderr = writer() sys.stdout = printer() ConfigPath = ConstructConfigPath(UserConfigPath) + + +langues = {'french' : wx.LANGUAGE_FRENCH, + 'english' : wx.LANGUAGE_ENGLISH,} ##################################################################### class IraFrame(wx.Frame): @@ -170,14 +173,10 @@ class IraFrame(wx.Frame): #workaround for import problem self.SimiFromCluster = SimiFromCluster #langues - mylocale = wx.Locale(wx.LANGUAGE_FRENCH) - mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale')) - mylocale.AddCatalog('iramuteq') - presLan_en = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['en']) - presLan_fr = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['fr_FR']) - presLan_fr.install() - - + gettext.install('iramuteq', os.path.join(AppliPath,'locale'), unicode=True) + self.presLan_fr = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['fr_FR']) + self.presLan_en = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['en']) + self.setlangue() # tell FrameManager to manage this frame #self._mgr = wx.aui.AuiManager() self._mgr = aui.AuiManager() @@ -488,6 +487,24 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" dlg.Destroy() + def setlangue(self) : + try : + self.pref.read(self.ConfigPath['preferences']) + guilangue = self.pref.get('iramuteq', 'guilanguage') + if guilangue == 'french' : + self.presLan_fr.install() + else : + self.presLan_en.install() + mylocale = wx.Locale(langues[guilangue]) + mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale')) + mylocale.AddCatalog('iramuteq') + except : + self.presLan_fr.install() + mylocale = wx.Locale(langues['french']) + mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale')) + mylocale.AddCatalog('iramuteq') + + def OnVerif(self, evt) : pack = CheckRPackages(self) if pack : @@ -496,7 +513,6 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]: evt.Veto() - #FIXME marche pas sous mac ? def DisEnSaveTabAs(self, DISEN): #Disable SaveTabAs file_menu = self.mb.GetMenu(0) @@ -970,6 +986,9 @@ Voulez-vous fermer quand même ?""" 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 :