X-Git-Url: https://scm.cri.mines-paristech.fr/git/minwii.git/blobdiff_plain/7ce928e114b798a45a94f933c8eb69b96009f989..a697b3d25f51aa781aa3f08762efba3395f26c26:/src/minwii/logapp.py diff --git a/src/minwii/logapp.py b/src/minwii/logapp.py index acc6529..b10ca16 100755 --- a/src/minwii/logapp.py +++ b/src/minwii/logapp.py @@ -61,13 +61,14 @@ class Application(Frame) : def chooseDirDialog(self, dir=None) : if dir is None : - self.logDir = tkFileDialog.askdirectory() + self.logDir = tkFileDialog.askdirectory(title='Sélectionnez un dossier de fichiers de logs') else : self.logDir = dir if self.logDir : self.logFiles = glob(pjoin(self.logDir, '*.log')) self._cleanupJunkFiles() self.logFiles.sort() + self.logFiles.reverse() self.dataFrame.grid(row=0, column=0, sticky=NW) self.nav.setSize(len(self.logFiles)) self.nav.grid(row=0, column=1) @@ -80,8 +81,12 @@ class Application(Frame) : if not getsize(f) : os.remove(f) continue - # TODO : vérifier qu'il existe des événements else : + lfa = LogFileAnalyser(f) + if lfa.getLastEventTicks() is None : + os.remove(f) + continue + files.append(f) self.logFiles = files @@ -192,7 +197,7 @@ class ResultsFrame(Frame) : lfa = LogFileAnalyser(self.logFilePath) results = lfa.analyse() if results : - for i, kv in enumerate(results.items()) : + for i, kv in enumerate(results) : k, v = kv kl = Label(self, text='%s :' % k) kl.grid(row=i, column=0, sticky=E)