b7b749e9627e4554aa6a249b2d0f3bf77827fea3
1 # -*- coding: utf-8 -*-
3 Interface graphique pour l'analyse des fichiers de log minwii.
12 class Application(Frame
) :
13 def __init__(self
, master
=None) :
14 Frame
.__init
__(self
, master
)
19 def createWidgets(self
) :
20 self
.nav
= Navbar(self
)
21 self
.chooseLogDir
= Button(self
, text
="Parcourir…", command
=self
.openFileDialog
)
22 self
.chooseLogDir
.grid()
23 self
.quitButton
= Button(self
, text
='Terminer', command
=self
.quit
)
24 self
.quitButton
.grid()
26 def openFileDialog(self
) :
27 self
.logDir
= tkFileDialog
.askdirectory()
31 def __init__(self
, master
=None, from_
=1, to
=10, start
=1, step
=1) :
32 Frame
.__init
__(self
, master
)
38 self
.caption
= StringVar()
39 self
.caption
.set('%d / %d' % (self
.index
, self
.to
))
42 def createWidgets(self
) :
43 self
.backBtn
= Button(self
,
45 state
= DISABLED
if self
.index
==self
.from_
else NORMAL
,
48 self
.backBtn
.grid(row
=0, column
=0)
50 self
.lbl
= Label(self
, textvariable
=self
.caption
)
51 self
.lbl
.grid(row
=0, column
=1)
53 self
.nextBtn
= Button(self
,
55 state
= DISABLED
if self
.index
==self
.to
else NORMAL
,
57 self
.nextBtn
.grid(row
=0, column
=2)
60 self
.index
= self
.index
- self
.step
61 self
.caption
.set('%d / %d' % (self
.index
, self
.to
))
62 if self
.index
== self
.from_
:
63 self
.backBtn
.configure(state
=DISABLED
)
64 if self
.index
< self
.to
:
65 self
.nextBtn
.configure(state
=NORMAL
)
68 self
.index
= self
.index
+ self
.step
69 self
.caption
.set('%d / %d' % (self
.index
, self
.to
))
70 if self
.index
== self
.to
:
71 self
.nextBtn
.configure(state
=DISABLED
)
72 if self
.index
> self
.from_
:
73 self
.backBtn
.configure(state
=NORMAL
)
77 app
.master
.title("Analyseur des sessions MINWii")