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 import wx.lib.agw.aui as aui
34 import wx.lib.hyperlink as hl
35 #------------------------------------
36 from functions import BugReport, PlaySound, ReadLexique, History, DoConf, ReadDicoAsDico, progressbar
37 from checkversion import NewVersion
38 from guifunct import *
39 from tableau import Tableau
40 from dialog import PrefDialog, CorpusPref
41 from tabfrequence import Frequences
42 from tabchi2 import ChiSquare
43 #from tabstudent import MakeStudent
44 from tabchddist import ChdCluster
45 from tabafcm import DoAFCM
46 from tabchdalc import AnalyseQuest
47 from tabsimi import DoSimi
48 from tabrsimple import InputText
49 from tabverges import Prototypical
50 #from textafcuci import AfcUci
51 from analysetxt import Alceste
52 from textdist import AnalysePam
53 from textstat import Stat
54 from textaslexico import Lexico
55 from textsimi import SimiTxt, SimiFromCluster
56 from textwordcloud import WordCloud, ClusterCloud
57 #from profile_segment import ProfileSegment
58 #from textcheckcorpus import checkcorpus
59 from openanalyse import OpenAnalyse
60 from corpus import Builder
61 from sheet import MySheet
62 from checkinstall import CreateIraDirectory, CheckRPath, FindRPAthWin32, FindRPathNix, CheckRPackages, IsNew, UpgradeConf, CopyConf, RLibsAreInstalled
63 from chemins import RscriptsPath, ConstructConfigPath, ConstructDicoPath, ConstructGlobalPath, PathOut
64 from parse_factiva_xml import ImportFactiva
65 from tools import Extract
67 from tree import LeftTree
68 ##########################################################
69 ID_OpenData = wx.NewId()
70 ID_Import = wx.NewId()
71 ID_OpenText = wx.NewId()
72 ID_OnOpenAnalyse = wx.NewId()
75 ID_Student = wx.NewId()
76 ID_CHDSIM = wx.NewId()
77 ID_CHDAlceste = wx.NewId()
78 ID_TEXTAFCM = wx.NewId()
79 ID_TEXTSTAT = wx.NewId()
81 ID_TEXTALCESTE = wx.NewId()
82 ID_TEXTPAM = wx.NewId()
83 ID_CHECKCORPUS = wx.NewId()
84 ID_Tabcontent = wx.NewId()
87 ID_CloseTab = wx.NewId()
88 ID_SaveTab = wx.NewId()
89 ID_CreateText = wx.NewId()
90 ID_ACCEUIL = wx.NewId()
91 ID_RESULT = wx.NewId()
92 ID_VIEWDATA = wx.NewId()
93 ID_HTMLcontent = wx.NewId()
94 ID_SimiTxt = wx.NewId()
96 ID_ImportTXM = wx.NewId()
97 ##########################################################
98 #elements de configuration
99 ##########################################################
101 if sys.platform == 'darwin' :
102 sys.setdefaultencoding('UTF-8')
103 wx.SetDefaultPyEncoding('UTF-8')
105 sys.setdefaultencoding(locale.getpreferredencoding())
107 #chemin de l'application
108 AppliPath = os.path.abspath(os.path.dirname(os.path.realpath(sys.argv[0])))
110 ImagePath = os.path.join(AppliPath, 'images')
111 #configuration generale
112 DictConfigPath = ConstructGlobalPath(AppliPath)
113 ConfigGlob = ConfigParser()
114 ConfigGlob.read(DictConfigPath['global'])
115 #repertoire de l'utilisateur
116 if os.getenv('HOME') != None:
117 user_home = os.getenv('HOME')
119 user_home = os.getenv('HOMEPATH')
120 UserConfigPath = os.path.abspath(os.path.join(user_home, '.iramuteq'))
121 #Si pas de fichiers de config utilisateur, on cree le repertoire
122 CreateIraDirectory(UserConfigPath, AppliPath)
123 #fichiers log pour windows (py2exe)
124 log = logging.getLogger('iramuteq')
125 fh = logging.FileHandler(os.path.join(UserConfigPath,'stdout.log'))
126 formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
127 fh.setFormatter(formatter)
129 if sys.platform != 'win32' and sys.platform != 'darwin':
130 ch = logging.StreamHandler()
131 ch.setFormatter(formatter)
133 log.setLevel(logging.INFO)
135 class writer(object):
136 def write(self, data):
137 if data.strip() != '' :
138 log.info('ERROR : %s' % data)
140 class printer(object) :
141 def write(self, data) :
142 if data.strip() != '' :
143 log.info('Print : %s' % data)
145 sys.stderr = writer()
146 sys.stdout = printer()
148 ConfigPath = ConstructConfigPath(UserConfigPath)
150 langues = {'french' : wx.LANGUAGE_FRENCH,
151 'english' : wx.LANGUAGE_ENGLISH,}
152 #####################################################################
154 class IraFrame(wx.Frame):
155 def __init__(self, parent, id= -1, title="", pos=wx.DefaultPosition,
156 size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE |
159 log.info('Starting...')
160 wx.Frame.__init__(self, parent, id, title, pos, size, style)
162 self.AppliPath = AppliPath
163 self.images_path = os.path.join(AppliPath,'images')
164 self.UserConfigPath = UserConfigPath
165 #self.RscriptsPath = ConstructRscriptsPath(AppliPath)
166 self.RscriptsPath = PathOut(dirout=os.path.join(AppliPath, 'Rscripts'))
167 self.RscriptsPath.basefiles(RscriptsPath)
168 #self.DictPath = ConstructDicoPath(AppliPath)
169 self.DictPath = ConstructDicoPath(UserConfigPath)
170 self.ConfigGlob = ConfigGlob
171 self.ConfigPath = ConstructConfigPath(UserConfigPath)
172 self.pref = RawConfigParser()
173 #workaround for import problem
174 self.SimiFromCluster = SimiFromCluster
176 gettext.install('iramuteq', os.path.join(AppliPath,'locale'), unicode=True)
177 self.presLan_fr = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['fr_FR'])
178 self.presLan_en = gettext.translation("iramuteq", os.path.join(AppliPath,'locale'), languages=['en'])
180 # tell FrameManager to manage this frame
181 #self._mgr = wx.aui.AuiManager()
182 self._mgr = aui.AuiManager()
183 self._mgr.SetManagedWindow(self)
186 #--------------------------------------------------------------------------------
187 self.mb = wx.MenuBar()
189 file_menu = wx.Menu()
190 item = wx.MenuItem(file_menu, ID_OpenData, _(u"Open a matrix").decode('utf8'), _(u"Open a matrix").decode('utf8'))
191 item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
192 file_menu.AppendItem(item)
194 item = wx.MenuItem(file_menu, ID_OpenText, _(u"Open a text corpora").decode('utf8'), _(u"Open a text corpora").decode('utf8'))
195 item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
196 file_menu.AppendItem(item)
198 item = wx.MenuItem(file_menu, ID_OnOpenAnalyse, _(u"Open an analysis").decode('utf8'), _(u"Open an analysis").decode('utf8'))
199 item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
200 file_menu.AppendItem(item)
203 menuFactiva = wx.Menu()
204 fact_from_xml = wx.MenuItem(menuFactiva, wx.ID_ANY, _(u"from xml").decode('utf8'))
205 fact_from_mail = wx.MenuItem(menuFactiva, wx.ID_ANY, _(u"from mail").decode('utf8'))
206 fact_from_txt = wx.MenuItem(menuFactiva, wx.ID_ANY, _(u"from copy/paste").decode('utf8'))
207 menuFactiva.AppendItem(fact_from_xml)
208 menuFactiva.AppendItem(fact_from_mail)
209 menuFactiva.AppendItem(fact_from_txt)
210 file_menu.AppendMenu(-1, _(u"Import from factiva").decode('utf8'), menuFactiva)
212 item = wx.MenuItem(file_menu, ID_ImportTXM, _(u"Import from TXM").decode('utf8'), _(u"Import from TXM").decode('utf8'))
213 item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
214 file_menu.AppendItem(item)
216 menuTools = wx.Menu()
217 splitvar = wx.MenuItem(menuTools, wx.ID_ANY, _(u"Split from variable").decode('utf8'))
218 extractmod = wx.MenuItem(menuTools, wx.ID_ANY, _(u"Extract mods").decode('utf8'))
219 menuTools.AppendItem(splitvar)
220 menuTools.AppendItem(extractmod)
221 self.ID_splitvar = splitvar.GetId()
222 self.ID_extractmod = extractmod.GetId()
223 file_menu.AppendMenu(-1, _(u"Tools"), menuTools)
226 item = wx.MenuItem(file_menu, ID_SaveTab, _(u"Save tab as...").decode('utf8'), _(u"Save tab as...").decode('utf8'))
227 item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_SAVE_AS))
228 file_menu.AppendItem(item)
230 file_menu.Append(wx.ID_EXIT, _(u"Exit").decode('utf8'))
232 edit_menu = wx.Menu()
233 edit_menu.Append(wx.ID_PREFERENCES, '', _(u'Preferences').decode('utf8'))
235 view_menu = wx.Menu()
236 view_menu.Append(ID_ACCEUIL, _(u"Home page").decode('utf8'))
237 view_menu.Append(ID_VIEWDATA, _(u"Show data").decode('utf8'))
238 view_menu.Append(ID_RESULT, _(u'Show results').decode('utf8'))
239 #view_menu.AppendSeparator()
241 analyse_menu = wx.Menu()
242 analyse_menu.Append(ID_Freq, _(u"Frequencies").decode('utf8'))
243 analyse_menu.Append(ID_Chi2, _(u"Chi2").decode('utf8'))
244 #analyse_menu.Append(ID_Student, u"t de Student")
245 menu_classif = wx.Menu()
246 menu_classif.Append(ID_CHDAlceste, _(u"Reinert Method").decode('utf8'))
247 #menu_classif.Append(ID_CHDSIM, u"Par matrice des distances")
248 analyse_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classif)
249 #analyse_menu.Append(ID_AFCM, u"AFCM")
250 analyse_menu.Append(ID_SIMI, _(u"Similarities Analysis").decode('utf8'))
251 analyse_menu.Append(ID_proto, _(u"Prototypical analysis").decode('utf8'))
252 ID_RCODE = wx.NewId()
253 analyse_menu.Append(ID_RCODE, u"Code R...")
255 text_menu = wx.Menu()
256 #text_menu.Append(ID_CHECKCORPUS, u"Vérifier le corpus")
257 text_menu.Append(ID_TEXTSTAT, _(u"Statistics").decode('utf8'))
258 text_menu.Append(ID_ASLEX, _(u"Specificities and CA").decode('utf8'))
259 #text_menu.Append(ID_TEXTAFCM, u"AFC sur UCI / Vocabulaire")
260 menu_classiftxt = wx.Menu()
261 menu_classiftxt.Append(ID_TEXTALCESTE, _(u"Reinert Method").decode('utf8'))
262 #menu_classiftxt.Append(ID_TEXTPAM, u"Par matrice des distances")
263 text_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classiftxt)
264 text_menu.Append(ID_SimiTxt, _(u"Similarities Analysis").decode('utf8'))
266 text_menu.Append(ID_WC, _(u"WordCloud").decode('utf8'))
268 help_menu = wx.Menu()
269 help_menu.Append(wx.ID_ABOUT, _(u"About...").decode('utf8'))
270 help_menu.Append(wx.ID_HELP, _(u"Inline help...").decode('utf8'))
272 self.mb.Append(file_menu, _(u"File").decode('utf8'))
273 self.mb.Append(edit_menu, _(u"Edition").decode('utf8'))
274 self.mb.Append(view_menu, _(u"View").decode('utf8'))
275 self.mb.Append(analyse_menu, _("Matrix analysis").decode('utf8'))
276 self.mb.Append(text_menu, _(u"Text analysis").decode('utf8'))
277 self.mb.Append(help_menu, _(u"Help").decode('utf8'))
279 self.SetMenuBar(self.mb)
280 #--------------------------------------------------------------------
281 self.statusbar = self.CreateStatusBar(2, wx.ST_SIZEGRIP)
282 self.statusbar.SetStatusWidths([-2, -3])
283 self.statusbar.SetStatusText(u"Prêt", 0)
284 self.statusbar.SetStatusText(u"Bienvenue", 1)
286 # min size for the frame itself isn't completely done.
287 # see the end up FrameManager::Update() for the test
288 # code. For now, just hard code a frame minimum size
289 self.SetMinSize(wx.Size(400, 400))
291 # create some toolbars
292 tb1 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,
293 wx.TB_FLAT | wx.TB_NODIVIDER)
294 tb1.SetToolBitmapSize(wx.Size(16, 16))
295 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")
297 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")
301 #------------------------------------------------------------------------------------------------
303 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)
305 #self._mgr.AddPane(self.text_ctrl_txt, wx.aui.AuiPaneInfo().
306 # Name("Text").CenterPane())
307 self._mgr.AddPane(self.text_ctrl_txt, aui.AuiPaneInfo().
308 Name("Text").CenterPane())
309 #self._mgr.AddPane(IntroPanel(self), wx.aui.AuiPaneInfo().Name("Intro_Text").
311 self._mgr.AddPane(IntroPanel(self), aui.AuiPaneInfo().Name("Intro_Text").
313 #if not os.path.exists(os.path.join(UserConfigPath, 'history.db')) :
314 # with open(os.path.join(UserConfigPath, 'history.db'), 'w') as f :
316 self.history = History(os.path.join(UserConfigPath, 'history.db'))
317 self.tree = LeftTree(self)
318 self._mgr.AddPane(self.tree, aui.AuiPaneInfo().Name("lefttree").Caption(_(u"Navigator").decode('utf8')).
319 Left().MinSize(wx.Size(200,500)).Layer(1).Position(1).CloseButton(False).MaximizeButton(True).
320 MinimizeButton(True))
322 #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)
323 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)
324 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
325 self.nb.SetAGWWindowStyleFlag(notebook_flags)
326 self.nb.SetArtProvider(aui.ChromeTabArt())
327 #self.nb.SetArtProvider(aui.VC8TabArt())
328 #self.nb.parent = self
329 #self._notebook_style = aui.AUI_NB_DEFAULT_STYLE | aui.AUI_NB_TAB_EXTERNAL_MOVE | wx.NO_BORDER
330 #self._mgr.AddPane(self.nb, wx.aui.AuiPaneInfo().
331 # Name("Tab_content").
333 self._mgr.AddPane(self.nb, aui.AuiPaneInfo().
336 self.Sheet = MySheet(self)
337 #self._mgr.AddPane(self.Sheet, wx.aui.AuiPaneInfo().Name("Data").CenterPane())
338 self._mgr.AddPane(self.Sheet, aui.AuiPaneInfo().Name("Data").CenterPane())
339 self.nb.Bind(aui.EVT_AUINOTEBOOK_PAGE_CLOSE, self.OnCloseTab)
340 self.nb.Bind(aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.OnPageChanged)
341 # add the toolbars to the manager
343 #self._mgr.AddPane(tb1, wx.aui.AuiPaneInfo().
344 # Name("tb1").Caption("Fichiers").
345 # ToolbarPane().Top().
346 # LeftDockable(False).RightDockable(False))
347 self._mgr.AddPane(tb1, aui.AuiPaneInfo().
348 Name("tb1").Caption("Fichiers").
350 LeftDockable(True).RightDockable(False))
352 self.ShowAPane("Intro_Text")
353 self._mgr.GetPane("lefttree").Show()
354 self._mgr.GetPane("classif_tb").Hide()
355 # "commit" all changes made to FrameManager
358 # Show How To Use The Closing Panes Event
359 ##################################################################
360 self.Bind(wx.EVT_MENU, self.OnAcceuil, id=ID_ACCEUIL)
361 self.Bind(wx.EVT_MENU, self.OnViewData, id=ID_VIEWDATA)
362 self.Bind(wx.EVT_MENU, self.ShowTab, id=ID_RESULT)
363 self.Bind(wx.EVT_MENU, self.OnOpenData, id=ID_OpenData)
364 self.Bind(wx.EVT_MENU, self.OnOpenText, id=ID_OpenText)
365 self.Bind(wx.EVT_MENU, self.OnOpenAnalyse, id=ID_OnOpenAnalyse)
366 self.Bind(wx.EVT_MENU, self.import_factiva_xml, fact_from_xml)
367 self.Bind(wx.EVT_MENU, self.import_factiva_mail, fact_from_mail)
368 self.Bind(wx.EVT_MENU, self.import_factiva_txt, fact_from_txt)
369 self.Bind(wx.EVT_MENU, self.ExtractTools, splitvar)
370 self.Bind(wx.EVT_MENU, self.ExtractTools, extractmod)
371 self.Bind(wx.EVT_MENU, self.OnFreq, id=ID_Freq)
372 self.Bind(wx.EVT_MENU, self.OnChi2, id=ID_Chi2)
373 self.Bind(wx.EVT_MENU, self.OnStudent, id=ID_Student)
374 self.Bind(wx.EVT_MENU, self.OnCHDSIM, id=ID_CHDSIM)
375 self.Bind(wx.EVT_MENU, self.OnCHDAlceste, id=ID_CHDAlceste)
376 self.Bind(wx.EVT_MENU, self.OnAFCM, id=ID_AFCM)
377 self.Bind(wx.EVT_MENU, self.OnProto, id=ID_proto)
378 self.Bind(wx.EVT_MENU, self.OnRCode, id=ID_RCODE)
379 #self.Bind(wx.EVT_MENU, self.OnCheckcorpus, id = ID_CHECKCORPUS)
380 self.Bind(wx.EVT_MENU, self.OnTextStat, id=ID_TEXTSTAT)
381 self.Bind(wx.EVT_MENU, self.OnTextSpec, id=ID_ASLEX)
382 self.Bind(wx.EVT_MENU, self.OnTextAfcm, id=ID_TEXTAFCM)
383 self.Bind(wx.EVT_MENU, self.OnTextAlceste, id=ID_TEXTALCESTE)
384 self.Bind(wx.EVT_MENU, self.OnPamSimple, id=ID_TEXTPAM)
385 self.Bind(wx.EVT_MENU, self.OnSimiTxt, id=ID_SimiTxt)
386 self.Bind(wx.EVT_MENU, self.OnWordCloud, id=ID_WC)
387 self.Bind(wx.EVT_MENU, self.OnSimi, id=ID_SIMI)
388 self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
389 self.Bind(wx.EVT_MENU, self.OnSaveTabAs, id=ID_SaveTab)
390 self.Bind(wx.EVT_MENU, self.OnAbout, id=wx.ID_ABOUT)
391 self.Bind(wx.EVT_MENU, self.OnHelp, id=wx.ID_HELP)
392 self.Bind(wx.EVT_MENU, self.OnPref, id=wx.ID_PREFERENCES)
393 self.Bind(wx.EVT_MENU, self.OnImportTXM, id=ID_ImportTXM)
394 self.Bind(wx.EVT_CLOSE, self.OnClose)
395 ##################################################################
396 flags = self._mgr.GetAGWFlags()
397 #flags &= ~wx.aui.AUI_MGR_TRANSPARENT_HINT
398 #flags &= ~wx.aui.AUI_MGR_VENETIAN_BLINDS_HINT
399 #flags &= ~wx.aui.AUI_MGR_RECTANGLE_HINT
400 flags &= ~(aui.AUI_MGR_RECTANGLE_HINT | aui.AUI_MGR_ALLOW_FLOATING)
401 self._mgr.SetAGWFlags(self._mgr.GetAGWFlags() ^ (aui.AUI_MGR_RECTANGLE_HINT | aui.AUI_MGR_ALLOW_FLOATING))
402 self._mgr.GetArtProvider().SetMetric(aui.AUI_DOCKART_GRADIENT_TYPE, aui.AUI_GRADIENT_HORIZONTAL)
403 self.GetDockArt().SetColor(aui.AUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR, "#00FFF9")
406 self._icon = wx.Icon(os.path.join(ImagePath, "iraicone.ico"), wx.BITMAP_TYPE_ICO)
407 self.SetIcon(self._icon)
408 ##########################
410 self.input_path = [False]
411 self.TEMPDIR = tempfile.mkdtemp('iramuteq')
412 self.FileTabList = []
418 self.g_header = False
425 self.SysEncoding = sys.getdefaultencoding()
426 self.syscoding = sys.getdefaultencoding()
427 #print 'SysEncoding',self.SysEncoding
428 if self.SysEncoding == 'mac-roman' : self.SysEncoding = 'MacRoman'
431 ##############################################################@
432 self.DisEnSaveTabAs(False)
433 self.ShowMenu(_("View").decode('utf8'), False)
434 self.ShowMenu(_("Matrix analysis").decode('utf8'), False)
435 self.ShowMenu(_("Text analysis").decode('utf8'), False)
446 def finish_init(self) :
448 self.pref.read(self.ConfigPath['preferences'])
451 self.pref.read(self.ConfigPath['preferences'])
458 self.pref.read(self.ConfigPath['preferences'])
460 self.sound = self.pref.getboolean('iramuteq', 'sound')
461 self.check_update = self.pref.getboolean('iramuteq', 'checkupdate')
462 self.version = ConfigGlob.get('DEFAULT', 'version')
463 #configuration des chemins de R
464 self.PathPath = ConfigParser()
465 self.PathPath.read(ConfigPath['path'])
467 if not CheckRPath(self.PathPath) :
468 if sys.platform == 'win32':
469 BestRPath = FindRPAthWin32()
471 BestRPath = FindRPathNix()
473 self.PathPath.set('PATHS', 'rpath', BestRPath)
474 with open(ConfigPath['path'], 'w') as f :
475 self.PathPath.write(f)
479 self.RPath = self.PathPath.get('PATHS', 'rpath')
482 if not RLibsAreInstalled(self) :
486 Le chemin de l'executable de R n'a pas été trouvé.
487 Si R n'est pas installé, vous devez l'installer (http://www.r-project.org/).
488 Si R n'est pas installé dans le répertoire par défaut
489 (souvent C:\Program Files\R\R-2.x.x\R.exe sous windows ou /usr/bin/R sous linux ou Mac Os X)
490 vous devez signaler le chemin de l'éxecutable de R dans les préférences."""
491 dlg = wx.MessageDialog(self, msg, u"Problème de configuration", wx.OK | wx.NO_DEFAULT | wx.ICON_WARNING)
493 if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
498 def setlangue(self) :
500 self.pref.read(self.ConfigPath['preferences'])
501 guilangue = self.pref.get('iramuteq', 'guilanguage')
502 if guilangue == 'french' :
503 self.presLan_fr.install()
505 self.presLan_en.install()
506 mylocale = wx.Locale(langues[guilangue])
507 mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale'))
508 mylocale.AddCatalog('iramuteq')
510 self.presLan_fr.install()
511 mylocale = wx.Locale(langues['french'])
512 mylocale.AddCatalogLookupPathPrefix(os.path.join(AppliPath,'locale'))
513 mylocale.AddCatalog('iramuteq')
516 def OnVerif(self, evt) :
517 pack = CheckRPackages(self)
519 dlg = wx.MessageDialog(self, u"Installation OK", u"Installation", wx.OK | wx.ICON_INFORMATION)
521 if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
524 def DisEnSaveTabAs(self, DISEN):
526 file_menu = self.mb.GetMenu(0)
527 items = file_menu.GetMenuItems()
529 if item.GetId() == ID_SaveTab :
532 def ShowMenu(self, menu, Show=True):
533 menu_pos = self.mb.FindMenu(menu)
534 self.mb.EnableTop(menu_pos, Show)
535 self.mb.UpdateMenus()
538 #--------------------------------------------------------------------
539 def OnClose(self, event):
541 with open(self.ConfigPath['path'], 'w') as f :
542 self.PathPath.write(f)
543 if self.DictTab != {} :
544 savestates = [self.DictTab[item][0] for item in self.DictTab]
545 if False in savestates :
546 notsave = [item for item in self.DictTab if self.DictTab[item][0] == False]
548 Certains résultats ne sont pas enregistrés.
549 Voulez-vous fermer quand même ?"""
550 dlg = wx.MessageDialog(self, msg, "Sauvegarde",
551 wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
553 if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
558 for item in notsave :
559 for tmpfile in self.DictTab[item][1:] :
561 print 'remove : ' + tmpfile
573 #if sys.platform == 'win32' :
574 # os.system("taskkill /im iramuteq.exe /f")
575 # print 'meurtre de process'
577 def OnOpenData(self, event):
578 inputname, self.input_path = OnOpen(self, "Data")
580 self.filename = self.input_path[0]
581 self.tableau = Tableau(self,os.path.abspath(self.input_path[0]))
582 get_table_param(self, self.input_path[0])
583 self.tableau.make_content()
584 self.tableau.show_tab()
586 def OnOpenAnalyse(self, event):
587 self.AnalysePath = OnOpen(self, "Analyse")
588 OpenAnalyse(self, self.AnalysePath[1][0], True)
589 self.ShowMenu(_("View"))
591 def OnOpenText(self, event):
592 inputname, self.input_path = OnOpen(self, "Texte")
593 self.filename = self.input_path[0]
597 def OnViewData(self, event):
600 if self.type == "Data":
601 if not self.DataPop :
602 self.Sheet.Populate(self.content)
605 self.ShowAPane(u"Data")
606 elif self.type == "Texte" or self.type == 'Analyse' :
607 if not self.DataTxt :
608 self.text_ctrl_txt.Clear()
609 self.text_ctrl_txt.write(self.content)
610 self.text_ctrl_txt.ShowPosition(0)
613 self.ShowAPane(u"Text")
617 dlg = wx.ProgressDialog("Ouverture...",
618 "Veuillez patienter...",
621 style=wx.PD_APP_MODAL | wx.PD_AUTO_HIDE | wx.PD_ELAPSED_TIME | wx.PD_CAN_ABORT
624 builder = Builder(self, dlg)
625 if builder.res == wx.ID_OK :
627 corpus = builder.doanalyse()
628 self.history.add(corpus.parametres)
629 self.tree.OnItemAppend(corpus.parametres)
630 OpenAnalyse(self, corpus.parametres)
635 keepGoing = dlg.Update(count, u"Lecture du fichier")
636 self.ShowMenu(_(u"View").decode('utf8'))
637 self.ShowMenu(_(u"Text analysis").decode('utf8'))
638 self.ShowMenu(_(u"Matrix analysis").decode('utf8'), False)
643 keepGoing = dlg.Update(count, u"Chargement du dictionnaire")
645 #self.OnViewData(wx.EVT_BUTTON)
647 def OnExit(self, event):
650 def OnAbout(self, event):
651 info = wx.AboutDialogInfo()
652 info.Name = ConfigGlob.get('DEFAULT', 'name')
653 info.Version = ConfigGlob.get('DEFAULT', 'version')
654 info.Copyright = ConfigGlob.get('DEFAULT', 'copyright')
655 info.Description = u"""
656 Interface de R pour les Analyses Multidimensionnelles
657 de Textes et de Questionnaires
660 construit avec des logiciels libres.
666 info.WebSite = ("http://www.iramuteq.org", u"Site web IRaMuTeQ")
667 dev = ConfigGlob.get('DEFAULT', 'dev').split(';')
668 info.Developers = dev
669 info.License = u"""Iramuteq est un logiciel libre ; vous pouvez le diffuser et/ou le modifier
670 suivant les termes de la Licence Publique Générale GNU telle que publiée
671 par la Free Software Foundation ; soit la version 2 de cette licence,
672 soit (à votre convenance) une version ultérieure.
674 Iramuteq est diffusé dans l'espoir qu'il sera utile,
675 mais SANS AUCUNE GARANTIE ; sans même une garantie implicite
676 de COMMERCIALISATION ou d'ADÉQUATION À UN USAGE PARTICULIER.
677 Voyez la Licence Publique Générale GNU pour plus de détails.
679 Vous devriez avoir reçu une copie de la Licence Publique Générale GNU
680 avec Iramuteq ; sinon, veuillez écrire à la Free Software Foundation,
681 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, États-Unis."""
684 def GetDockArt(self):
685 return self._mgr.GetArtProvider()
690 def OnPageChanged(self, event) :
691 new = event.GetSelection()
692 nobject = event.GetEventObject()
693 parent = nobject.GetParent()
694 if isinstance(parent, IraFrame) :
695 npage = self.nb.GetPage(new)
696 if 'parametres' in dir(npage) :
697 self.tree.GiveFocus(uuid=npage.parametres['uuid'])
699 def OnCloseTab(self, evt):
700 #log.info('Closing tab %s' % str(evt.GetEventObject()))
701 ctrl = evt.GetEventObject()
702 if isinstance(ctrl.GetParent(), aui.AuiNotebook) or isinstance(ctrl.GetParent(), wx.Panel):
706 page = self.nb.GetPage(self.nb.GetSelection())
707 if 'parametres' in dir(page) and isinstance(ctrl.GetParent(), IraFrame) :
708 self.history.rmtab(page.parametres)
709 self.tree.CloseItem(uuid = page.parametres['uuid'])
710 TabTitle = self.nb.GetPageText(self.nb.GetSelection())
711 if self.DictTab != {} :
712 if TabTitle in self.DictTab :
713 ListFile=self.DictTab[TabTitle]
714 if False in ListFile:
716 Certains résultats ne sont pas enregistrer.
717 Voulez-vous fermer quand même ?"""
718 dlg = wx.MessageDialog(self, msg, "Sauvegarde",wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
721 if dlg.ShowModal() in [wx.ID_NO, wx.ID_CANCEL]:
726 for f in ListFile[1:] :
731 elif True in ListFile :
734 del self.DictTab[TabTitle]
739 if self.nb.GetPageCount() == 1 and remove and not notebook :
742 def LastTabClose(self) :
743 if self.nb.GetPageCount() == 1 :
744 self.DisEnSaveTabAs(False)
746 self.ShowAPane("Text")
748 self.ShowAPane("Data")
750 self.ShowAPane("Intro_Text")
752 def OnSaveTabAs(self, event):
753 SelectTab = self.nb.GetSelection()
754 TabTitle = self.nb.GetPageText(SelectTab)
755 FileToSave = self.DictTab[TabTitle]
758 self, message="Enregistrer sous...", defaultDir=os.getcwd(),
759 defaultFile="resultat.html", wildcard="Tous les fichiers|*", style=wx.SAVE | wx.OVERWRITE_PROMPT
761 dlg.SetFilterIndex(2)
764 if dlg.ShowModal() == wx.ID_OK:
766 Dirname = os.path.dirname(Path)
767 Filename = dlg.GetFilename()
772 shutil.copyfile(FileToSave[-1], Path)
773 os.remove(FileToSave[len(FileToSave) - 1])
774 NewListFile.append(True)
775 NewListFile.append(Path)
776 for f in FileToSave[1:-1] :
777 Fileout = os.path.join(Dirname, os.path.basename(f))
778 shutil.copyfile(f, Fileout)
779 NewListFile.append(Fileout)
782 self.DictTab[TabText] = NewListFile
783 del self.DictTab[TabTitle]
784 self.nb.SetPageText(SelectTab, TabText)
786 def GetStartPosition(self):
790 pt = self.ClientToScreen(wx.Point(0, 0))
792 return wx.Point(pt.x + x, pt.y + x)
794 def ShowAPane(self, panel):
795 for pane in self._mgr.GetAllPanes() :
796 if not pane.IsToolbar() and pane.name != 'lefttree':
798 self._mgr.GetPane(panel).Show()
801 def OnAcceuil(self, event):
802 self.ShowAPane(u"Intro_Text")
805 def CreateHTMLCtrl(self):
806 ctrl = wx.html.HtmlWindow(self, -1, wx.DefaultPosition, wx.Size(400, 300))
807 if "gtk2" in wx.PlatformInfo:
808 ctrl.SetStandardFonts()
809 ctrl.SetPage(u"text")
812 def ShowTab(self, evt):
813 self.ShowAPane("Tab_content")
815 ################################################################
817 ################################################################
819 def OnFreq(self, event):
825 def OnChi2(self, event):
827 # print('PAS DE DEBUG SUR CHI2')
828 chi = ChiSquare(self)
832 def OnStudent(self, event):
838 def OnRCode(self, event):
844 def OnCHDSIM(self, event):
846 # print 'ATTENTION!!!!'
847 chdsim = ChdCluster(self)
848 if chdsim.val == wx.ID_OK:
853 def OnCHDAlceste(self, event):
855 # print('PLUS DE BUG SUR ALCESTE QUESTIONNAIRE')
856 self.quest = AnalyseQuest(self)
857 if self.quest.val == wx.ID_OK:
862 def OnProto(self, evt) :
863 Prototypical(self, {'type' : 'proto'})
865 def OnSimiTxt(self, evt, corpus = None) :
866 # print 'PLUS DE BUG SUR SIMITXT'
868 #self.Text = SimiTxt(self)
870 corpus = self.tree.getcorpus()
871 self.Text = SimiTxt(self, corpus, parametres = {'type': 'simitxt'}, dlg = progressbar(self, 3))
872 if self.Text.val == wx.ID_OK :
877 def OnWordCloud(self, evt, corpus = None) :
878 # print 'PLUS DE BUG SUR WORDCLOUD'
881 corpus = self.tree.getcorpus()
882 self.Text = WordCloud(self, corpus, parametres = {'type' : 'wordcloud'}, dlg = progressbar(self, 3))
883 if self.Text.val == wx.ID_OK :
888 def OnClusterCloud(self, corpus, parametres = None) :
889 self.Text = ClusterCloud(self, corpus, parametres = parametres, dlg = progressbar(self, 3))
891 def OnAFCM(self, event):
897 def OnTextStat(self, event, corpus = None):
898 #print 'PAS DE BUG SUR TEXT STAT'
901 corpus = self.tree.getcorpus()
902 self.Text = Stat(self, corpus, parametres = {'type': 'stat'}, dlg = progressbar(self, 7))
904 if self.Text.val == wx.ID_OK :
909 def OnTextSpec(self, event, corpus = None):
911 #self.Text = AsLexico(self)
912 #print('ATTENTION : PLUS DE BUG SUR LEXICO')
914 corpus = self.tree.getcorpus()
915 self.Text = Lexico(self, corpus, parametres = {'type' : 'spec'}, dlg = progressbar(self, 3))
916 if self.Text.val == wx.ID_OK :
921 def OnTextAfcm(self, event):
928 def import_factiva_xml(self,event):
930 ImportFactiva(self, 'xml')
934 def import_factiva_mail(self, evt) :
936 ImportFactiva(self, 'mail')
940 def import_factiva_txt(self, evt) :
942 ImportFactiva(self, 'txt')
946 def OnImportTXM(self, evt) :
948 ImportFactiva(self, 'txm')
952 def ExtractTools(self, evt) :
954 if ID == self.ID_splitvar :
955 Extract(self, 'splitvar')
957 Extract(self, 'mods')
959 def OnTextAlceste(self, event, corpus = None):
961 #print('ATTENTION : PLUS DE BUG SUR ALCESTE')
962 #RunAnalyse(self, corpus, Alceste, OptAlceste)
964 corpus = self.tree.getcorpus()
965 self.Text = Alceste(self, corpus, parametres = {'type': 'alceste'}, dlg = progressbar(self,6))
966 if self.Text.val == wx.ID_OK:
971 def OnPamSimple(self, event, corpus = None):
974 corpus = self.tree.getcorpus()
975 self.Text = AnalysePam(self, corpus, parametres = {'type' : 'pamtxt'}, dlg = progressbar(self,6))
976 if self.Text.val == wx.ID_OK:
981 def SimiCluster(self, parametres = {}, fromprof = False, pathout = '', listactives = [], actives = [], tableau = None) :
982 DoSimi(self, param = parametres, fromprof = fromprof, pathout = pathout, listactives = listactives, actives = actives, tableau = tableau)
984 def OnSimi(self,evt):
986 #print 'ATTENTION !!!! VERGES'
987 #print 'PLUS DE BUG SUR SIMI'
988 self.res = DoSimi(self, param = None)
989 #self.res = Verges(self)
990 if self.res.val == wx.ID_OK :
994 #################################################################
996 def OnHelp(self, event):
997 webbrowser.open('http://www.iramuteq.org/documentation')
999 def OnPref(self, event):
1000 dlg = PrefDialog(self)
1001 dlg.CenterOnParent()
1002 self.val = dlg.ShowModal()
1005 if self.check_update:
1008 print 'pas de verif'
1010 #CheckRPackages(self)
1012 def OnOpenFromCmdl(self):
1014 if options.filename :
1015 if os.path.exists(options.filename):
1016 self.filename = os.path.abspath(options.filename)
1020 if os.path.exists(os.path.realpath(args[0])):
1021 self.filename = os.path.abspath(os.path.realpath(args[0]))
1027 if os.path.splitext(self.filename)[1] in ['.csv', '.xls', '.ods']:
1028 self.tableau = Tableau(self, self.filename)
1029 get_table_param(self, self.filename)
1030 self.tableau.make_content()
1031 self.tableau.show_tab()
1032 #open_data(self, self.filename)
1033 elif os.path.splitext(self.filename)[1] == '.txt':
1035 elif os.path.splitext(self.filename)[1] == '.ira' :
1036 #self.corpus = Corpus(self)
1037 #self.Text = OpenAnalyse(self, self.filename)
1038 OpenAnalyse(self, self.filename)
1040 print 'ce fichier n\'existe pas'
1044 class IntroPanel(wx.Panel):
1045 def __init__(self, parent):
1046 wx.Panel.__init__(self, parent)
1047 col = randint(0, 255)
1048 col1 = randint(0,255)
1049 col2 = randint(0,255)
1051 bckgrdcolor = wx.Colour(col, col1, col2)
1052 self.SetBackgroundColour(bckgrdcolor)
1053 txtcolour = wx.Colour(250, 250, 250)
1054 linkcolor = wx.Colour(255, 0, 0)
1055 sizer1 = wx.BoxSizer(wx.VERTICAL)
1056 sizer2 = wx.BoxSizer(wx.VERTICAL)
1057 sizer3 = wx.BoxSizer(wx.HORIZONTAL)
1058 sizer4 = wx.BoxSizer(wx.VERTICAL)
1059 sizer5 = wx.BoxSizer(wx.HORIZONTAL)
1060 grid_sizer_1 = wx.FlexGridSizer(1, 4, 0, 0)
1061 grid_sizer_3 = wx.FlexGridSizer(1, 4, 0, 0)
1062 grid_sizer_2 = wx.FlexGridSizer(1, 3, 0, 0)
1063 PanelPres = wx.Panel(self)
1064 PanelPres.SetBackgroundColour(bckgrdcolor)
1065 label_1 = wx.StaticText(self, -1, u"IRaMuTeQ", size=(-1, -1))
1066 label_1.SetFont(wx.Font(46, wx.TELETYPE, wx.NORMAL, wx.BOLD, 0, "Purisa"))
1067 label_1.SetForegroundColour(wx.RED)
1068 label2 = wx.StaticText(PanelPres, -1 , u'\nVersion ' + ConfigGlob.get('DEFAULT', 'version') + '\n')
1069 label2.SetForegroundColour(txtcolour)
1070 label2.SetBackgroundColour(bckgrdcolor)
1071 #label3 = wx.StaticText(PanelPres, -1 , u'Equipe ')
1072 #label3.SetForegroundColour(txtcolour)
1073 #label3.SetBackgroundColour(bckgrdcolor)
1074 self.hyper2 = hl.HyperLinkCtrl(PanelPres, wx.ID_ANY, u"REPERE", URL="http://repere.no-ip.org/")
1075 self.hyper2.SetColours(linkcolor, linkcolor, "RED")
1076 self.hyper2.SetBackgroundColour(bckgrdcolor)
1077 self.hyper2.EnableRollover(True)
1078 self.hyper2.SetUnderlines(False, False, True)
1079 self.hyper2.SetBold(True)
1080 self.hyper2.UpdateLink()
1081 label_lerass = wx.StaticText(PanelPres, -1, u'Laboratoire ')
1082 label_lerass.SetForegroundColour(txtcolour)
1083 label_lerass.SetBackgroundColour(bckgrdcolor)
1084 self.hyper_lerass = hl.HyperLinkCtrl(PanelPres, -1, u'LERASS', URL="http://www.lerass.com")
1085 self.hyper_lerass.SetColours(linkcolor, linkcolor, "RED")
1086 self.hyper_lerass.SetBackgroundColour(bckgrdcolor)
1087 self.hyper_lerass.EnableRollover(True)
1088 self.hyper_lerass.SetUnderlines(False, False, True)
1089 self.hyper_lerass.SetBold(True)
1090 self.hyper_lerass.UpdateLink()
1091 blank = wx.StaticText(PanelPres, -1, u'\n')
1092 blank1 = wx.StaticText(PanelPres, -1, u'\n')
1093 labellicence = wx.StaticText(PanelPres, -1, _(u"License GNU GPL").decode('utf8'))
1094 labellicence.SetForegroundColour(txtcolour)
1095 labellicence.SetBackgroundColour(bckgrdcolor)
1096 labelcopy = wx.StaticText(PanelPres, -1, ConfigGlob.get('DEFAULT', 'copyright'))
1097 labelcopy.SetForegroundColour(txtcolour)
1098 labelcopy.SetBackgroundColour(bckgrdcolor)
1099 python_img = wx.Image(os.path.join(ImagePath,'python-logo.jpg'), wx.BITMAP_TYPE_ANY).ConvertToBitmap()
1100 r_img = wx.Image(os.path.join(ImagePath,'Rlogo.jpg'), wx.BITMAP_TYPE_ANY).ConvertToBitmap()
1101 lexique_img = wx.Image(os.path.join(ImagePath,'LexTexte4.jpg'), wx.BITMAP_TYPE_ANY).ConvertToBitmap()
1102 but_python = wx.BitmapButton(self, -1, python_img)
1103 but_lexique = wx.BitmapButton(self, -1, lexique_img)
1104 but_r = wx.BitmapButton(self, -1, r_img)
1105 self.Bind(wx.EVT_BUTTON, self.OnPython, but_python)
1106 self.Bind(wx.EVT_BUTTON, self.OnLexique, but_lexique)
1107 self.Bind(wx.EVT_BUTTON, self.OnR, but_r)
1110 #grid_sizer_1.Add(label3, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1111 grid_sizer_1.Add(self.hyper2, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1112 grid_sizer_3.Add(label_lerass, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1113 grid_sizer_3.Add(self.hyper_lerass, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1114 sizer4.Add(label_1, 0, wx.ALIGN_CENTER, 5)
1115 sizer2.Add(label2, 0, wx.ALIGN_CENTER, 5)
1116 #sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1117 sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1118 sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1119 sizer2.Add(grid_sizer_3, 0, wx.ALIGN_CENTER, 5)
1120 sizer2.Add(wx.StaticText(PanelPres, -1, u' '), 0, wx.ALIGN_CENTER, 5)
1121 #sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1122 #sizer2.Add(wx.StaticText(PanelPres, -1, u''), 0, wx.ALIGN_CENTER, 5)
1123 sizer2.Add(grid_sizer_1, 0, wx.ALIGN_CENTER, 5)
1124 sizer2.Add(labellicence, 0, wx.ALIGN_CENTER, 5)
1125 sizer2.Add(labelcopy, 0, wx.ALIGN_CENTER, 5)
1126 sizer1.Add(sizer4, 1, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1127 PanelPres.SetSizer(sizer2)
1128 sizer5.Add(blank, 1, wx.EXPAND | wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 2)
1129 sizer5.Add(PanelPres, 1, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 0)
1130 sizer5.Add(blank1, 1, wx.ALIGN_CENTER_HORIZONTAL,2)
1131 grid_sizer_2.Add(but_python, 1, wx.ALIGN_CENTER_HORIZONTAL| wx.ALIGN_CENTER_VERTICAL)
1132 grid_sizer_2.Add(but_lexique, 1,wx.ALIGN_CENTER_HORIZONTAL| wx.ALIGN_CENTER_VERTICAL)
1133 grid_sizer_2.Add(but_r, 1, wx.ALIGN_CENTER_HORIZONTAL| wx.ALIGN_CENTER_VERTICAL)
1135 sizer1.Add(sizer5, 3, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 1)
1136 sizer1.Add(grid_sizer_2, 1, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL)
1137 self.SetSizer(sizer1)
1140 def OnPython(self,evt):
1141 webbrowser.open('http://www.python.org')
1143 def OnLexique(self,evt):
1144 webbrowser.open('http://www.lexique.org')
1147 webbrowser.open('http://www.r-project.org')
1149 class MySplashScreen(wx.SplashScreen):
1151 bmp = wx.Image(os.path.join(ImagePath, 'splash.png')).ConvertToBitmap()
1152 wx.SplashScreen.__init__(self, bmp,
1153 wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT,
1155 self.Bind(wx.EVT_CLOSE, self.OnClose)
1156 self.fc = wx.FutureCall(1, self.ShowMain)
1158 def OnClose(self, evt):
1162 if self.fc.IsRunning():
1167 frame = IraFrame(None, -1, "IRaMuTeQ " + ConfigGlob.get('DEFAULT', 'version'), size=(1100, 800))
1171 frame.OnOpenFromCmdl()
1172 # if self.fc.IsRunning():
1174 #wx.CallAfter(frame.ShowTip)
1176 class MyApp(wx.App):
1179 Create and show the splash screen. It will then create and show
1180 the main frame when it is time to do so.
1182 wx.SystemOptions.SetOptionInt("mac.window-plain-transition", 1)
1183 self.SetAppName("Iramuteq")
1184 splash = MySplashScreen()
1192 if __name__ == '__main__':