Revert restoreatime patch
This commit is contained in:
parent
91d7ecfc68
commit
5a6b2a1ebd
@ -188,15 +188,6 @@ localfolders = ~/Test
|
|||||||
|
|
||||||
sep = .
|
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]
|
[Repository RemoteExample]
|
||||||
|
|
||||||
# And this is the remote repository. For now, we only support IMAP here.
|
# And this is the remote repository. For now, we only support IMAP here.
|
||||||
|
@ -154,12 +154,6 @@ class AccountSynchronizationMixin:
|
|||||||
class SyncableAccount(Account, AccountSynchronizationMixin):
|
class SyncableAccount(Account, AccountSynchronizationMixin):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
from stat import *
|
|
||||||
|
|
||||||
def reset_time(folder, atime, mtime):
|
|
||||||
t = atime, mtime
|
|
||||||
os.utime(folder, t)
|
|
||||||
|
|
||||||
def syncfolder(accountname, remoterepos, remotefolder, localrepos,
|
def syncfolder(accountname, remoterepos, remotefolder, localrepos,
|
||||||
statusrepos):
|
statusrepos):
|
||||||
global mailboxes
|
global mailboxes
|
||||||
@ -169,9 +163,6 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos,
|
|||||||
localfolder = localrepos.\
|
localfolder = localrepos.\
|
||||||
getfolder(remotefolder.getvisiblename().\
|
getfolder(remotefolder.getvisiblename().\
|
||||||
replace(remoterepos.getsep(), localrepos.getsep()))
|
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
|
# Write the mailboxes
|
||||||
mbnames.add(accountname, localfolder.getvisiblename())
|
mbnames.add(accountname, localfolder.getvisiblename())
|
||||||
# Load local folder
|
# Load local folder
|
||||||
@ -200,20 +191,10 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos,
|
|||||||
if not localfolder.isuidvalidityok():
|
if not localfolder.isuidvalidityok():
|
||||||
ui.validityproblem(localfolder, localfolder.getsaveduidvalidity(),
|
ui.validityproblem(localfolder, localfolder.getsaveduidvalidity(),
|
||||||
localfolder.getuidvalidity())
|
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
|
return
|
||||||
if not remotefolder.isuidvalidityok():
|
if not remotefolder.isuidvalidityok():
|
||||||
ui.validityproblem(remotefolder, remotefolder.getsaveduidvalidity(),
|
ui.validityproblem(remotefolder, remotefolder.getsaveduidvalidity(),
|
||||||
remotefolder.getuidvalidity())
|
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
|
return
|
||||||
else:
|
else:
|
||||||
localfolder.saveuidvalidity()
|
localfolder.saveuidvalidity()
|
||||||
@ -249,9 +230,4 @@ def syncfolder(accountname, remoterepos, remotefolder, localrepos,
|
|||||||
ui.syncingmessages(localrepos, localfolder, statusrepos, statusfolder)
|
ui.syncingmessages(localrepos, localfolder, statusrepos, statusfolder)
|
||||||
localfolder.syncmessagesto(statusfolder)
|
localfolder.syncmessagesto(statusfolder)
|
||||||
statusfolder.save()
|
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])
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Base repository support
|
# Base repository support
|
||||||
# Copyright (C) 2002, 2003 John Goerzen
|
# Copyright (C) 2002, 2003, 2006 John Goerzen
|
||||||
# <jgoerzen@complete.org>
|
# <jgoerzen@complete.org>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -33,9 +33,6 @@ class MaildirRepository(BaseRepository):
|
|||||||
self.ui = UIBase.getglobalui()
|
self.ui = UIBase.getglobalui()
|
||||||
self.debug("MaildirRepository initialized, sep is " + repr(self.getsep()))
|
self.debug("MaildirRepository initialized, sep is " + repr(self.getsep()))
|
||||||
|
|
||||||
def getrestoreatime(self):
|
|
||||||
return self.getconfboolean('restoreatime', 0)
|
|
||||||
|
|
||||||
def getlocalroot(self):
|
def getlocalroot(self):
|
||||||
return os.path.expanduser(self.getconf('localfolders'))
|
return os.path.expanduser(self.getconf('localfolders'))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user