From: pin Date: Fri, 23 Jul 2010 13:27:54 +0000 (+0000) Subject: On commence à imprimer des résultats, bruts de décoffrage. X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/commitdiff_plain/a3fc67f3b4b1b435f90c5d823416b6ec5340b215 On commence à imprimer des résultats, bruts de décoffrage. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@288 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/src/minwii/loganalyse.py b/src/minwii/loganalyse.py index 952c3a7..e33dfcf 100755 --- a/src/minwii/loganalyse.py +++ b/src/minwii/loganalyse.py @@ -71,7 +71,7 @@ class LogFileAnalyser(LogFileReader) : meth = getattr(self, name) results[name] = meth() - pprint(results) + return results def playingDuration(self) : """ retourne la durée écoulée entre le premier et de dernier message @@ -174,7 +174,7 @@ def main() : lfa = LogFileAnalyser(args[0]) - lfa.analyse() + pprint(lfa.analyse()) if __name__ == "__main__" : from os.path import realpath, sep diff --git a/src/minwii/logapp.py b/src/minwii/logapp.py index b48140c..4c680ba 100755 --- a/src/minwii/logapp.py +++ b/src/minwii/logapp.py @@ -11,6 +11,8 @@ import tkFileDialog from glob import glob from os.path import join as pjoin from os.path import basename +from loganalyse import LogFileAnalyser +from pprint import pprint class Application(Frame) : def __init__(self, master=None) : @@ -68,6 +70,9 @@ class Application(Frame) : filepath = self.logFiles[index] filename = basename(filepath) self.identFrame.setFileName(filename) + rf = ResultsFrame(self.dataFrame, filepath) + rf.layResults() + rf.grid() class Navbar(Frame) : @@ -154,7 +159,19 @@ class Identification(Frame) : self.commentsText = Text(self, width=40, height=4, undo=True, wrap=WORD) self.commentsText.grid(row=2, column=1, sticky=W) + +class ResultsFrame(Frame) : + def __init__(self, master, logFilePath) : + Frame.__init__(self, master) + self.logFilePath = logFilePath + def layResults(self) : + lfa = LogFileAnalyser(self.logFilePath) + results = lfa.analyse() + pprint(results) + rawPrint = Label(self, text=str(results)) + rawPrint.grid() + app = Application() app.master.title("Analyseur des sessions MINWii")