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
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
def saveSessionData(self): self.sessionDataFile = open(config.get('variables', 'sessiondatafile'), 'w') self.sessionDataFile.write(str(self.limitpos)) self.sessionDataFile.close()
def saveSessionData(self): self.sessionDataFile = open(config.get('various', 'sessiondatafile'), 'w') self.sessionDataFile.write(str(self.currentLineNumber)) self.sessionDataFile.close()
def readFilesDirectory(self): for (dirpath, dirnames, filenames) in walk(config.get('various', 'datafilespath')): self.fileNamesList.extend(filenames) self.fileNamesList.reverse()