/offlineimap/head: changeset 274
This commit is contained in:
parent
4ab770bb3d
commit
3c395c66a9
@ -78,6 +78,11 @@ class IMAPFolder(BaseFolder):
|
||||
# Discard the message number.
|
||||
messagestr = string.split(messagestr, maxsplit = 1)[1]
|
||||
options = imaputil.flags2hash(messagestr)
|
||||
if not options.has_key('UID'):
|
||||
UIBase.getglobalui().warn('No UID in message with options %s' %\
|
||||
str(options),
|
||||
minor = 1)
|
||||
else:
|
||||
uid = long(options['UID'])
|
||||
flags = imaputil.flagsimap2maildir(options['FLAGS'])
|
||||
self.messagelist[uid] = {'uid': uid, 'flags': flags}
|
||||
|
@ -26,8 +26,11 @@ class Basic(UIBase):
|
||||
def _msg(s, msg):
|
||||
print msg
|
||||
|
||||
def warn(s, msg):
|
||||
sys.stderr.write("WARNING: " + str(msg) + "\n")
|
||||
def warn(s, msg, minor = 0):
|
||||
warntxt = 'WARNING'
|
||||
if minor:
|
||||
warntxt = 'warning'
|
||||
sys.stderr.write(warntxt + ": " + str(msg) + "\n")
|
||||
|
||||
def sleep(s, sleepsecs):
|
||||
if s.verbose >= 0:
|
||||
|
@ -236,7 +236,11 @@ class VerboseUI(UIBase):
|
||||
s.top = None
|
||||
TextOKDialog("Main Program Exception", exceptionstr)
|
||||
|
||||
def warn(s, msg):
|
||||
def warn(s, msg, minor):
|
||||
if minor:
|
||||
# Just let the default handler catch it
|
||||
UIBase.warn(s, msg, minor)
|
||||
else:
|
||||
TextOKDialog("OfflineIMAP Warning", msg)
|
||||
|
||||
def showlicense(s):
|
||||
|
@ -44,7 +44,10 @@ class UIBase:
|
||||
"""Generic tool called when no other works."""
|
||||
raise NotImplementedError
|
||||
|
||||
def warn(s, msg):
|
||||
def warn(s, msg, minor = 0):
|
||||
if minor:
|
||||
s._msg("warning: " + msg)
|
||||
else:
|
||||
s._msg("WARNING: " + msg)
|
||||
|
||||
def debug(s, debugtype, msg):
|
||||
|
Loading…
Reference in New Issue
Block a user