def checksum(self): """Return rough hash by size & modified date of all files.""" stats = [] data_dir = get_data_dir() for f in self: fpath = f.abspath.replace(data_dir, '') stats.append(fpath) stats.append(os.stat(f.abspath).st_size) # stats.append(os.stat(f.abspath).st_mtime) return hash(tuple(stats))
def fxnewfile(): # new file newfile = os.path.join(get_data_dir(), 'kr/node-3/log', 'game_2014-03-05 04.log') if os.path.isfile(newfile): os.unlink(newfile) yield newfile if os.path.isfile(newfile): os.unlink(newfile) # reload file infor for following tests from ws_mysol.myprj import log as l l.load_info()