From: Adriana Draghici Date: Thu, 29 Apr 2010 15:00:53 +0000 (+0000) Subject: ppf: added import os in GenericStatusParser X-Git-Tag: getopt_long~46 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=d009700b8abb0a33d6451cc5f1313028a7fedef1;p=cs-p2p-next.git ppf: added import os in GenericStatusParser --- diff --git a/ppf/log-parser/generic/GenericStatusParser.py b/ppf/log-parser/generic/GenericStatusParser.py index a0444f6..09d3cad 100644 --- a/ppf/log-parser/generic/GenericStatusParser.py +++ b/ppf/log-parser/generic/GenericStatusParser.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import sys +import os import re import datetime import logging @@ -83,13 +84,14 @@ class GenericStatusParser: try: # read last line from status log file f = open(self.filename, "r") - f.seek(-1, os.SEEK_END) + f.seek(-2, os.SEEK_END) # seek before the beginning of the last line while f.read(1) != '\n' : f.seek(-2, os.SEEK_CUR) line = f.readline() + print line f.close() except Exception, e: print e