2 # -*- coding: utf-8 -*-
3 #Author: Pierre Ratinaud
4 #Copyright (c) 2008-2012, Pierre Ratinaud
7 from optparse import OptionParser
9 parser = OptionParser()
10 parser.add_option("-f", "--file", dest="filename",
11 help="open FILE", metavar="FILE", default=False)
12 (options, args) = parser.parse_args()
23 from random import randint
24 from ConfigParser import *
28 #------------------------------------
31 if wx.__version__ >= '2.11' :
32 import wx.lib.agw.aui as aui
37 import wx.lib.hyperlink as hl
38 #------------------------------------
39 from functions import BugReport, PlaySound, ReadLexique, History, DoConf, ReadDicoAsDico, progressbar
40 from checkversion import NewVersion
41 from guifunct import *
42 from tableau import Tableau
43 from dialog import PrefDialog, EncodeDialog, CorpusPref
44 from tabfrequence import Frequences
45 from tabchi2 import ChiSquare
46 #from tabstudent import MakeStudent
47 from tabchddist import ChdCluster
48 from tabafcm import DoAFCM
49 from tabchdalc import AnalyseQuest
50 from tabsimi import DoSimi
51 from tabrsimple import InputText
52 from tabverges import Verges
53 #from textafcuci import AfcUci
54 #from textchdalc import AnalyseAlceste
55 from analysetxt import Alceste
56 from textdist import AnalysePam
57 from textstat import Stat
58 from textaslexico import Lexico
59 from textsimi import SimiTxt, SimiFromCluster
60 from textwordcloud import WordCloud
61 from profile_segment import ProfileSegment
62 #from textcheckcorpus import checkcorpus
63 from openanalyse import OpenAnalyse
64 from corpus import BuildFromAlceste, Builder
65 from sheet import MySheet
66 from checkinstall import CreateIraDirectory, CheckRPath, FindRPAthWin32, FindRPathNix, CheckRPackages, IsNew, UpgradeConf, CopyConf, RLibsAreInstalled
67 from chemins import ConstructRscriptsPath, ConstructConfigPath, ConstructDicoPath, ConstructGlobalPath, PathOut
68 from parse_factiva_xml import ImportFactiva
69 from tools import Extract
71 from tree import LeftTree
72 ##########################################################
73 ID_OpenData = wx.NewId()
74 ID_Import = wx.NewId()
75 ID_OpenText = wx.NewId()
76 ID_OnOpenAnalyse = wx.NewId()
79 ID_Student = wx.NewId()
80 ID_CHDSIM = wx.NewId()
81 ID_CHDAlceste = wx.NewId()
82 ID_TEXTAFCM = wx.NewId()
83 ID_TEXTSTAT = wx.NewId()
85 ID_TEXTALCESTE = wx.NewId()
86 ID_TEXTPAM = wx.NewId()
87 ID_CHECKCORPUS = wx.NewId()
88 ID_Tabcontent = wx.NewId()
91 ID_CloseTab = wx.NewId()
92 ID_SaveTab = wx.NewId()
93 ID_CreateText = wx.NewId()
94 ID_ACCEUIL = wx.NewId()
95 ID_RESULT = wx.NewId()
96 ID_VIEWDATA = wx.NewId()
97 ID_HTMLcontent = wx.NewId()
98 ID_SimiTxt = wx.NewId()
99 ##########################################################
100 #elements de configuration
101 ##########################################################
103 if sys.platform == 'darwin' :
104 sys.setdefaultencoding('utf-8')
105 wx.SetDefaultPyEncoding('utf-8')
107 sys.setdefaultencoding(locale.getpreferredencoding())
108 #chemin de l'application
110 AppliPath = sys._MEIPASS
112 AppliPath = os.path.abspath(os.path.dirname(os.path.realpath(sys.argv[0])))
114 ImagePath = os.path.join(AppliPath, 'images')
115 #configuration generale
116 DictConfigPath = ConstructGlobalPath(AppliPath)
117 ConfigGlob = ConfigParser()
118 ConfigGlob.read(DictConfigPath['global'])
119 #repertoire de l'utilisateur
120 if os.getenv('HOME') != None:
121 user_home = os.getenv('HOME')
123 user_home = os.getenv('HOMEPATH')
124 UserConfigPath = os.path.abspath(os.path.join(user_home, '.iramuteq'))
125 #Si pas de fichiers de config utilisateur, on cree le repertoire
126 CreateIraDirectory(UserConfigPath, AppliPath)
127 #fichiers log pour windows (py2exe)
128 log = logging.getLogger('iramuteq')
129 fh = logging.FileHandler(os.path.join(UserConfigPath,'stdout.log'))
130 formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
131 fh.setFormatter(formatter)
133 if sys.platform != 'win32' and sys.platform != 'darwin':
134 ch = logging.StreamHandler()
135 ch.setFormatter(formatter)
137 log.setLevel(logging.INFO)
139 class writer(object):
140 def write(self, data):
141 if data.strip() != '' :
142 log.info('ERROR : %s' % data)
144 class printer(object) :
145 def write(self, data) :
146 if data.strip() != '' :
147 log.info('Print : %s' % data)
149 sys.stderr = writer()
150 sys.stdout = printer()
152 ConfigPath = ConstructConfigPath(UserConfigPath)
154 langues = {'french' : wx.LANGUAGE_FRENCH,
155 'english' : wx.LANGUAGE_ENGLISH,}
156 #####################################################################
158 class IraFrame(wx.Frame):
159 def __init__(self, parent, id= -1, title="", pos=wx.DefaultPosition,
160 size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE |
163 log.info('Starting...')
164 wx.Frame.__init__(self, parent, id, title, pos, size, style)
166 self.AppliPath = AppliPath
167 self.images_path = os.path.join(AppliPath,'images')
168 self.UserConfigPath = UserConfigPath
169 self.RscriptsPath = ConstructRscriptsPath(AppliPath)
170 #self.DictPath = ConstructDicoPath(AppliPath)
171 self.DictPath = ConstructDicoPath(UserConfigPath)
172 self.ConfigGlob = ConfigGlob
173 self.ConfigPath = ConstructConfigPath(UserConfigPath)
174 self.pref = RawConfigParser()
175 #workaround for import problem
176 self.SimiFromCluster = SimiFromCluster
178 gettext.install('iramuteq', os.path.join(AppliPath,'locale'), unicode=True)
179 self.presLan_fr = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['fr_FR'])
180 self.presLan_en = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['en'])
182 # tell FrameManager to manage this frame
183 #self._mgr = wx.aui.AuiManager()
184 self._mgr = aui.AuiManager()
185 self._mgr.SetManagedWindow(self)
188 #--------------------------------------------------------------------------------
189 self.mb = wx.MenuBar()
191 file_menu = wx.Menu()
192 item = wx.MenuItem(file_menu, ID_OpenData, _(u"Open a matrix").decode('utf8'), _(u"Open a matrix").decode('utf8'))
193 item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
194 file_menu.AppendItem(item)
196 item = wx.MenuItem(file_menu, ID_OpenText, _(u"Open a text corpora").decode('utf8'), _(u"Open a text corpora").decode('utf8'))
197 item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
198 file_menu.AppendItem(item)
200 item = wx.MenuItem(file_menu, ID_OnOpenAnalyse, _(u"Open an analysis").decode('utf8'), _(u"Open an analysis").decode('utf8'))
201 item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
202 file_menu.AppendItem(item)
205 menuFactiva = wx.Menu()
206 fact_from_xml = wx.MenuItem(menuFactiva, wx.ID_ANY, _(u"from xml").decode('utf8'))
207 fact_from_mail = wx.MenuItem(menuFactiva, wx.ID_ANY, _(u"from mail").decode('utf8'))
208 fact_from_txt = wx.MenuItem(menuFactiva, wx.ID_ANY, _(u"from copy/paste").decode('utf8'))
209 menuFactiva.AppendItem(fact_from_xml)
210 menuFactiva.AppendItem(fact_from_mail)
211 menuFactiva.AppendItem(fact_from_txt)
212 file_menu.AppendMenu(-1, _(u"Import from factiva"), menuFactiva)
214 menuTools = wx.Menu()
215 splitvar = wx.MenuItem(menuTools, wx.ID_ANY, _(u"Split from variable").decode('utf8'))
216 extractmod = wx.MenuItem(menuTools, wx.ID_ANY, _(u"Extract mods").decode('utf8'))
217 menuTools.AppendItem(splitvar)
218 menuTools.AppendItem(extractmod)
219 self.ID_splitvar = splitvar.GetId()
220 self.ID_extractmod = extractmod.GetId()
221 file_menu.AppendMenu(-1, _(u"Tools"), menuTools)
224 item = wx.MenuItem(file_menu, ID_SaveTab, _(u"Save tab as...").decode('utf8'), _(u"Save tab as...").decode('utf8'))
225 item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE_AS))
226 file_menu.AppendItem(item)
228 file_menu.Append(wx.ID_EXIT, _(u"Exit"))
230 edit_menu = wx.Menu()
231 edit_menu.Append(wx.ID_PREFERENCES, '', _(u'Preferences').decode('utf8'))
233 view_menu = wx.Menu()
234 view_menu.Append(ID_ACCEUIL, _(u"Home page").decode('utf8'))
235 view_menu.Append(ID_VIEWDATA, _(u"Show data").decode('utf8'))
236 view_menu.Append(ID_RESULT, _(u'Show results').decode('utf8'))
237 #view_menu.AppendSeparator()
239 analyse_menu = wx.Menu()
240 analyse_menu.Append(ID_Freq, u"Fréquences")
241 analyse_menu.Append(ID_Chi2, u"Chi2")
242 #analyse_menu.Append(ID_Student, u"t de Student")
243 menu_classif = wx.Menu()
244 menu_classif.Append(ID_CHDAlceste, u"Méthode GNEPA")
245 #menu_classif.Append(ID_CHDSIM, u"Par matrice des distances")
246 analyse_menu.AppendMenu(-1, u"Classification", menu_classif)
247 #analyse_menu.Append(ID_AFCM, u"AFCM")
248 analyse_menu.Append(ID_SIMI, u"Analyse de similitudes")
249 ID_RCODE = wx.NewId()
250 analyse_menu.Append(ID_RCODE, u"Code R...")
252 text_menu = wx.Menu()
253 #text_menu.Append(ID_CHECKCORPUS, u"Vérifier le corpus")
254 text_menu.Append(ID_TEXTSTAT, u"Statistiques textuelles")
255 text_menu.Append(ID_ASLEX, u"Spécificités et AFC")
256 #text_menu.Append(ID_TEXTAFCM, u"AFC sur UCI / Vocabulaire")
257 menu_classiftxt = wx.Menu()
258 menu_classiftxt.Append(ID_TEXTALCESTE, u"Méthode GNEPA")
259 #menu_classiftxt.Append(ID_TEXTPAM, u"Par matrice des distances")
260 text_menu.AppendMenu(-1, u"Classification", menu_classiftxt)
261 text_menu.Append(ID_SimiTxt, u'Analyse de similitude')
263 text_menu.Append(ID_WC, u'Nuage de mots')
265 help_menu = wx.Menu()
266 help_menu.Append(wx.ID_ABOUT, u'À propos...')
267 help_menu.Append(wx.ID_HELP, u'Aide en ligne')
269 self.mb.Append(file_menu, _(u"File").decode('utf8'))
270 self.mb.Append(edit_menu, _(u"Edition").decode('utf8'))
271 self.mb.Append(view_menu, _(u"View").decode('utf8'))
272 self.mb.Append(analyse_menu, _("Spreadsheet analysis").decode('utf8'))
273 self.mb.Append(text_menu, _(u"Text analysis").decode('utf8'))
274 self.mb.Append(help_menu, _(u"Help").decode('utf8'))
276 self.SetMenuBar(self.mb)
277 #--------------------------------------------------------------------
278 self.statusbar = self.CreateStatusBar(2, wx.ST_SIZEGRIP)
279 self.statusbar.SetStatusWidths([-2, -3])
280 self.statusbar.SetStatusText(u"Prêt", 0)
281 self.statusbar.SetStatusText(u"Bienvenue", 1)
283 # min size for the frame itself isn't completely done.
284 # see the end up FrameManager::Update() for the test
285 # code. For now, just hard code a frame minimum size
286 self.SetMinSize(wx.Size(400, 400))
288 # create some toolbars
289 tb1 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,
290 wx.TB_FLAT | wx.TB_NODIVIDER)
291 tb1.SetToolBitmapSize(wx.Size(16, 16))
292 tb1.AddLabelTool(ID_OpenData, "OpenData", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN, wx.ART_OTHER, wx.Size(16, 16)), shortHelp="Questionnaire", longHelp="Ouvrir un questionnaire")
294 tb1.AddLabelTool(ID_OpenText, "OpenText", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN, wx.ART_OTHER, wx.Size(16, 16)), shortHelp="Texte", longHelp="Ouvrir un corpus texte")
298 #------------------------------------------------------------------------------------------------
300 self.text_ctrl_txt = wx.TextCtrl(self, -1, "", wx.Point(0, 0), wx.Size(200, 200), wx.NO_BORDER | wx.TE_MULTILINE | wx.TE_RICH2 | wx.TE_READONLY)
302 #self._mgr.AddPane(self.text_ctrl_txt, wx.aui.AuiPaneInfo().
303 # Name("Text").CenterPane())
304 self._mgr.AddPane(self.text_ctrl_txt, aui.AuiPaneInfo().
305 Name("Text").CenterPane())
306 #self._mgr.AddPane(IntroPanel(self), wx.aui.AuiPaneInfo().Name("Intro_Text").
308 self._mgr.AddPane(IntroPanel(self), aui.AuiPaneInfo().Name("Intro_Text").
310 #if not os.path.exists(os.path.join(UserConfigPath, 'history.db')) :
311 # with open(os.path.join(UserConfigPath, 'history.db'), 'w') as f :
313 self.history = History(os.path.join(UserConfigPath, 'history.db'))
314 self.tree = LeftTree(self)
315 self._mgr.AddPane(self.tree, aui.AuiPaneInfo().Name("lefttree").Caption("Navigateur").
316 Left().MinSize(wx.Size(200,500)).Layer(1).Position(1).CloseButton(False).MaximizeButton(True).
317 MinimizeButton(True))
319 #self.nb = wx.aui.AuiNotebook(self, -1, wx.DefaultPosition, wx.DefaultSize, wx.aui.AUI_NB_DEFAULT_STYLE | wx.aui.AUI_NB_TAB_EXTERNAL_MOVE | wx.aui.AUI_NB_TAB_MOVE | wx.aui.AUI_NB_TAB_FLOAT| wx.NO_BORDER)
320 self.nb = aui.AuiNotebook(self, -1, wx.DefaultPosition, wx.DefaultSize, aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | aui.AUI_NB_TAB_MOVE | aui.AUI_NB_TAB_FLOAT| wx.NO_BORDER)
321 notebook_flags = aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | aui.AUI_NB_TAB_MOVE | aui.AUI_NB_TAB_FLOAT| wx.NO_BORDER
322 self.nb.SetAGWWindowStyleFlag(notebook_flags)
323 self.nb.SetArtProvider(aui.ChromeTabArt())
324 #self.nb.SetArtProvider(aui.VC8TabArt())
325 #self.nb.parent = self
326 #self._notebook_style = aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | wx.NO_BORDER
327 #self._mgr.AddPane(self.nb, wx.aui.AuiPaneInfo().
328 # Name("Tab_content").
330 self._mgr.AddPane(self.nb, aui.AuiPaneInfo().
333 self.Sheet = MySheet(self)
334 #self._mgr.AddPane(self.Sheet, wx.aui.AuiPaneInfo().Name("Data").CenterPane())
335 self._mgr.AddPane(self.Sheet, aui.AuiPaneInfo().Name("Data").CenterPane())
336 self.nb.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnCloseTab)
337 self.nb.Bind(aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
338 # add the toolbars to the manager
340 #self._mgr.AddPane(tb1, wx.aui.AuiPaneInfo().
341 # Name("tb1").Caption("Fichiers").
342 # ToolbarPane().Top().
343 # LeftDockable(False).RightDockable(False))
344 self._mgr.AddPane(tb1, aui.AuiPaneInfo().
345 Name("tb1").Caption("Fichiers").
347 LeftDockable(True).RightDockable(False))
349 self.ShowAPane("Intro_Text")
350 self._mgr.GetPane("lefttree").Show()
351 self._mgr.GetPane("classif_tb").Hide()
352 # "commit" all changes made to FrameManager
355 # Show How To Use The Closing Panes Event
356 ##################################################################
357 self.Bind(wx.EVT_MENU, self.OnAcceuil, id=ID_ACCEUIL)
358 self.Bind(wx.EVT_MENU, self.OnViewData, id=ID_VIEWDATA)
359 self.Bind(wx.EVT_MENU, self.ShowTab, id=ID_RESULT)
360 self.Bind(wx.EVT_MENU, self.OnOpenData, id=ID_OpenData)
361 self.Bind(wx.EVT_MENU, self.OnOpenText, id=ID_OpenText)
362 self.Bind(wx.EVT_MENU, self.OnOpenAnalyse, id=ID_OnOpenAnalyse)
363 self.Bind(wx.EVT_MENU, self.import_factiva_xml, fact_from_xml)
364 self.Bind(wx.EVT_MENU, self.import_factiva_mail, fact_from_mail)
365 self.Bind(wx.EVT_MENU, self.import_factiva_txt, fact_from_txt)
366 self.Bind(wx.EVT_MENU, self.ExtractTools, splitvar)
367 self.Bind(wx.EVT_MENU, self.ExtractTools, extractmod)
368 self.Bind(wx.EVT_MENU, self.OnFreq, id=ID_Freq)
369 self.Bind(wx.EVT_MENU, self.OnChi2, id=ID_Chi2)
370 self.Bind(wx.EVT_MENU, self.OnStudent, id=ID_Student)
371 self.Bind(wx.EVT_MENU, self.OnCHDSIM, id=ID_CHDSIM)
372 self.Bind(wx.EVT_MENU, self.OnCHDAlceste, id=ID_CHDAlceste)
373 self.Bind(wx.EVT_MENU, self.OnAFCM, id=ID_AFCM)
374 self.Bind(wx.EVT_MENU, self.OnRCode, id=ID_RCODE)
375 #self.Bind(wx.EVT_MENU, self.OnCheckcorpus, id = ID_CHECKCORPUS)
376 self.Bind(wx.EVT_MENU, self.OnTextStat, id=ID_TEXTSTAT)
377 self.Bind(wx.EVT_MENU, self.OnTextSpec, id=ID_ASLEX)
378 self.Bind(wx.EVT_MENU, self.OnTextAfcm, id=ID_TEXTAFCM)
379 self.Bind(wx.EVT_MENU, self.OnTextAlceste, id=ID_TEXTALCESTE)
380 self.Bind(wx.EVT_MENU, self.OnPamSimple, id=ID_TEXTPAM)
381 self.Bind(wx.EVT_MENU, self.OnSimiTxt, id=ID_SimiTxt)
382 self.Bind(wx.EVT_MENU, self.OnWordCloud, id=ID_WC)
383 self.Bind(wx.EVT_MENU, self.OnSimi, id=ID_SIMI)
384 self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
385 self.Bind(wx.EVT_MENU, self.OnSaveTabAs, id=ID_SaveTab)
386 self.Bind(wx.EVT_MENU, self.OnAbout, id=wx.ID_ABOUT)
387 self.Bind(wx.EVT_MENU, self.OnHelp, id=wx.ID_HELP)
388 self.Bind(wx.EVT_MENU, self.OnPref, id=wx.ID_PREFERENCES)
389 self.Bind(wx.EVT_CLOSE, self.OnClose)
390 ##################################################################
391 flags = self._mgr.GetAGWFlags()
392 #flags &= ~wx.aui.AUI_MGR_TRANSPARENT_HINT
393 #flags &= ~wx.aui.AUI_MGR_VENETIAN_BLINDS_HINT
394 #flags &= ~wx.aui.AUI_MGR_RECTANGLE_HINT
395 flags &= ~(aui.AUI_MGR_RECTANGLE_HINT | aui.AUI_MGR_ALLOW_FLOATING)
396 self._mgr.SetAGWFlags(self._mgr.GetAGWFlags() ^ (aui.AUI_MGR_RECTANGLE_HINT | aui.AUI_MGR_ALLOW_FLOATING))
397 self._mgr.GetArtProvider().SetMetric(aui.AUI_DOCKART_GRADIENT_TYPE, aui.AUI_GRADIENT_HORIZONTAL)
398 self.GetDockArt().SetColor(aui.AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR, "#00FFF9")
401 self._icon = wx.Icon(os.path.join(ImagePath, "iraicone.ico"), wx.BITMAP_TYPE_ICO)
402 self.SetIcon(self._icon)
403 ##########################
405 self.input_path = [False]
406 self.TEMPDIR = tempfile.mkdtemp('iramuteq')
407 self.FileTabList = []
413 self.g_header = False
420 self.SysEncoding = sys.getdefaultencoding()
421 self.syscoding = sys.getdefaultencoding()
422 #print 'SysEncoding',self.SysEncoding
423 if self.SysEncoding == 'mac-roman' : self.SysEncoding = 'MacRoman'
426 ##############################################################@
427 self.DisEnSaveTabAs(False)
428 self.ShowMenu(_("View"), False)
429 self.ShowMenu(_("Spreadsheet analysis"), False)
430 self.ShowMenu(_("Text analysis"), False)
441 def finish_init(self) :
443 self.pref.read(self.ConfigPath['preferences'])
446 self.pref.read(self.ConfigPath['preferences'])
453 self.pref.read(self.ConfigPath['preferences'])
455 self.sound = self.pref.getboolean('iramuteq', 'sound')
456 self.check_update = self.pref.getboolean('iramuteq', 'checkupdate')
457 self.version = ConfigGlob.get('DEFAULT', 'version')
458 #configuration des chemins de R
459 self.PathPath = ConfigParser()
460 self.PathPath.read(ConfigPath['path'])
462 if not CheckRPath(self.PathPath) :
463 if sys.platform == 'win32':
464 BestRPath = FindRPAthWin32()
466 BestRPath = FindRPathNix()
468 self.PathPath.set('PATHS', 'rpath', BestRPath)
469 with open(ConfigPath['path'], 'w') as f :
470 self.PathPath.write(f)
474 self.RPath = self.PathPath.get('PATHS', 'rpath')
477 if not RLibsAreInstalled(self) :
481 Le chemin de l'executable de R n'a pas été trouvé.
482 Si R n'est pas installé, vous devez l'installer (http://www.r-project.org/).
483 Si R n'est pas installé dans le répertoire par défaut
484 (souvent C:\Program Files\R\R-2.x.x\R.exe sous windows ou /usr/bin/R sous linux ou Mac Os X)
485 vous devez signaler le chemin de l'éxecutable de R dans les préférences."""
486 dlg = wx.MessageDialog(self, msg, u"Problème de configuration", wx.OK | wx.NO_DEFAULT | wx.ICON_WARNING)
488 if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
493 def setlangue(self) :
495 self.pref.read(self.ConfigPath['preferences'])
496 guilangue = self.pref.get('iramuteq', 'guilanguage')
497 if guilangue == 'french' :
498 self.presLan_fr.install()
500 self.presLan_en.install()
501 mylocale = wx.Locale(langues[guilangue])
502 mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale'))
503 mylocale.AddCatalog('iramuteq')
505 self.presLan_fr.install()
506 mylocale = wx.Locale(langues['french'])
507 mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale'))
508 mylocale.AddCatalog('iramuteq')
511 def OnVerif(self, evt) :
512 pack = CheckRPackages(self)
514 dlg = wx.MessageDialog(self, u"Installation OK", u"Installation", wx.OK | wx.ICON_INFORMATION)
516 if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
519 def DisEnSaveTabAs(self, DISEN):
521 file_menu = self.mb.GetMenu(0)
522 items = file_menu.GetMenuItems()
524 if item.GetId() == ID_SaveTab :
527 def ShowMenu(self, menu, Show=True):
528 menu_pos = self.mb.FindMenu(menu)
529 self.mb.EnableTop(menu_pos, Show)
530 self.mb.UpdateMenus()
533 #--------------------------------------------------------------------
534 def OnClose(self, event):
536 with open(self.ConfigPath['path'], 'w') as f :
537 self.PathPath.write(f)
538 if self.DictTab != {} :
539 savestates = [self.DictTab[item][0] for item in self.DictTab]
540 if False in savestates :
541 notsave = [item for item in self.DictTab if self.DictTab[item][0] == False]
543 Certains résultats ne sont pas enregistrés.
544 Voulez-vous fermer quand même ?"""
545 dlg = wx.MessageDialog(self, msg, "Sauvegarde",
546 wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
548 if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
553 for item in notsave :
554 for tmpfile in self.DictTab[item][1:] :
556 print 'remove : ' + tmpfile
568 #if sys.platform == 'win32' :
569 # os.system("taskkill /im iramuteq.exe /f")
570 # print 'meurtre de process'
572 def OnOpenData(self, event):
573 inputname, self.input_path = OnOpen(self, "Data")
575 self.filename = self.input_path[0]
576 self.tableau = Tableau(self,os.path.abspath(self.input_path[0]))
577 get_table_param(self, self.input_path[0])
578 self.tableau.make_content()
579 self.tableau.show_tab()
581 def OnOpenAnalyse(self, event):
582 self.AnalysePath = OnOpen(self, "Analyse")
583 OpenAnalyse(self, self.AnalysePath[1][0], True)
584 self.ShowMenu(_("View"))
586 def OnOpenText(self, event):
587 inputname, self.input_path = OnOpen(self, "Texte")
588 self.filename = self.input_path[0]
592 def OnViewData(self, event):
595 if self.type == "Data":
596 if not self.DataPop :
597 self.Sheet.Populate(self.content)
600 self.ShowAPane(u"Data")
601 elif self.type == "Texte" or self.type == 'Analyse' :
602 if not self.DataTxt :
603 self.text_ctrl_txt.Clear()
604 self.text_ctrl_txt.write(self.content)
605 self.text_ctrl_txt.ShowPosition(0)
608 self.ShowAPane(u"Text")
612 #dial = EncodeDialog(self)
613 dlg = wx.ProgressDialog("Ouverture...",
614 "Veuillez patienter...",
617 style=wx.PD_APP_MODAL | wx.PD_AUTO_HIDE | wx.PD_ELAPSED_TIME | wx.PD_CAN_ABORT
620 builder = Builder(self, dlg)
621 if builder.res == wx.ID_OK :
623 corpus = builder.doanalyse()
624 self.history.add(corpus.parametres)
625 self.tree.OnItemAppend(corpus.parametres)
626 OpenAnalyse(self, corpus.parametres)
629 #self.content = DoConf().totext(corpus.parametres)
630 # parametres = DoConf(os.path.join(UserConfigPath,'corpus.cfg')).getoptions('corpus')
631 # parametres['originalpath'] = self.filename
633 # parametres['pathout'] = PathOut(self.filename, 'corpus').dirout
634 # dial = CorpusPref(self, parametres)
635 # dial.CenterOnParent()
636 # dial.txtpath.SetLabel(self.filename)
637 # res = dial.ShowModal()
638 # parametres = dial.doparametres()
640 # ReadLexique(self, lang = parametres['lang'])
641 # self.expressions = ReadDicoAsDico(self.DictPath.get(parametres['lang'], 'french_exp'))
642 # corpus = BuildFromAlceste(self.filename, parametres, self.lexique, self.expressions).corpus
643 #self.corpus_encodage = dial.encodages[dial.list_encodages.GetSelection()][0]
644 #self.corpus_lang = dial.langues[dial.choice_dict.GetSelection()]
647 keepGoing = dlg.Update(count, u"Lecture du fichier")
648 # msg = u"Ce fichier ne semble pas être encodé en %s" % self.corpus_encodage
649 # dial = wx.MessageDialog(self, msg, u"Problème d'encodage", wx.OK | wx.NO_DEFAULT | wx.ICON_WARNING)
650 # dial.CenterOnParent()
651 # res = dial.ShowModal()
654 self.ShowMenu(_("View"))
655 self.ShowMenu(_("Text analysis"))
656 self.ShowMenu(_(u"Spreadsheet analysis"), False)
661 keepGoing = dlg.Update(count, u"Chargement du dictionnaire")
663 #self.OnViewData(wx.EVT_BUTTON)
665 def OnExit(self, event):
668 def OnAbout(self, event):
669 info = wx.AboutDialogInfo()
670 info.Name = ConfigGlob.get('DEFAULT', 'name')
671 info.Version = ConfigGlob.get('DEFAULT', 'version')
672 info.Copyright = ConfigGlob.get('DEFAULT', 'copyright')
673 info.Description = u"""
674 Interface de R pour les Analyses Multidimensionnelles
675 de Textes et de Questionnaires
678 construit avec des logiciels libres.
684 info.WebSite = ("http://www.iramuteq.org", u"Site web IRaMuTeQ")
685 dev = ConfigGlob.get('DEFAULT', 'dev').split(';')
686 info.Developers = dev
687 info.License = u"""Iramuteq est un logiciel libre ; vous pouvez le diffuser et/ou le modifier
688 suivant les termes de la Licence Publique Générale GNU telle que publiée
689 par la Free Software Foundation ; soit la version 2 de cette licence,
690 soit (à votre convenance) une version ultérieure.
692 Iramuteq est diffusé dans l'espoir qu'il sera utile,
693 mais SANS AUCUNE GARANTIE ; sans même une garantie implicite
694 de COMMERCIALISATION ou d'ADÉQUATION À UN USAGE PARTICULIER.
695 Voyez la Licence Publique Générale GNU pour plus de détails.
697 Vous devriez avoir reçu une copie de la Licence Publique Générale GNU
698 avec Iramuteq ; sinon, veuillez écrire à la Free Software Foundation,
699 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, États-Unis."""
702 def GetDockArt(self):
703 return self._mgr.GetArtProvider()
708 def OnPageChanged(self, event) :
709 new = event.GetSelection()
710 nobject = event.GetEventObject()
711 parent = nobject.GetParent()
712 if isinstance(parent, IraFrame) :
713 npage = self.nb.GetPage(new)
714 if 'parametres' in dir(npage) :
715 self.tree.GiveFocus(uuid=npage.parametres['uuid'])
717 def OnCloseTab(self, evt):
718 #log.info('Closing tab %s' % str(evt.GetEventObject()))
719 ctrl = evt.GetEventObject()
720 if isinstance(ctrl.GetParent(), aui.AuiNotebook) or isinstance(ctrl.GetParent(), wx.Panel):
724 page = self.nb.GetPage(self.nb.GetSelection())
725 if 'parametres' in dir(page) and isinstance(ctrl.GetParent(), IraFrame) :
726 self.history.rmtab(page.parametres)
727 self.tree.CloseItem(uuid = page.parametres['uuid'])
728 TabTitle = self.nb.GetPageText(self.nb.GetSelection())
729 if self.DictTab != {} :
730 if TabTitle in self.DictTab :
731 ListFile=self.DictTab[TabTitle]
732 if False in ListFile:
734 Certains résultats ne sont pas enregistrer.
735 Voulez-vous fermer quand même ?"""
736 dlg = wx.MessageDialog(self, msg, "Sauvegarde",wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
739 if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
744 for f in ListFile[1:] :
749 elif True in ListFile :
752 del self.DictTab[TabTitle]
757 if self.nb.GetPageCount() == 1 and remove and not notebook :
760 def LastTabClose(self) :
761 if self.nb.GetPageCount() == 1 :
762 self.DisEnSaveTabAs(False)
764 self.ShowAPane("Text")
766 self.ShowAPane("Data")
768 self.ShowAPane("Intro_Text")
770 def OnSaveTabAs(self, event):
771 SelectTab = self.nb.GetSelection()
772 TabTitle = self.nb.GetPageText(SelectTab)
773 FileToSave = self.DictTab[TabTitle]
776 self, message="Enregistrer sous...", defaultDir=os.getcwd(),
777 defaultFile="resultat.html", wildcard="Tous les fichiers|*", style=wx.SAVE | wx.OVERWRITE_PROMPT
779 dlg.SetFilterIndex(2)
782 if dlg.ShowModal() == wx.ID_OK:
784 Dirname = os.path.dirname(Path)
785 Filename = dlg.GetFilename()
790 shutil.copyfile(FileToSave[-1], Path)
791 os.remove(FileToSave[len(FileToSave) - 1])
792 NewListFile.append(True)
793 NewListFile.append(Path)
794 for f in FileToSave[1:-1] :
795 Fileout = os.path.join(Dirname, os.path.basename(f))
796 shutil.copyfile(f, Fileout)
797 NewListFile.append(Fileout)
800 self.DictTab[TabText] = NewListFile
801 del self.DictTab[TabTitle]
802 self.nb.SetPageText(SelectTab, TabText)
804 def GetStartPosition(self):
808 pt = self.ClientToScreen(wx.Point(0, 0))
810 return wx.Point(pt.x + x, pt.y + x)
812 def ShowAPane(self, panel):
813 for pane in self._mgr.GetAllPanes() :
814 if not pane.IsToolbar() and pane.name != 'lefttree':
816 self._mgr.GetPane(panel).Show()
819 def OnAcceuil(self, event):
820 self.ShowAPane(u"Intro_Text")
823 def CreateHTMLCtrl(self):
824 ctrl = wx.html.HtmlWindow(self, -1, wx.DefaultPosition, wx.Size(400, 300))
825 if "gtk2" in wx.PlatformInfo:
826 ctrl.SetStandardFonts()
827 ctrl.SetPage(u"text")
830 def ShowTab(self, evt):
831 self.ShowAPane("Tab_content")
833 ################################################################
835 ################################################################
837 def OnFreq(self, event):
843 def OnChi2(self, event):
845 # print('PAS DE DEBUG SUR CHI2')
846 chi = ChiSquare(self)
850 def OnStudent(self, event):
856 def OnRCode(self, event):
862 def OnCHDSIM(self, event):
864 # print 'ATTENTION!!!!'
865 chdsim = ChdCluster(self)
866 if chdsim.val == wx.ID_OK:
871 def OnCHDAlceste(self, event):
873 # print('PLUS DE BUG SUR ALCESTE QUESTIONNAIRE')
874 self.quest = AnalyseQuest(self)
875 if self.quest.val == wx.ID_OK:
880 def OnSimiTxt(self, evt, corpus = None) :
881 # print 'PLUS DE BUG SUR SIMITXT'
883 #self.Text = SimiTxt(self)
885 corpus = self.tree.getcorpus()
886 self.Text = SimiTxt(self, corpus, parametres = {'type': 'simitxt'}, dlg = progressbar(self, 3))
887 if self.Text.val == wx.ID_OK :
892 def OnWordCloud(self, evt, corpus = None) :
893 # print 'PLUS DE BUG SUR WORDCLOUD'
896 corpus = self.tree.getcorpus()
897 self.Text = WordCloud(self, corpus, parametres = {'type' : 'wordcloud'}, dlg = progressbar(self, 3))
898 if self.Text.val == wx.ID_OK :
904 def OnAFCM(self, event):
910 # def OnCheckcorpus(self, evt):
916 def OnTextStat(self, event, corpus = None):
917 #print 'PAS DE BUG SUR TEXT STAT'
920 corpus = self.tree.getcorpus()
921 self.Text = Stat(self, corpus, parametres = {'type': 'stat'}, dlg = progressbar(self, 7))
923 if self.Text.val == wx.ID_OK :
928 def OnTextSpec(self, event, corpus = None):
930 #self.Text = AsLexico(self)
931 #print('ATTENTION : PLUS DE BUG SUR LEXICO')
933 corpus = self.tree.getcorpus()
934 self.Text = Lexico(self, corpus, parametres = {'type' : 'spec'}, dlg = progressbar(self, 3))
935 if self.Text.val == wx.ID_OK :
940 def OnTextAfcm(self, event):
947 def import_factiva_xml(self,event):
949 ImportFactiva(self, 'xml')
953 def import_factiva_mail(self, evt) :
955 ImportFactiva(self, 'mail')
959 def import_factiva_txt(self, evt) :
961 ImportFactiva(self, 'txt')
965 def ExtractTools(self, evt) :
967 if ID == self.ID_splitvar :
968 Extract(self, 'splitvar')
970 Extract(self, 'mods')
972 def OnTextAlceste(self, event, corpus = None):
974 #print('ATTENTION : PLUS DE BUG SUR ALCESTE')
975 #RunAnalyse(self, corpus, Alceste, OptAlceste)
977 corpus = self.tree.getcorpus()
978 self.Text = Alceste(self, corpus, parametres = {'type': 'alceste'}, dlg = progressbar(self,6))
979 if self.Text.val == wx.ID_OK:
984 def OnPamSimple(self, event, corpus = None):
987 corpus = self.tree.getcorpus()
988 self.Text = AnalysePam(self, corpus, parametres = {'type' : 'pamtxt'}, dlg = progressbar(self,6))
989 if self.Text.val == wx.ID_OK:
994 def SimiCluster(self, parametres = {}, fromprof = False, pathout = '', listactives = [], actives = [], tableau = None) :
995 DoSimi(self, param = parametres, fromprof = fromprof, pathout = pathout, listactives = listactives, actives = actives, tableau = tableau)
997 def OnSimi(self,evt):
999 #print 'ATTENTION !!!! VERGES'
1000 #print 'PLUS DE BUG SUR SIMI'
1001 self.res = DoSimi(self, param = None)
1002 #self.res = Verges(self)
1003 if self.res.val == wx.ID_OK :
1007 #################################################################
1009 def OnHelp(self, event):
1010 webbrowser.open('http://www.iramuteq.org/documentation')
1012 def OnPref(self, event):
1013 dlg = PrefDialog(self)
1014 dlg.CenterOnParent()
1015 self.val = dlg.ShowModal()
1018 if self.check_update:
1021 print 'pas de verif'
1023 #CheckRPackages(self)
1025 def OnOpenFromCmdl(self):
1027 if options.filename :
1028 if os.path.exists(options.filename):
1029 self.filename = os.path.abspath(options.filename)
1033 if os.path.exists(os.path.realpath(args[0])):
1034 self.filename = os.path.abspath(os.path.realpath(args[0]))
1040 if os.path.splitext(self.filename)[1] in ['.csv', '.xls', '.ods']:
1041 self.tableau = Tableau(self, self.filename)
1042 get_table_param(self, self.filename)
1043 self.tableau.make_content()
1044 self.tableau.show_tab()
1045 #open_data(self, self.filename)
1046 elif os.path.splitext(self.filename)[1] == '.txt':
1048 elif os.path.splitext(self.filename)[1] == '.ira' :
1049 #self.corpus = Corpus(self)
1050 #self.Text = OpenAnalyse(self, self.filename)
1051 OpenAnalyse(self, self.filename)
1053 print 'ce fichier n\'existe pas'
1057 class IntroPanel(wx.Panel):
1058 def __init__(self, parent):
1059 wx.Panel.__init__(self, parent)
1060 #col = randint(0, 255)
1061 #col1 = randint(0,255)
1062 #col2 = randint(0,255)
1064 bckgrdcolor = wx.Colour(col, col, col)
1065 self.SetBackgroundColour(bckgrdcolor)
1066 txtcolour = wx.Colour(250, 250, 250)
1067 linkcolor = wx.Colour(255, 0, 0)
1068 sizer1 = wx.BoxSizer(wx.VERTICAL)
1069 sizer2 = wx.BoxSizer(wx.VERTICAL)
1070 sizer3 = wx.BoxSizer(wx.HORIZONTAL)
1071 sizer4 = wx.BoxSizer(wx.VERTICAL)
1072 sizer5 = wx.BoxSizer(wx.HORIZONTAL)
1073 grid_sizer_1 = wx.FlexGridSizer(1, 4, 0, 0)
1074 grid_sizer_3 = wx.FlexGridSizer(1, 4, 0, 0)
1075 grid_sizer_2 = wx.FlexGridSizer(1, 3, 0, 0)
1076 PanelPres = wx.Panel(self)
1077 PanelPres.SetBackgroundColour(bckgrdcolor)
1078 label_1 = wx.StaticText(self, -1, u"IRaMuTeQ", size=(-1, -1))
1079 label_1.SetFont(wx.Font(46, wx.TELETYPE, wx.NORMAL, wx.BOLD, 0, "Purisa"))
1080 label_1.SetForegroundColour(wx.RED)
1081 label2 = wx.StaticText(PanelPres, -1 , u'\nVersion ' + ConfigGlob.get('DEFAULT', 'version') + '\n')
1082 label2.SetForegroundColour(txtcolour)
1083 label2.SetBackgroundColour(bckgrdcolor)
1084 #label3 = wx.StaticText(PanelPres, -1 , u'Equipe ')
1085 #label3.SetForegroundColour(txtcolour)
1086 #label3.SetBackgroundColour(bckgrdcolor)
1087 self.hyper2 = hl.HyperLinkCtrl(PanelPres, wx.ID_ANY, u"REPERE", URL="http://repere.no-ip.org/")
1088 self.hyper2.SetColours(linkcolor, linkcolor, "RED")
1089 self.hyper2.SetBackgroundColour(bckgrdcolor)
1090 self.hyper2.EnableRollover(True)
1091 self.hyper2.SetUnderlines(False, False, True)
1092 self.hyper2.SetBold(True)
1093 self.hyper2.UpdateLink()
1094 label_lerass = wx.StaticText(PanelPres, -1, u'Laboratoire ')
1095 label_lerass.SetForegroundColour(txtcolour)
1096 label_lerass.SetBackgroundColour(bckgrdcolor)
1097 self.hyper_lerass = hl.HyperLinkCtrl(PanelPres, -1, u'LERASS', URL="http://www.lerass.com")
1098 self.hyper_lerass.SetColours(linkcolor, linkcolor, "RED")
1099 self.hyper_lerass.SetBackgroundColour(bckgrdcolor)
1100 self.hyper_lerass.EnableRollover(True)
1101 self.hyper_lerass.SetUnderlines(False, False, True)
1102 self.hyper_lerass.SetBold(True)
1103 self.hyper_lerass.UpdateLink()
1104 blank = wx.StaticText(PanelPres, -1, u'\n')
1105 blank1 = wx.StaticText(PanelPres, -1, u'\n')
1106 labellicence = wx.StaticText(PanelPres, -1, u'Licence GNU GPL')
1107 labellicence.SetForegroundColour(txtcolour)
1108 labellicence.SetBackgroundColour(bckgrdcolor)
1109 labelcopy = wx.StaticText(PanelPres, -1, ConfigGlob.get('DEFAULT', 'copyright'))
1110 labelcopy.SetForegroundColour(txtcolour)
1111 labelcopy.SetBackgroundColour(bckgrdcolor)
1112 python_img = wx.Image(os.path.join(ImagePath,'python-logo.jpg'), wx.BITMAP_TYPE_ANY).ConvertToBitmap()
1113 r_img = wx.Image(os.path.join(ImagePath,'Rlogo.jpg'), wx.BITMAP_TYPE_ANY).ConvertToBitmap()
1114 lexique_img = wx.Image(os.path.join(ImagePath,'LexTexte4.jpg'), wx.BITMAP_TYPE_ANY).ConvertToBitmap()
1115 but_python = wx.BitmapButton(self, -1, python_img)
1116 but_lexique = wx.BitmapButton(self, -1, lexique_img)
1117 but_r = wx.BitmapButton(self, -1, r_img)
1118 self.Bind(wx.EVT_BUTTON, self.OnPython, but_python)
1119 self.Bind(wx.EVT_BUTTON, self.OnLexique, but_lexique)
1120 self.Bind(wx.EVT_BUTTON, self.OnR, but_r)
1123 #grid_sizer_1.Add(label3, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1124 grid_sizer_1.Add(self.hyper2, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1125 grid_sizer_3.Add(label_lerass, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1126 grid_sizer_3.Add(self.hyper_lerass, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1127 sizer4.Add(label_1, 0, wx.ALIGN_CENTER, 5)
1128 sizer2.Add(label2, 0, wx.ALIGN_CENTER, 5)
1129 #sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1130 sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1131 sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1132 sizer2.Add(grid_sizer_3, 0, wx.ALIGN_CENTER, 5)
1133 sizer2.Add(wx.StaticText(PanelPres, -1, u' '), 0, wx.ALIGN_CENTER, 5)
1134 #sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1135 #sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1136 sizer2.Add(grid_sizer_1, 0, wx.ALIGN_CENTER, 5)
1137 sizer2.Add(labellicence, 0, wx.ALIGN_CENTER, 5)
1138 sizer2.Add(labelcopy, 0, wx.ALIGN_CENTER, 5)
1139 sizer1.Add(sizer4, 1, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1140 PanelPres.SetSizer(sizer2)
1141 sizer5.Add(blank, 1, wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 2)
1142 sizer5.Add(PanelPres, 1, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1143 sizer5.Add(blank1, 1, wx.ALIGN_CENTER_HORIZONTAL,2)
1144 grid_sizer_2.Add(but_python, 1, wx.ALIGN_CENTER_HORIZONTAL| wx.ALIGN_CENTER_VERTICAL)
1145 grid_sizer_2.Add(but_lexique, 1,wx.ALIGN_CENTER_HORIZONTAL| wx.ALIGN_CENTER_VERTICAL)
1146 grid_sizer_2.Add(but_r, 1, wx.ALIGN_CENTER_HORIZONTAL| wx.ALIGN_CENTER_VERTICAL)
1148 sizer1.Add(sizer5, 3, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 1)
1149 sizer1.Add(grid_sizer_2, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL)
1150 self.SetSizer(sizer1)
1153 def OnPython(self,evt):
1154 webbrowser.open('http://www.python.org')
1156 def OnLexique(self,evt):
1157 webbrowser.open('http://www.lexique.org')
1160 webbrowser.open('http://www.r-project.org')
1162 class MySplashScreen(wx.SplashScreen):
1164 bmp = wx.Image(os.path.join(ImagePath, 'splash.png')).ConvertToBitmap()
1165 wx.SplashScreen.__init__(self, bmp,
1166 wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
1168 self.Bind(wx.EVT_CLOSE, self.OnClose)
1169 self.fc = wx.FutureCall(1, self.ShowMain)
1171 def OnClose(self, evt):
1175 if self.fc.IsRunning():
1180 frame = IraFrame(None, -1, "IRaMuTeQ " + ConfigGlob.get('DEFAULT', 'version'), size=(1100, 800))
1184 frame.OnOpenFromCmdl()
1185 # if self.fc.IsRunning():
1187 #wx.CallAfter(frame.ShowTip)
1189 class MyApp(wx.App):
1192 Create and show the splash screen. It will then create and show
1193 the main frame when it is time to do so.
1195 wx.SystemOptions.SetOptionInt("mac.window-plain-transition", 1)
1196 self.SetAppName("Iramuteq")
1197 splash = MySplashScreen()
1205 if __name__ == '__main__':