+ self.folder_atimes = []
+
+ def _append_folder_atimes(self, foldername):
+ p = os.path.join(self.root, foldername)
+ new = os.path.join(p, 'new')
+ cur = os.path.join(p, 'cur')
+ f = p, os.stat(new)[ST_ATIME], os.stat(cur)[ST_ATIME]
+ self.folder_atimes.append(f)
+
+ def restore_folder_atimes(self):
+ if not self.folder_atimes:
+ return
+
+ for f in self.folder_atimes:
+ t = f[1], os.stat(os.path.join(f[0], 'new'))[ST_MTIME]
+ os.utime(os.path.join(f[0], 'new'), t)
+ t = f[2], os.stat(os.path.join(f[0], 'cur'))[ST_MTIME]
+ os.utime(os.path.join(f[0], 'cur'), t)