From: pin Date: Wed, 7 Jul 2010 11:44:44 +0000 (+0000) Subject: Simplification. X-Git-Url: https://scm.cri.ensmp.fr/git/minwii.git/commitdiff_plain/c958fad0633273abbc1357fd5a9857e674c3707f?hp=03cc372eac638f066800c45d6929b2b50701f36e Simplification. git-svn-id: https://svn.cri.ensmp.fr/svn/minwii/trunk@275 fe552daf-6dbe-4428-90eb-1537e0879342 --- diff --git a/src/minwii/logfilereader.py b/src/minwii/logfilereader.py index a08855a..44c3611 100755 --- a/src/minwii/logfilereader.py +++ b/src/minwii/logfilereader.py @@ -17,9 +17,10 @@ SUPPORTED_FILE_HEADER = 'ENV winwii log format version : 1.0' def inplaceread(m) : def readinplace(self, *args, **kw) : - self.savePos() + pos = self.logfile.tell() + self.logfile.seek(0) ret = m(self, *args, **kw) - self.recallPos() + self.logfile.seek(pos) return ret return readinplace @@ -37,18 +38,10 @@ class LogFileReader(object) : else : self.logfile = logfile - self.__pos = 0 - firstline = self.next() assert firstline == SUPPORTED_FILE_HEADER - def savePos(self) : - self.__pos = self.logfile.tell() - self.logfile.seek(0) - - def recallPos(self) : - self.logfile.seek(self.__pos) - + @inplaceread def getSongFile(self) : "retourne le chemin d'accès au fichier musicxml de la chanson"