Logo Search packages:      
Sourcecode: scanerrlog version File versions  Download package

def scanerrlog::ApacheErrorLog::open (   self,
  file 
)

Opens an Apache error_log file and skip the first lines if in 'continue' mode

Definition at line 918 of file scanerrlog.py.

00918                              :
                """Opens an Apache error_log file and skip the first lines if in 'continue' mode"""
                self.__opened = 0
                self.__statsfilename = SEL_STATSFILENAME
                if type(file) == type(sys.stdin) :
                        self.__infile = file
                elif (file == None) or (file == "-") :
                        self.__infile = sys.stdin
                else :
                        self.__infile = open(file, "r")
                        self.__statsfilename = os.path.join(os.path.dirname(file), SEL_STATSFILENAME)
                        self.__opened = 1

                if self.__continued :
                        try :
                                pickin = open(self.__statsfilename, "r")
                                self.__erreurs = cPickle.load(pickin)
                                self._linestotal = cPickle.load(pickin)
                                self._unwanted = cPickle.load(pickin)
                                self._underlimit = cPickle.load(pickin)
                                alreadyread = cPickle.load(pickin)
                                pickin.close()

                                try :
                                        self.__infile.seek(alreadyread, 0)
                                except IOError :
                                        pass    # probably an invalid or illegal seek, e.g. stdin
                        except IOError :
                                self.__erreurs = {}
                                self._linestotal = 0
                                self._unwanted = 0
                                self._underlimit = 0

        def read(self) :


Generated by  Doxygen 1.6.0   Back to index