X-Git-Url: https://svn.cri.ensmp.fr/git/minwii.git/blobdiff_plain/704637a070dfbf0880d228228a0ef183e982f81e..d4b591abe110f8c546838449dad36351d223ee6c:/src/minwii/loganalyse.py?ds=inline diff --git a/src/minwii/loganalyse.py b/src/minwii/loganalyse.py index 952c3a7..d6d5a4d 100755 --- a/src/minwii/loganalyse.py +++ b/src/minwii/loganalyse.py @@ -62,16 +62,18 @@ class LogFileAnalyser(LogFileReader) : } def analyse(self) : - self.mode = mode = self.getMode() - print 'Mode :', mode - results = {} - for name in self.POSSIBLE_ANALYSES[mode] : - meth = getattr(self, name) - results[name] = meth() + try : + self.mode = mode = self.getMode() + results['playingMode'] = mode + for name in self.POSSIBLE_ANALYSES[mode] : + meth = getattr(self, name) + results[name] = meth() + except : + pass - pprint(results) + return results def playingDuration(self) : """ retourne la durée écoulée entre le premier et de dernier message @@ -174,7 +176,7 @@ def main() : lfa = LogFileAnalyser(args[0]) - lfa.analyse() + pprint(lfa.analyse()) if __name__ == "__main__" : from os.path import realpath, sep