def checkFileExists(fileName, isAbort=False): if os.path.isfile(fileName): return True Logfile.fileOpenError(fileName) if isAbort: Logfile.abort('') else: return False
def loadDump(fileName): if not os.path.isfile(fileName): Logfile.fileOpenError(fileName) return None if sys.version_info.major >= 3: f = open(fileName, 'rb') else: f = open(fileName) data = pickle.load(f) f.close() os.remove(fileName) return data