learn to not download UIDs defined by the user
Allow users to workaround offending emails that offlineimap can't download. Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
# Curses-based interfaces
|
||||
# Copyright (C) 2003-2015 John Goerzen & contributors
|
||||
# Copyright (C) 2003-2016 John Goerzen & contributors.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -442,6 +442,10 @@ class Blinkenlights(UIBase, CursesUtil):
|
||||
self.gettf().setcolor('blue')
|
||||
super(Blinkenlights, self).syncingmessages(*args)
|
||||
|
||||
def ignorecopyingmessage(self, *args):
|
||||
self.gettf().setcolor('red')
|
||||
super(Blinkenlights, self).ignorecopyingmessage(*args)
|
||||
|
||||
def copyingmessage(self, *args):
|
||||
self.gettf().setcolor('orange')
|
||||
super(Blinkenlights, self).copyingmessage(*args)
|
||||
|
@ -1,4 +1,4 @@
|
||||
# Copyright (C) 2007-2015 John Goerzen & contributors
|
||||
# Copyright (C) 2007-2016 John Goerzen & contributors.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -21,10 +21,11 @@ import sys
|
||||
import time
|
||||
import logging
|
||||
from threading import currentThread
|
||||
from offlineimap.ui.UIBase import UIBase
|
||||
import offlineimap
|
||||
|
||||
protocol = '7.0.0'
|
||||
import offlineimap
|
||||
from offlineimap.ui.UIBase import UIBase
|
||||
|
||||
protocol = '7.1.0'
|
||||
|
||||
class MachineLogFormatter(logging.Formatter):
|
||||
"""urlencodes any outputted line, to avoid multi-line output"""
|
||||
@ -125,6 +126,11 @@ class MachineUI(UIBase):
|
||||
(s.getnicename(sr), sf.getname(), s.getnicename(dr),
|
||||
df.getname()))
|
||||
|
||||
def ignorecopyingmessage(s, uid, srcfolder, destfolder):
|
||||
s._printData(s.logger.info, 'ignorecopyingmessage', "%d\n%s\n%s\n%s[%s]"%
|
||||
(uid, s.getnicename(srcfolder), srcfolder.getname(),
|
||||
s.getnicename(destfolder), destfolder))
|
||||
|
||||
def copyingmessage(s, uid, num, num_to_copy, srcfolder, destfolder):
|
||||
s._printData(s.logger.info, 'copyingmessage', "%d\n%s\n%s\n%s[%s]"%
|
||||
(uid, s.getnicename(srcfolder), srcfolder.getname(),
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Noninteractive UI
|
||||
# Copyright (C) 2002-2012 John Goerzen & contributors
|
||||
# Copyright (C) 2002-2016 John Goerzen & contributors.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -16,11 +16,13 @@
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
import logging
|
||||
from offlineimap.ui.UIBase import UIBase
|
||||
|
||||
import offlineimap
|
||||
from offlineimap.ui.UIBase import UIBase
|
||||
|
||||
class Basic(UIBase):
|
||||
"""'Basic' simply sets log level to INFO"""
|
||||
"""'Basic' simply sets log level to INFO."""
|
||||
|
||||
def __init__(self, config, loglevel = logging.INFO):
|
||||
return super(Basic, self).__init__(config, loglevel)
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# UI base class
|
||||
# Copyright (C) 2002-2016 John Goerzen & contributors
|
||||
# Copyright (C) 2002-2016 John Goerzen & contributors.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -24,11 +24,12 @@ import traceback
|
||||
import threading
|
||||
try:
|
||||
from Queue import Queue
|
||||
except ImportError: #python3
|
||||
except ImportError: # python3
|
||||
from queue import Queue
|
||||
from collections import deque
|
||||
from offlineimap.error import OfflineImapError
|
||||
|
||||
import offlineimap
|
||||
from offlineimap.error import OfflineImapError
|
||||
|
||||
debugtypes = {'':'Other offlineimap related sync messages',
|
||||
'imap': 'IMAP protocol debugging',
|
||||
@ -385,6 +386,12 @@ class UIBase(object):
|
||||
self.getnicename(sr), srcfolder,
|
||||
self.getnicename(dr), dstfolder))
|
||||
|
||||
def ignorecopyingmessage(self, uid, src, destfolder):
|
||||
"""Output a log line stating which message is ignored."""
|
||||
|
||||
self.logger.info("IGNORED: Copy message UID %s %s:%s -> %s"% (
|
||||
uid, src.repository, src, destfolder.repository))
|
||||
|
||||
def copyingmessage(self, uid, num, num_to_copy, src, destfolder):
|
||||
"""Output a log line stating which message we copy."""
|
||||
|
||||
|
Reference in New Issue
Block a user