コード例 #1
0
 def openNextFile(self):
     currentFileName = self.fileNamesList.pop()
     self.currentFullFileName = config.get(
         'various', 'datafilespath') + sysvar.dirsep + currentFileName
     self.currentFileHandler = open(self.currentFullFileName, 'r')
     self.currentLineNumber = 0
     print('file opened', currentFileName)
     self.fileTimeStart = time.time()
     pass
コード例 #2
0
    def restoreSessionData(self):
        try:
            #self.sessionDataFile = config.get('variables', 'sessiondatafile')
            self.limitsize = config.getint('constraints', 'limitsize')
            self.sessionDataFile = open(
                config.get('variables', 'sessiondatafile'), 'r')
            self.limitpos = int(self.sessionDataFile.readline())
            self.sessionDataFile.close()

        except Exception as e:
            raise e
        else:
            return True
コード例 #3
0
 def saveSessionData(self):
     self.sessionDataFile = open(config.get('variables', 'sessiondatafile'),
                                 'w')
     self.sessionDataFile.write(str(self.limitpos))
     self.sessionDataFile.close()
コード例 #4
0
 def saveSessionData(self):
     self.sessionDataFile = open(config.get('various', 'sessiondatafile'),
                                 'w')
     self.sessionDataFile.write(str(self.currentLineNumber))
     self.sessionDataFile.close()
コード例 #5
0
 def readFilesDirectory(self):
     for (dirpath, dirnames,
          filenames) in walk(config.get('various', 'datafilespath')):
         self.fileNamesList.extend(filenames)
     self.fileNamesList.reverse()