<DKIM> [PATCH 2/2] remove some rtime nonsense
Nicolas Sebrecht
nicolas.s-dev at laposte.net
Thu Apr 2 15:46:15 BST 2015
On Thu, Apr 02, 2015 at 02:41:48PM +0200, Abdo Roig-Maranges wrote:
> This code was dead, since maildir message entries have no 'rtime' key.
I guess this is wrong in the sense that rtime COULD have a value with
the utime_from_header thing, at least.
While decoupling utime_from_header from rtime in the Maildir case, we
are instering a conditioned os.utime() for it since that's what the
utime_from_header is for.
So, I think we should do the same thing for GmailMaildir; in the same
patch.
IOW, this was more badly implemented feature rather than dead code.
>
> Signed-off-by: Abdo Roig-Maranges <abdo.roig at gmail.com>
> ---
> offlineimap/folder/GmailMaildir.py | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/offlineimap/folder/GmailMaildir.py b/offlineimap/folder/GmailMaildir.py
> index 894792d..c1924cb 100644
> --- a/offlineimap/folder/GmailMaildir.py
> +++ b/offlineimap/folder/GmailMaildir.py
> @@ -159,8 +159,6 @@ class GmailMaildirFolder(MaildirFolder):
> content = self.deletemessageheaders(content, self.labelsheader)
> content = self.addmessageheader(content, '\n', self.labelsheader, labels_str)
>
> - rtime = self.messagelist[uid].get('rtime', None)
> -
> # write file with new labels to a unique file in tmp
> messagename = self.new_message_filename(uid, set())
> tmpname = self.save_to_tmp_file(messagename, content)
> @@ -174,9 +172,6 @@ class GmailMaildirFolder(MaildirFolder):
> (tmppath, filepath, e[1]), OfflineImapError.ERROR.FOLDER), \
> None, exc_info()[2]
>
> - if rtime != None:
> - os.utime(filepath, (rtime, rtime))
> -
> # save the new mtime and labels
> self.messagelist[uid]['mtime'] = long(os.stat(filepath).st_mtime)
> self.messagelist[uid]['labels'] = labels
--
Nicolas Sebrecht
More information about the OfflineIMAP-project
mailing list