Prune trailing whitespaces from code and documentation
They are redundant in all pruned cases and sometimes even create some problems, e.g., when one tries to jump through paragraphs in vi. Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
This commit is contained in:
@ -210,7 +210,7 @@ class BaseFolder(object):
|
||||
If the backend CAN assign a new uid, but cannot find out what
|
||||
this UID is (as is the case with some IMAP servers), it
|
||||
returns 0 but DOES save the message.
|
||||
|
||||
|
||||
IMAP backend should be the only one that can assign a new
|
||||
uid.
|
||||
|
||||
@ -493,7 +493,7 @@ class BaseFolder(object):
|
||||
continue #don't actually remove in a dryrun
|
||||
dstfolder.deletemessagesflags(uids, set(flag))
|
||||
statusfolder.deletemessagesflags(uids, set(flag))
|
||||
|
||||
|
||||
def syncmessagesto(self, dstfolder, statusfolder):
|
||||
"""Syncs messages in this folder to the destination dstfolder.
|
||||
|
||||
@ -514,7 +514,7 @@ class BaseFolder(object):
|
||||
uids present (except for potential negative uids that couldn't
|
||||
be placed anywhere).
|
||||
|
||||
Pass3: Synchronize flag changes
|
||||
Pass3: Synchronize flag changes
|
||||
Compare flag mismatches in self with those in statusfolder. If
|
||||
msg has a valid UID and exists on dstfolder (has not e.g. been
|
||||
deleted there), sync the flag change to both dstfolder and
|
||||
|
@ -44,7 +44,7 @@ class IMAPFolder(BaseFolder):
|
||||
|
||||
Prefer SELECT to EXAMINE if we can, since some servers
|
||||
(Courier) do not stabilize UID validity until the folder is
|
||||
selected.
|
||||
selected.
|
||||
.. todo: Still valid? Needs verification
|
||||
:param: Enforce new SELECT even if we are on that folder already.
|
||||
:returns: raises :exc:`OfflineImapError` severity FOLDER on error"""
|
||||
@ -116,7 +116,7 @@ class IMAPFolder(BaseFolder):
|
||||
maxmsgid = max(long(msgid), maxmsgid)
|
||||
# Different number of messages than last time?
|
||||
if maxmsgid != statusfolder.getmessagecount():
|
||||
return True
|
||||
return True
|
||||
return False
|
||||
|
||||
def cachemessagelist(self):
|
||||
@ -526,7 +526,7 @@ class IMAPFolder(BaseFolder):
|
||||
self.ui.debug('imap', 'savemessage: header is: %s: %s' %\
|
||||
(headername, headervalue))
|
||||
content = self.savemessage_addheader(content, headername,
|
||||
headervalue)
|
||||
headervalue)
|
||||
if len(content)>200:
|
||||
dbg_output = "%s...%s" % (content[:150], content[-50:])
|
||||
else:
|
||||
@ -710,11 +710,11 @@ class IMAPFolder(BaseFolder):
|
||||
def change_message_uid(self, uid, new_uid):
|
||||
"""Change the message from existing uid to new_uid
|
||||
|
||||
If the backend supports it. IMAP does not and will throw errors."""
|
||||
If the backend supports it. IMAP does not and will throw errors."""
|
||||
raise OfflineImapError('IMAP backend cannot change a messages UID from '
|
||||
'%d to %d' % (uid, new_uid),
|
||||
OfflineImapError.ERROR.MESSAGE)
|
||||
|
||||
|
||||
def deletemessage(self, uid):
|
||||
self.deletemessages_noconvert([uid])
|
||||
|
||||
|
@ -35,7 +35,7 @@ class LocalStatusSQLiteFolder(LocalStatusFolder):
|
||||
#though. According to sqlite docs, you need to commit() before
|
||||
#the connection is closed or your changes will be lost!"""
|
||||
#get db connection which autocommits
|
||||
#connection = sqlite.connect(self.filename, isolation_level=None)
|
||||
#connection = sqlite.connect(self.filename, isolation_level=None)
|
||||
#cursor = connection.cursor()
|
||||
#return connection, cursor
|
||||
|
||||
@ -43,7 +43,7 @@ class LocalStatusSQLiteFolder(LocalStatusFolder):
|
||||
cur_version = 1
|
||||
|
||||
def __init__(self, name, repository):
|
||||
super(LocalStatusSQLiteFolder, self).__init__(name, repository)
|
||||
super(LocalStatusSQLiteFolder, self).__init__(name, repository)
|
||||
# dblock protects against concurrent writes in same connection
|
||||
self._dblock = Lock()
|
||||
#Try to establish connection, no need for threadsafety in __init__
|
||||
|
@ -196,7 +196,7 @@ class MaildirFolder(BaseFolder):
|
||||
if sorted(self.getmessageuidlist()) != \
|
||||
sorted(statusfolder.getmessageuidlist()):
|
||||
return True
|
||||
# Also check for flag changes, it's quick on a Maildir
|
||||
# Also check for flag changes, it's quick on a Maildir
|
||||
for (uid, message) in self.getmessagelist().iteritems():
|
||||
if message['flags'] != statusfolder.getmessageflags(uid):
|
||||
return True
|
||||
@ -235,7 +235,7 @@ class MaildirFolder(BaseFolder):
|
||||
return '%d_%d.%d.%s,U=%d,FMD5=%s%s2,%s' % \
|
||||
(timeval, timeseq, os.getpid(), socket.gethostname(),
|
||||
uid, self._foldermd5, self.infosep, ''.join(sorted(flags)))
|
||||
|
||||
|
||||
def savemessage(self, uid, content, flags, rtime):
|
||||
"""Writes a new message, with the specified uid.
|
||||
|
||||
@ -263,7 +263,7 @@ class MaildirFolder(BaseFolder):
|
||||
fd = os.open(os.path.join(tmpdir, messagename),
|
||||
os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0o666)
|
||||
except OSError as e:
|
||||
if e.errno == 17:
|
||||
if e.errno == 17:
|
||||
#FILE EXISTS ALREADY
|
||||
severity = OfflineImapError.ERROR.MESSAGE
|
||||
raise OfflineImapError("Unique filename %s already existing." %\
|
||||
@ -348,7 +348,7 @@ class MaildirFolder(BaseFolder):
|
||||
os.path.join(self.getfullname(), dir_prefix, filename))
|
||||
self.messagelist[new_uid] = self.messagelist[uid]
|
||||
del self.messagelist[uid]
|
||||
|
||||
|
||||
def deletemessage(self, uid):
|
||||
"""Unlinks a message file from the Maildir.
|
||||
|
||||
@ -373,4 +373,4 @@ class MaildirFolder(BaseFolder):
|
||||
os.unlink(filepath)
|
||||
# Yep -- return.
|
||||
del(self.messagelist[uid])
|
||||
|
||||
|
||||
|
@ -42,7 +42,7 @@ class MappedIMAPFolder(IMAPFolder):
|
||||
def _getmapfilename(self):
|
||||
return os.path.join(self.repository.getmapdir(),
|
||||
self.getfolderbasename())
|
||||
|
||||
|
||||
def _loadmaps(self):
|
||||
self.maplock.acquire()
|
||||
try:
|
||||
|
Reference in New Issue
Block a user