X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=iramuteq.py;h=a75456387e82c2948241b7a935f0110ba43c8c9d;hp=fdf2ba022f69c899e4d206cad355955e8595f728;hb=0e02f9566eb56fcb0f16bd070248235f78093ff5;hpb=35feaa5dc8cbd055e732567e012780d88b92ffe5 diff --git a/iramuteq.py b/iramuteq.py index fdf2ba0..a754563 100644 --- a/iramuteq.py +++ b/iramuteq.py @@ -5,7 +5,6 @@ #License: GNU GPL from optparse import OptionParser -from wx import BusyCursor parser = OptionParser() parser.add_option("-f", "--file", dest="filename", @@ -94,6 +93,10 @@ ID_Splitfromvar = wx.NewId() ID_Subtxtfrommeta = wx.NewId() ID_Subtxtfromthem = wx.NewId() ID_WC = wx.NewId() +ID_ImportEuro = wx.NewId() +ID_Fact_xml = wx.NewId() +ID_Fact_mail = wx.NewId() +ID_Fact_copy = wx.NewId() ########################################################## #elements de configuration ########################################################## @@ -182,6 +185,12 @@ images_analyses = { 'simimatrix' : 'simimatrix.png', 'simiclustermatrix' : 'simimatrix.png', 'proto' : 'proto.png', + 'TXM' : 'TXM.png', + 'europress' : 'europress.png', + 'factiva_xml' : 'factiva_xml.png', + 'factiva_copy' : 'factiva_copy.png', + 'factiva_mail': 'factiva_mail.png', + 'iramuteq' : 'iraicone.png', } ##################################################################### @@ -240,23 +249,29 @@ class IraFrame(wx.Frame): file_menu.AppendItem(item) item = wx.MenuItem(file_menu, ID_OnOpenAnalyse, _(u"Open an analysis").decode('utf8'), _(u"Open an analysis").decode('utf8')) - item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) + item.SetBitmap(self.images_analyses['iramuteq']) file_menu.AppendItem(item) + item = wx.MenuItem(file_menu, ID_ImportTXM, _(u"Import from TXM").decode('utf8'), _(u"Import from TXM").decode('utf8')) + item.SetBitmap(self.images_analyses['TXM']) + file_menu.AppendItem(item) + + item = wx.MenuItem(file_menu, ID_ImportEuro, _(u"Import from Europress").decode('utf8'), _(u"Import from Europress").decode('utf8')) + item.SetBitmap(self.images_analyses['europress']) + file_menu.AppendItem(item) menuFactiva = wx.Menu() - fact_from_xml = wx.MenuItem(menuFactiva, wx.ID_ANY, _(u"from xml").decode('utf8')) - fact_from_mail = wx.MenuItem(menuFactiva, wx.ID_ANY, _(u"from mail").decode('utf8')) - fact_from_txt = wx.MenuItem(menuFactiva, wx.ID_ANY, _(u"from copy/paste").decode('utf8')) + fact_from_xml = wx.MenuItem(menuFactiva, ID_Fact_xml, _(u"from xml").decode('utf8')) + fact_from_xml.SetBitmap(self.images_analyses['factiva_xml']) + fact_from_mail = wx.MenuItem(menuFactiva, ID_Fact_mail, _(u"from mail").decode('utf8')) + fact_from_mail.SetBitmap(self.images_analyses['factiva_mail']) + fact_from_txt = wx.MenuItem(menuFactiva, ID_Fact_copy, _(u"from copy/paste").decode('utf8')) + fact_from_txt.SetBitmap(self.images_analyses['factiva_copy']) menuFactiva.AppendItem(fact_from_xml) menuFactiva.AppendItem(fact_from_mail) menuFactiva.AppendItem(fact_from_txt) file_menu.AppendMenu(-1, _(u"Import from factiva").decode('utf8'), menuFactiva) - item = wx.MenuItem(file_menu, ID_ImportTXM, _(u"Import from TXM").decode('utf8'), _(u"Import from TXM").decode('utf8')) - item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN)) - file_menu.AppendItem(item) - menuTools = wx.Menu() splitvar = wx.MenuItem(menuTools, wx.ID_ANY, _(u"Split from variable").decode('utf8')) extractmod = wx.MenuItem(menuTools, wx.ID_ANY, _(u"Extract mods").decode('utf8')) @@ -277,7 +292,10 @@ class IraFrame(wx.Frame): file_menu.Append(wx.ID_EXIT, _(u"Exit").decode('utf8')) edit_menu = wx.Menu() - edit_menu.Append(wx.ID_PREFERENCES, _(u'Preferences').decode('utf8')) + pref = wx.MenuItem(edit_menu, wx.ID_PREFERENCES, _(u'Preferences').decode('utf8')) + pref.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_HELP_SETTINGS, size = (16,16))) + edit_menu.AppendItem(pref) + #edit_menu.Append(wx.ID_PREFERENCES, _(u'Preferences').decode('utf8')) view_menu = wx.Menu() view_menu.Append(ID_ACCEUIL, _(u"Home page").decode('utf8')) @@ -370,8 +388,14 @@ class IraFrame(wx.Frame): self.text_menu = text_menu help_menu = wx.Menu() - help_menu.Append(wx.ID_ABOUT, _(u"About...").decode('utf8')) - help_menu.Append(wx.ID_HELP, _(u"Online help...").decode('utf8')) + about = wx.MenuItem(help_menu, wx.ID_ABOUT, _(u"About...").decode('utf8')) + about.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_INFORMATION, size = (16,16))) + help_menu.AppendItem(about) + #help_menu.Append(wx.ID_ABOUT, _(u"About...").decode('utf8')) + help = wx.MenuItem(help_menu, wx.ID_HELP, _(u"Online help...").decode('utf8')) + help.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_HELP, size = (16,16))) + help_menu.AppendItem(help) + #help_menu.Append(wx.ID_HELP, _(u"Online help...").decode('utf8')) self.mb.Append(file_menu, _(u"File").decode('utf8')) self.mb.Append(edit_menu, _(u"Edition").decode('utf8')) @@ -399,7 +423,16 @@ class IraFrame(wx.Frame): tb1.AddLabelTool(ID_OpenData, "OpenData", self.images_analyses['matroot'], shortHelp=_(u"Matrix").decode('utf8'), longHelp=_(u"Open a matrix").decode('utf8')) tb1.AddSeparator() tb1.AddLabelTool(ID_OpenText, "OpenText", self.images_analyses['textroot'], shortHelp=_(u"Text").decode('utf8'), longHelp=_(u"Open a text corpus").decode('utf8')) - + tb1.AddSeparator() + tb1.AddLabelTool(ID_OnOpenAnalyse, "OpenAnalyse", self.images_analyses['iramuteq'], shortHelp= _(u"Open an analysis").decode('utf8'), longHelp=_(u"Open an analysis").decode('utf8')) + tb1.AddSeparator() + tb1.AddLabelTool(ID_ImportTXM, "ImportTXM", self.images_analyses['TXM'], shortHelp= _(u"Import from TXM").decode('utf8'), longHelp=_(u"Import from TXM").decode('utf8')) + tb1.AddSeparator() + tb1.AddLabelTool(ID_ImportEuro, "ImportEuro", self.images_analyses['europress'], shortHelp= _(u"Import from Europress").decode('utf8'), longHelp=_(u"Import from Europress").decode('utf8')) + tb1.AddSeparator() + tb1.AddLabelTool(ID_Fact_xml, "ImportFactxml", self.images_analyses['factiva_xml'], shortHelp= _(u"Factiva from xml").decode('utf8'), longHelp=_(u"Factiva from xml").decode('utf8')) + tb1.AddLabelTool(ID_Fact_mail, "ImportFactmail", self.images_analyses['factiva_mail'], shortHelp= _(u"Factiva from mail").decode('utf8'), longHelp=_(u"Factiva from mail").decode('utf8')) + tb1.AddLabelTool(ID_Fact_copy, "ImportFactcopy", self.images_analyses['factiva_copy'], shortHelp= _(u"Factiva from copy/paste").decode('utf8'), longHelp=_(u"Factiva from copy/paste").decode('utf8')) tb1.Realize() tb_text = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize, @@ -533,6 +566,7 @@ class IraFrame(wx.Frame): self.Bind(wx.EVT_MENU, self.OnHelp, id=wx.ID_HELP) self.Bind(wx.EVT_MENU, self.OnPref, id=wx.ID_PREFERENCES) self.Bind(wx.EVT_MENU, self.OnImportTXM, id=ID_ImportTXM) + self.Bind(wx.EVT_MENU, self.OnImportEuropress, id=ID_ImportEuro) self.Bind(wx.EVT_CLOSE, self.OnClose) ################################################################## flags = self._mgr.GetAGWFlags() @@ -624,13 +658,10 @@ class IraFrame(wx.Frame): if not RLibsAreInstalled(self) : CheckRPackages(self) else : - msg = u""" -Le chemin de l'executable de R n'a pas été trouvé. -Si R n'est pas installé, vous devez l'installer (http://www.r-project.org/). -Si R n'est pas installé dans le répertoire par défaut -(souvent C:\Program Files\R\R-2.x.x\R.exe sous windows ou /usr/bin/R sous linux ou Mac Os X) -vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" - dlg = wx.MessageDialog(self, msg, u"Problème de configuration", wx.OK | wx.NO_DEFAULT | wx.ICON_WARNING) + msg = '\n'.join([_(u"Can't find R executable"), _(u"If R is not installed, get it from http://www.r-project.org.").decode('utf8'), + _(u"If R is installed, report its path in Preferences.").decode('utf8'), + _(u"IRaMuTeQ does not work without R.").decode('utf8')]) + dlg = wx.MessageDialog(self, msg, _(u"Problem").decode('utf8'), wx.OK | wx.NO_DEFAULT | wx.ICON_WARNING) dlg.CenterOnParent() if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]: pass @@ -714,8 +745,9 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" def OnOpenAnalyse(self, event): self.AnalysePath = OnOpen(self, "Analyse") - OpenAnalyse(self, self.AnalysePath[1][0], True) - self.ShowMenu('view') + if self.AnalysePath : + OpenAnalyse(self, self.AnalysePath[1][0], True) + self.ShowMenu('view') def OnOpenText(self, event): inputname, self.input_path = OnOpen(self, "Texte") @@ -797,6 +829,7 @@ vous devez signaler le chemin de l'éxecutable de R dans les préférences.""" info.Name = ConfigGlob.get('DEFAULT', 'name') info.Version = ConfigGlob.get('DEFAULT', 'version') info.Copyright = ConfigGlob.get('DEFAULT', 'copyright') + info.Translators = ConfigGlob.get('DEFAULT', 'translators').decode('utf8').split(';') info.Description = u""" Interface de R pour les Analyses Multidimensionnelles de Textes et de Questionnaires @@ -1063,6 +1096,12 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, États-Unis.""" ImportFactiva(self, 'txm') except : BugReport(self) + + def OnImportEuropress(self, evt) : + try : + ImportFactiva(self, 'euro') + except : + BugReport(self) def ExtractTools(self, evt) : ID = evt.GetId()