/offlineimap/head: changeset 205

Better handling of read-only folders. We will now warn if there is a
change, but not propogate it. New config variable ignore-readonly can
suppress the warnings. This fixes [complete.org #10] and, for Debian,
Closes: #154769. changelog: noted the change IMAP.py: trap
imapobj.readonly more often UIBase.py: new methods to handle the
warnings offlineimap.conf: new ignore-readonly variable.
This commit is contained in:
jgoerzen
2002-08-08 02:57:17 +01:00
parent 3b4c306f5d
commit a3f422cf98
4 changed files with 50 additions and 4 deletions

View File

@ -53,6 +53,22 @@ class UIBase:
def folderlist(s, list):
return ', '.join(["%s[%s]" % (s.getnicename(x), x.getname()) for x in list])
################################################## WARNINGS
def msgtoreadonly(s, destfolder, uid, content, flags):
if not (config.has_option('general', 'ignore-readonly') and config.getboolean("general", "ignore-readonly")):
s.warn("Attempted to synchronize message %d to folder %s[%s], but that folder is read-only. The message will not be copied to that folder." % \
(uid, s.getnicename(destfolder), destfolder.getname()))
def flagstoreadonly(s, destfolder, uidlist, flags):
if not (config.has_option('general', 'ignore-readonly') and config.getboolean("general", "ignore-readonly")):
s.warn("Attempted to modify flags for messages %s in folder %s[%s], but that folder is read-only. No flags have been modified for that message." % \
(str(uidlist), s.getnicename(destfolder), destfolder.getname()))
def deletereadonly(s, destfolder, uidlist):
if not (config.has_option('general', 'ignore-readonly') and config.getboolean("general", "ignore-readonly")):
s.warn("Attempted to delete messages %s in folder %s[%s], but that folder is read-only. No messages have been deleted in that folder." % \
(str(uidlist), s.getnicename(destfolder), destfolder.getname()))
################################################## MESSAGES
def init_banner(s):