From 5a6b2a1ebdcef5256c07c2bc82483e85a46f6af9 Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Thu, 4 May 2006 09:05:46 +0100 Subject: [PATCH] Revert restoreatime patch --- offlineimap.conf | 9 --------- offlineimap/accounts.py | 24 ------------------------ offlineimap/repository/Base.py | 2 +- offlineimap/repository/Maildir.py | 3 --- 4 files changed, 1 insertion(+), 37 deletions(-) diff --git a/offlineimap.conf b/offlineimap.conf index 60bea75..a7c4873 100644 --- a/offlineimap.conf +++ b/offlineimap.conf @@ -188,15 +188,6 @@ localfolders = ~/Test sep = . -# Some users on *nix platforms may not want the atime (last access -# time) to be modified by OfflineIMAP. In these cases, they would -# want to set restoreatime to yes. OfflineIMAP will make an effort -# to not touch the atime if you do that. -# -# In most cases, the default of no should be sufficient. - -restoreatime = no - [Repository RemoteExample] # And this is the remote repository. For now, we only support IMAP here. diff --git a/offlineimap/accounts.py b/offlineimap/accounts.py index 34d7f9d..74791b9 100644 --- a/offlineimap/accounts.py +++ b/offlineimap/accounts.py @@ -154,12 +154,6 @@ class AccountSynchronizationMixin: class SyncableAccount(Account, AccountSynchronizationMixin): pass -from stat import * - -def reset_time(folder, atime, mtime): - t = atime, mtime - os.utime(folder, t) - def syncfolder(accountname, remoterepos, remotefolder, localrepos, statusrepos): global mailboxes @@ -169,9 +163,6 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos, localfolder = localrepos.\ getfolder(remotefolder.getvisiblename().\ replace(remoterepos.getsep(), localrepos.getsep())) - if localrepos.getrestoreatime(): - cur_atime = os.stat(localfolder.getfullname() + "/cur")[ST_ATIME] - new_atime = os.stat(localfolder.getfullname() + "/new")[ST_ATIME] # Write the mailboxes mbnames.add(accountname, localfolder.getvisiblename()) # Load local folder @@ -200,20 +191,10 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos, if not localfolder.isuidvalidityok(): ui.validityproblem(localfolder, localfolder.getsaveduidvalidity(), localfolder.getuidvalidity()) - if localrepos.getrestoreatime(): - reset_time(localfolder.getfullname() + "/new", new_atime, \ - os.stat(localfolder.getfullname() + "/new")[ST_MTIME]) - reset_time(localfolder.getfullname() + "/cur", new_atime, \ - os.stat(localfolder.getfullname() + "/cur")[ST_MTIME]) return if not remotefolder.isuidvalidityok(): ui.validityproblem(remotefolder, remotefolder.getsaveduidvalidity(), remotefolder.getuidvalidity()) - if localrepos.getrestoreatime(): - reset_time(localfolder.getfullname() + "/new", new_atime, \ - os.stat(localfolder.getfullname() + "/new")[ST_MTIME]) - reset_time(localfolder.getfullname() + "/cur", new_atime, \ - os.stat(localfolder.getfullname() + "/cur")[ST_MTIME]) return else: localfolder.saveuidvalidity() @@ -249,9 +230,4 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos, ui.syncingmessages(localrepos, localfolder, statusrepos, statusfolder) localfolder.syncmessagesto(statusfolder) statusfolder.save() - if localrepos.getrestoreatime(): - reset_time(localfolder.getfullname() + "/new", new_atime, \ - os.stat(localfolder.getfullname() + "/new")[ST_MTIME]) - reset_time(localfolder.getfullname() + "/cur", new_atime, \ - os.stat(localfolder.getfullname() + "/cur")[ST_MTIME]) diff --git a/offlineimap/repository/Base.py b/offlineimap/repository/Base.py index cfca83e..9e76200 100644 --- a/offlineimap/repository/Base.py +++ b/offlineimap/repository/Base.py @@ -1,5 +1,5 @@ # Base repository support -# Copyright (C) 2002, 2003 John Goerzen +# Copyright (C) 2002, 2003, 2006 John Goerzen # # # This program is free software; you can redistribute it and/or modify diff --git a/offlineimap/repository/Maildir.py b/offlineimap/repository/Maildir.py index d35b0cc..a6c3056 100644 --- a/offlineimap/repository/Maildir.py +++ b/offlineimap/repository/Maildir.py @@ -33,9 +33,6 @@ class MaildirRepository(BaseRepository): self.ui = UIBase.getglobalui() self.debug("MaildirRepository initialized, sep is " + repr(self.getsep())) - def getrestoreatime(self): - return self.getconfboolean('restoreatime', 0) - def getlocalroot(self): return os.path.expanduser(self.getconf('localfolders'))