X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/blobdiff_plain/6ac0f3c83c7f2b916038acfed564ba6c7fe8e9f4..a697b3d25f51aa781aa3f08762efba3395f26c26:/src/minwii/logfilereader.py diff --git a/src/minwii/logfilereader.py b/src/minwii/logfilereader.py index 648cdee..828b085 100755 --- a/src/minwii/logfilereader.py +++ b/src/minwii/logfilereader.py @@ -6,6 +6,7 @@ $Id$ $URL$ """ +from types import StringTypes from widgets.playingscreen import PlayingScreenBase from eventutils import EventDispatcher from events import eventCodes @@ -34,7 +35,7 @@ class LogFileReader(object) : """ logfile : chemin d'accès au fichier de log MinWii. le format supporté est actuellement la version 1.0 uniquement. """ - if isinstance(logfile, str) : + if isinstance(logfile, StringTypes) : self.logfile = open(logfile, 'r') else : self.logfile = logfile @@ -113,6 +114,8 @@ class LogFileReader(object) : for l in self.getBackwardLineIterator() : if l.startswith('EVT ') : break + else : + return None lastTicks = int(l.split(None, 2)[1]) return lastTicks