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:
parent
e8c40a9285
commit
41cb0f577f
@ -122,7 +122,7 @@ OfflineIMAP v6.5.2 (2012-01-17)
|
|||||||
|
|
||||||
* Some sanity checks and improved error messages.
|
* Some sanity checks and improved error messages.
|
||||||
|
|
||||||
* Revert 6.5.1.1 change to use public imaplib2 function, it was reported to
|
* Revert 6.5.1.1 change to use public imaplib2 function, it was reported to
|
||||||
not always work.
|
not always work.
|
||||||
|
|
||||||
* Don't fail when ~/netrc is not readable by us.
|
* Don't fail when ~/netrc is not readable by us.
|
||||||
@ -280,7 +280,7 @@ Changes
|
|||||||
* Refresh server capabilities after login, so we know that Gmail
|
* Refresh server capabilities after login, so we know that Gmail
|
||||||
supports UIDPLUS (it only announces that after login, not
|
supports UIDPLUS (it only announces that after login, not
|
||||||
before). This prevents us from adding custom headers to Gmail uploads.
|
before). This prevents us from adding custom headers to Gmail uploads.
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
---------
|
---------
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ New Features
|
|||||||
* When a message upload/download fails, we do not abort the whole folder
|
* When a message upload/download fails, we do not abort the whole folder
|
||||||
synchronization, but only skip that message, informing the user at the
|
synchronization, but only skip that message, informing the user at the
|
||||||
end of the sync run.
|
end of the sync run.
|
||||||
|
|
||||||
* If you connect via ssl and 'cert_fingerprint' is configured, we check
|
* If you connect via ssl and 'cert_fingerprint' is configured, we check
|
||||||
that the server certificate is actually known and identical by
|
that the server certificate is actually known and identical by
|
||||||
comparing the stored sha1 fingerprint with the current one.
|
comparing the stored sha1 fingerprint with the current one.
|
||||||
@ -437,7 +437,7 @@ Notes
|
|||||||
-----
|
-----
|
||||||
|
|
||||||
This was a very active rc1 and we could expect a lot of new fixes for the next
|
This was a very active rc1 and we could expect a lot of new fixes for the next
|
||||||
release.
|
release.
|
||||||
|
|
||||||
The most important fix is about a bug that could lead to data loss. Find more
|
The most important fix is about a bug that could lead to data loss. Find more
|
||||||
information about his bug here:
|
information about his bug here:
|
||||||
@ -588,7 +588,7 @@ I'd like to thank reporters who involved in this cycle:
|
|||||||
- Pan Tsu
|
- Pan Tsu
|
||||||
- Vincent Beffara
|
- Vincent Beffara
|
||||||
- Will Styler
|
- Will Styler
|
||||||
|
|
||||||
(my apologies if I forget somebody) ...and all active developers, of course!
|
(my apologies if I forget somebody) ...and all active developers, of course!
|
||||||
|
|
||||||
The imaplib2 migration looks to go the right way to be definetly released but
|
The imaplib2 migration looks to go the right way to be definetly released but
|
||||||
|
@ -40,7 +40,7 @@ Most configuration is done via the configuration file. However, any setting can
|
|||||||
|
|
||||||
OfflineImap is well suited to be frequently invoked by cron jobs, or can run in daemon mode to periodically check your email (however, it will exit in some error situations).
|
OfflineImap is well suited to be frequently invoked by cron jobs, or can run in daemon mode to periodically check your email (however, it will exit in some error situations).
|
||||||
|
|
||||||
The documentation is included in the git repository and can be created by
|
The documentation is included in the git repository and can be created by
|
||||||
issueing `make dev-doc` in the `doc` folder (python-sphinx required), or it can
|
issueing `make dev-doc` in the `doc` folder (python-sphinx required), or it can
|
||||||
be viewed online at http://docs.offlineimap.org.
|
be viewed online at http://docs.offlineimap.org.
|
||||||
|
|
||||||
@ -420,7 +420,7 @@ This is an example of a setup where "TheOtherImap" requires all folders to be un
|
|||||||
# The below will put all GMAIL folders as sub-folders of the 'local' INBOX,
|
# The below will put all GMAIL folders as sub-folders of the 'local' INBOX,
|
||||||
# assuming that your path separator on 'local' is a dot.
|
# assuming that your path separator on 'local' is a dot.
|
||||||
nametrans = lambda x: 'INBOX.' + x
|
nametrans = lambda x: 'INBOX.' + x
|
||||||
|
|
||||||
[Repository TheOtherImap]
|
[Repository TheOtherImap]
|
||||||
#This is the 'local' repository
|
#This is the 'local' repository
|
||||||
type = IMAP
|
type = IMAP
|
||||||
@ -437,7 +437,7 @@ Add this to the remote gmail repository section to only sync mails which are in
|
|||||||
|
|
||||||
To only get the All Mail folder from a Gmail account, you would e.g. do::
|
To only get the All Mail folder from a Gmail account, you would e.g. do::
|
||||||
|
|
||||||
folderfilter = lambda folder: folder.startswith('[Gmail]/All Mail')
|
folderfilter = lambda folder: folder.startswith('[Gmail]/All Mail')
|
||||||
|
|
||||||
|
|
||||||
Another nametrans transpose example
|
Another nametrans transpose example
|
||||||
@ -464,25 +464,25 @@ offlineimap.conf::
|
|||||||
ui = ttyui
|
ui = ttyui
|
||||||
pythonfile=~/bin/offlineimap-helpers.py
|
pythonfile=~/bin/offlineimap-helpers.py
|
||||||
socktimeout = 90
|
socktimeout = 90
|
||||||
|
|
||||||
[Account acc1]
|
[Account acc1]
|
||||||
localrepository = acc1local
|
localrepository = acc1local
|
||||||
remoterepository = acc1remote
|
remoterepository = acc1remote
|
||||||
autorefresh = 2
|
autorefresh = 2
|
||||||
|
|
||||||
[Account acc2]
|
[Account acc2]
|
||||||
localrepository = acc2local
|
localrepository = acc2local
|
||||||
remoterepository = acc2remote
|
remoterepository = acc2remote
|
||||||
autorefresh = 4
|
autorefresh = 4
|
||||||
|
|
||||||
[Repository acc1local]
|
[Repository acc1local]
|
||||||
type = Maildir
|
type = Maildir
|
||||||
localfolders = ~/Mail/acc1
|
localfolders = ~/Mail/acc1
|
||||||
|
|
||||||
[Repository acc2local]
|
[Repository acc2local]
|
||||||
type = Maildir
|
type = Maildir
|
||||||
localfolders = ~/Mail/acc2
|
localfolders = ~/Mail/acc2
|
||||||
|
|
||||||
[Repository acc1remote]
|
[Repository acc1remote]
|
||||||
type = IMAP
|
type = IMAP
|
||||||
remotehost = imap.acc1.com
|
remotehost = imap.acc1.com
|
||||||
@ -494,7 +494,7 @@ offlineimap.conf::
|
|||||||
# Folders to get:
|
# Folders to get:
|
||||||
folderfilter = lambda foldername: foldername in [
|
folderfilter = lambda foldername: foldername in [
|
||||||
'INBOX', 'Drafts', 'Sent', 'archiv']
|
'INBOX', 'Drafts', 'Sent', 'archiv']
|
||||||
|
|
||||||
[Repository acc2remote]
|
[Repository acc2remote]
|
||||||
type = IMAP
|
type = IMAP
|
||||||
remotehost = imap.acc2.net
|
remotehost = imap.acc2.net
|
||||||
@ -532,7 +532,7 @@ Offlineimap handles the renaming correctly in both directions::
|
|||||||
retval = "acc1." + foldername
|
retval = "acc1." + foldername
|
||||||
retval = re.sub("/", ".", retval)
|
retval = re.sub("/", ".", retval)
|
||||||
return retval
|
return retval
|
||||||
|
|
||||||
def oimaptransfolder_acc2(foldername):
|
def oimaptransfolder_acc2(foldername):
|
||||||
if(foldername == "INBOX"):
|
if(foldername == "INBOX"):
|
||||||
retval = "acc2"
|
retval = "acc2"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
Within :mod:`offlineimap`, the classes :class:`OfflineImap` provides the high-level functionality. The rest of the classes should usually not needed to be touched by the user. Email repositories are represented by a :class:`offlineimap.repository.Base.BaseRepository` or derivatives (see :mod:`offlineimap.repository` for details). A folder within a repository is represented by a :class:`offlineimap.folder.Base.BaseFolder` or any derivative from :mod:`offlineimap.folder`.
|
Within :mod:`offlineimap`, the classes :class:`OfflineImap` provides the high-level functionality. The rest of the classes should usually not needed to be touched by the user. Email repositories are represented by a :class:`offlineimap.repository.Base.BaseRepository` or derivatives (see :mod:`offlineimap.repository` for details). A folder within a repository is represented by a :class:`offlineimap.folder.Base.BaseFolder` or any derivative from :mod:`offlineimap.folder`.
|
||||||
|
|
||||||
This page contains the main API overview of OfflineImap |release|.
|
This page contains the main API overview of OfflineImap |release|.
|
||||||
|
|
||||||
OfflineImap can be imported as::
|
OfflineImap can be imported as::
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ be merged into the main documentation.
|
|||||||
|
|
||||||
:mod:`offlineimap` -- The OfflineImap module
|
:mod:`offlineimap` -- The OfflineImap module
|
||||||
=============================================
|
=============================================
|
||||||
|
|
||||||
.. module:: offlineimap
|
.. module:: offlineimap
|
||||||
|
|
||||||
.. autoclass:: offlineimap.OfflineImap(cmdline_opts = None)
|
.. autoclass:: offlineimap.OfflineImap(cmdline_opts = None)
|
||||||
|
@ -67,13 +67,13 @@ based in instructions submitted by Chris Walker::
|
|||||||
|
|
||||||
First, you must run OfflineIMAP in the Cygwin environment. The Windows
|
First, you must run OfflineIMAP in the Cygwin environment. The Windows
|
||||||
filesystem is not powerful enough to accomodate Maildir by itself.
|
filesystem is not powerful enough to accomodate Maildir by itself.
|
||||||
|
|
||||||
Next, you’ll need to mount your Maildir directory in a special
|
Next, you’ll need to mount your Maildir directory in a special
|
||||||
way. There is information for doing that at
|
way. There is information for doing that at
|
||||||
http://barnson.org/node/295. That site gives this example::
|
http://barnson.org/node/295. That site gives this example::
|
||||||
|
|
||||||
mount -f -s -b -o managed "d:/tmp/mail" "/home/of/mail"
|
mount -f -s -b -o managed "d:/tmp/mail" "/home/of/mail"
|
||||||
|
|
||||||
That URL also has more details on making OfflineIMAP work with Windows.
|
That URL also has more details on making OfflineIMAP work with Windows.
|
||||||
|
|
||||||
|
|
||||||
@ -383,9 +383,9 @@ you’ll list this::
|
|||||||
[mbnames]
|
[mbnames]
|
||||||
enabled = yes
|
enabled = yes
|
||||||
filename = ~/Mutt/muttrc.mailboxes
|
filename = ~/Mutt/muttrc.mailboxes
|
||||||
header = "mailboxes "
|
header = "mailboxes "
|
||||||
peritem = "+%(accountname)s/%(foldername)s"
|
peritem = "+%(accountname)s/%(foldername)s"
|
||||||
sep = " "
|
sep = " "
|
||||||
footer = "\n"
|
footer = "\n"
|
||||||
|
|
||||||
Then in your ``.muttrc``::
|
Then in your ``.muttrc``::
|
||||||
@ -448,7 +448,7 @@ written in Korn, so you’ll need ksh, pdksh, or mksh to run it::
|
|||||||
# remove any old instances of this shell script or offlineimap
|
# remove any old instances of this shell script or offlineimap
|
||||||
for pid in $(pgrep offlineimap)
|
for pid in $(pgrep offlineimap)
|
||||||
do
|
do
|
||||||
if $pid -ne $$
|
if $pid -ne $$
|
||||||
then
|
then
|
||||||
kill $pid
|
kill $pid
|
||||||
fi
|
fi
|
||||||
|
@ -440,7 +440,7 @@ Know the status of your patch after submission
|
|||||||
of the branch in which your patch has been merged (i.e. it will not
|
of the branch in which your patch has been merged (i.e. it will not
|
||||||
tell you if your patch is merged in pu if you rebase on top of
|
tell you if your patch is merged in pu if you rebase on top of
|
||||||
master).
|
master).
|
||||||
|
|
||||||
.. * Read the git mailing list, the maintainer regularly posts messages
|
.. * Read the git mailing list, the maintainer regularly posts messages
|
||||||
entitled "What's cooking in git.git" and "What's in git.git" giving
|
entitled "What's cooking in git.git" and "What's in git.git" giving
|
||||||
the status of various proposed changes.
|
the status of various proposed changes.
|
||||||
|
@ -190,7 +190,7 @@ remoterepository = RemoteExample
|
|||||||
# In this case a call to imapfilter to filter mail before the sync process
|
# In this case a call to imapfilter to filter mail before the sync process
|
||||||
# starts and a custom shell script after the sync completes.
|
# starts and a custom shell script after the sync completes.
|
||||||
# The pre sync script has to complete before a sync to the account will
|
# The pre sync script has to complete before a sync to the account will
|
||||||
# start.
|
# start.
|
||||||
|
|
||||||
# presynchook = imapfilter
|
# presynchook = imapfilter
|
||||||
# postsynchook = notifysync.sh
|
# postsynchook = notifysync.sh
|
||||||
|
@ -29,7 +29,7 @@ class CustomConfigParser(SafeConfigParser):
|
|||||||
return self.get(*(section, option) + args, **kwargs)
|
return self.get(*(section, option) + args, **kwargs)
|
||||||
else:
|
else:
|
||||||
return default
|
return default
|
||||||
|
|
||||||
def getdefaultint(self, section, option, default, *args, **kwargs):
|
def getdefaultint(self, section, option, default, *args, **kwargs):
|
||||||
if self.has_option(section, option):
|
if self.has_option(section, option):
|
||||||
return self.getint (*(section, option) + args, **kwargs)
|
return self.getint (*(section, option) + args, **kwargs)
|
||||||
@ -120,7 +120,7 @@ class ConfigHelperMixin:
|
|||||||
return self._confighelper_runner(option, default,
|
return self._confighelper_runner(option, default,
|
||||||
self.getconfig().getdefaultint,
|
self.getconfig().getdefaultint,
|
||||||
self.getconfig().getint)
|
self.getconfig().getint)
|
||||||
|
|
||||||
def getconffloat(self, option, default = CustomConfigDefault):
|
def getconffloat(self, option, default = CustomConfigDefault):
|
||||||
return self._confighelper_runner(option, default,
|
return self._confighelper_runner(option, default,
|
||||||
self.getconfig().getdefaultfloat,
|
self.getconfig().getdefaultfloat,
|
||||||
|
@ -14,6 +14,6 @@ __homepage__ = "http://offlineimap.org"
|
|||||||
banner = __bigcopyright__
|
banner = __bigcopyright__
|
||||||
|
|
||||||
from offlineimap.error import OfflineImapError
|
from offlineimap.error import OfflineImapError
|
||||||
# put this last, so we don't run into circular dependencies using
|
# put this last, so we don't run into circular dependencies using
|
||||||
# e.g. offlineimap.__version__.
|
# e.g. offlineimap.__version__.
|
||||||
from offlineimap.init import OfflineImap
|
from offlineimap.init import OfflineImap
|
||||||
|
@ -210,7 +210,7 @@ class BaseFolder(object):
|
|||||||
If the backend CAN assign a new uid, but cannot find out what
|
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
|
this UID is (as is the case with some IMAP servers), it
|
||||||
returns 0 but DOES save the message.
|
returns 0 but DOES save the message.
|
||||||
|
|
||||||
IMAP backend should be the only one that can assign a new
|
IMAP backend should be the only one that can assign a new
|
||||||
uid.
|
uid.
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ class BaseFolder(object):
|
|||||||
continue #don't actually remove in a dryrun
|
continue #don't actually remove in a dryrun
|
||||||
dstfolder.deletemessagesflags(uids, set(flag))
|
dstfolder.deletemessagesflags(uids, set(flag))
|
||||||
statusfolder.deletemessagesflags(uids, set(flag))
|
statusfolder.deletemessagesflags(uids, set(flag))
|
||||||
|
|
||||||
def syncmessagesto(self, dstfolder, statusfolder):
|
def syncmessagesto(self, dstfolder, statusfolder):
|
||||||
"""Syncs messages in this folder to the destination dstfolder.
|
"""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
|
uids present (except for potential negative uids that couldn't
|
||||||
be placed anywhere).
|
be placed anywhere).
|
||||||
|
|
||||||
Pass3: Synchronize flag changes
|
Pass3: Synchronize flag changes
|
||||||
Compare flag mismatches in self with those in statusfolder. If
|
Compare flag mismatches in self with those in statusfolder. If
|
||||||
msg has a valid UID and exists on dstfolder (has not e.g. been
|
msg has a valid UID and exists on dstfolder (has not e.g. been
|
||||||
deleted there), sync the flag change to both dstfolder and
|
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
|
Prefer SELECT to EXAMINE if we can, since some servers
|
||||||
(Courier) do not stabilize UID validity until the folder is
|
(Courier) do not stabilize UID validity until the folder is
|
||||||
selected.
|
selected.
|
||||||
.. todo: Still valid? Needs verification
|
.. todo: Still valid? Needs verification
|
||||||
:param: Enforce new SELECT even if we are on that folder already.
|
:param: Enforce new SELECT even if we are on that folder already.
|
||||||
:returns: raises :exc:`OfflineImapError` severity FOLDER on error"""
|
:returns: raises :exc:`OfflineImapError` severity FOLDER on error"""
|
||||||
@ -116,7 +116,7 @@ class IMAPFolder(BaseFolder):
|
|||||||
maxmsgid = max(long(msgid), maxmsgid)
|
maxmsgid = max(long(msgid), maxmsgid)
|
||||||
# Different number of messages than last time?
|
# Different number of messages than last time?
|
||||||
if maxmsgid != statusfolder.getmessagecount():
|
if maxmsgid != statusfolder.getmessagecount():
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def cachemessagelist(self):
|
def cachemessagelist(self):
|
||||||
@ -526,7 +526,7 @@ class IMAPFolder(BaseFolder):
|
|||||||
self.ui.debug('imap', 'savemessage: header is: %s: %s' %\
|
self.ui.debug('imap', 'savemessage: header is: %s: %s' %\
|
||||||
(headername, headervalue))
|
(headername, headervalue))
|
||||||
content = self.savemessage_addheader(content, headername,
|
content = self.savemessage_addheader(content, headername,
|
||||||
headervalue)
|
headervalue)
|
||||||
if len(content)>200:
|
if len(content)>200:
|
||||||
dbg_output = "%s...%s" % (content[:150], content[-50:])
|
dbg_output = "%s...%s" % (content[:150], content[-50:])
|
||||||
else:
|
else:
|
||||||
@ -710,11 +710,11 @@ class IMAPFolder(BaseFolder):
|
|||||||
def change_message_uid(self, uid, new_uid):
|
def change_message_uid(self, uid, new_uid):
|
||||||
"""Change the message from existing uid to 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 '
|
raise OfflineImapError('IMAP backend cannot change a messages UID from '
|
||||||
'%d to %d' % (uid, new_uid),
|
'%d to %d' % (uid, new_uid),
|
||||||
OfflineImapError.ERROR.MESSAGE)
|
OfflineImapError.ERROR.MESSAGE)
|
||||||
|
|
||||||
def deletemessage(self, uid):
|
def deletemessage(self, uid):
|
||||||
self.deletemessages_noconvert([uid])
|
self.deletemessages_noconvert([uid])
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class LocalStatusSQLiteFolder(LocalStatusFolder):
|
|||||||
#though. According to sqlite docs, you need to commit() before
|
#though. According to sqlite docs, you need to commit() before
|
||||||
#the connection is closed or your changes will be lost!"""
|
#the connection is closed or your changes will be lost!"""
|
||||||
#get db connection which autocommits
|
#get db connection which autocommits
|
||||||
#connection = sqlite.connect(self.filename, isolation_level=None)
|
#connection = sqlite.connect(self.filename, isolation_level=None)
|
||||||
#cursor = connection.cursor()
|
#cursor = connection.cursor()
|
||||||
#return connection, cursor
|
#return connection, cursor
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ class LocalStatusSQLiteFolder(LocalStatusFolder):
|
|||||||
cur_version = 1
|
cur_version = 1
|
||||||
|
|
||||||
def __init__(self, name, repository):
|
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
|
# dblock protects against concurrent writes in same connection
|
||||||
self._dblock = Lock()
|
self._dblock = Lock()
|
||||||
#Try to establish connection, no need for threadsafety in __init__
|
#Try to establish connection, no need for threadsafety in __init__
|
||||||
|
@ -196,7 +196,7 @@ class MaildirFolder(BaseFolder):
|
|||||||
if sorted(self.getmessageuidlist()) != \
|
if sorted(self.getmessageuidlist()) != \
|
||||||
sorted(statusfolder.getmessageuidlist()):
|
sorted(statusfolder.getmessageuidlist()):
|
||||||
return True
|
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():
|
for (uid, message) in self.getmessagelist().iteritems():
|
||||||
if message['flags'] != statusfolder.getmessageflags(uid):
|
if message['flags'] != statusfolder.getmessageflags(uid):
|
||||||
return True
|
return True
|
||||||
@ -235,7 +235,7 @@ class MaildirFolder(BaseFolder):
|
|||||||
return '%d_%d.%d.%s,U=%d,FMD5=%s%s2,%s' % \
|
return '%d_%d.%d.%s,U=%d,FMD5=%s%s2,%s' % \
|
||||||
(timeval, timeseq, os.getpid(), socket.gethostname(),
|
(timeval, timeseq, os.getpid(), socket.gethostname(),
|
||||||
uid, self._foldermd5, self.infosep, ''.join(sorted(flags)))
|
uid, self._foldermd5, self.infosep, ''.join(sorted(flags)))
|
||||||
|
|
||||||
def savemessage(self, uid, content, flags, rtime):
|
def savemessage(self, uid, content, flags, rtime):
|
||||||
"""Writes a new message, with the specified uid.
|
"""Writes a new message, with the specified uid.
|
||||||
|
|
||||||
@ -263,7 +263,7 @@ class MaildirFolder(BaseFolder):
|
|||||||
fd = os.open(os.path.join(tmpdir, messagename),
|
fd = os.open(os.path.join(tmpdir, messagename),
|
||||||
os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0o666)
|
os.O_EXCL|os.O_CREAT|os.O_WRONLY, 0o666)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno == 17:
|
if e.errno == 17:
|
||||||
#FILE EXISTS ALREADY
|
#FILE EXISTS ALREADY
|
||||||
severity = OfflineImapError.ERROR.MESSAGE
|
severity = OfflineImapError.ERROR.MESSAGE
|
||||||
raise OfflineImapError("Unique filename %s already existing." %\
|
raise OfflineImapError("Unique filename %s already existing." %\
|
||||||
@ -348,7 +348,7 @@ class MaildirFolder(BaseFolder):
|
|||||||
os.path.join(self.getfullname(), dir_prefix, filename))
|
os.path.join(self.getfullname(), dir_prefix, filename))
|
||||||
self.messagelist[new_uid] = self.messagelist[uid]
|
self.messagelist[new_uid] = self.messagelist[uid]
|
||||||
del self.messagelist[uid]
|
del self.messagelist[uid]
|
||||||
|
|
||||||
def deletemessage(self, uid):
|
def deletemessage(self, uid):
|
||||||
"""Unlinks a message file from the Maildir.
|
"""Unlinks a message file from the Maildir.
|
||||||
|
|
||||||
@ -373,4 +373,4 @@ class MaildirFolder(BaseFolder):
|
|||||||
os.unlink(filepath)
|
os.unlink(filepath)
|
||||||
# Yep -- return.
|
# Yep -- return.
|
||||||
del(self.messagelist[uid])
|
del(self.messagelist[uid])
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class MappedIMAPFolder(IMAPFolder):
|
|||||||
def _getmapfilename(self):
|
def _getmapfilename(self):
|
||||||
return os.path.join(self.repository.getmapdir(),
|
return os.path.join(self.repository.getmapdir(),
|
||||||
self.getfolderbasename())
|
self.getfolderbasename())
|
||||||
|
|
||||||
def _loadmaps(self):
|
def _loadmaps(self):
|
||||||
self.maplock.acquire()
|
self.maplock.acquire()
|
||||||
try:
|
try:
|
||||||
|
@ -1330,7 +1330,7 @@ class IMAP4(object):
|
|||||||
self.ouq.put(rqb)
|
self.ouq.put(rqb)
|
||||||
return rqb
|
return rqb
|
||||||
|
|
||||||
# Must setup continuation expectancy *before* ouq.put
|
# Must setup continuation expectancy *before* ouq.put
|
||||||
crqb = self._request_push(tag='continuation')
|
crqb = self._request_push(tag='continuation')
|
||||||
|
|
||||||
self.ouq.put(rqb)
|
self.ouq.put(rqb)
|
||||||
@ -2442,7 +2442,7 @@ if __name__ == '__main__':
|
|||||||
run('id', ())
|
run('id', ())
|
||||||
run('id', ('("name", "imaplib2")',))
|
run('id', ('("name", "imaplib2")',))
|
||||||
run('id', ("version", __version__, "os", os.uname()[0]))
|
run('id', ("version", __version__, "os", os.uname()[0]))
|
||||||
|
|
||||||
for cmd,args in test_seq2:
|
for cmd,args in test_seq2:
|
||||||
if (cmd,args) != ('uid', ('SEARCH', 'SUBJECT', 'IMAP4 test')):
|
if (cmd,args) != ('uid', ('SEARCH', 'SUBJECT', 'IMAP4 test')):
|
||||||
run(cmd, args)
|
run(cmd, args)
|
||||||
|
@ -137,7 +137,7 @@ class IMAPServer:
|
|||||||
try:
|
try:
|
||||||
if self.gss_step == self.GSS_STATE_STEP:
|
if self.gss_step == self.GSS_STATE_STEP:
|
||||||
if not self.gss_vc:
|
if not self.gss_vc:
|
||||||
rc, self.gss_vc = kerberos.authGSSClientInit('imap@' +
|
rc, self.gss_vc = kerberos.authGSSClientInit('imap@' +
|
||||||
self.hostname)
|
self.hostname)
|
||||||
response = kerberos.authGSSClientResponse(self.gss_vc)
|
response = kerberos.authGSSClientResponse(self.gss_vc)
|
||||||
rc = kerberos.authGSSClientStep(self.gss_vc, data)
|
rc = kerberos.authGSSClientStep(self.gss_vc, data)
|
||||||
@ -188,7 +188,7 @@ class IMAPServer:
|
|||||||
self.lastowner[imapobj] = curThread.ident
|
self.lastowner[imapobj] = curThread.ident
|
||||||
self.connectionlock.release()
|
self.connectionlock.release()
|
||||||
return imapobj
|
return imapobj
|
||||||
|
|
||||||
self.connectionlock.release() # Release until need to modify data
|
self.connectionlock.release() # Release until need to modify data
|
||||||
|
|
||||||
""" Must be careful here that if we fail we should bail out gracefully
|
""" Must be careful here that if we fail we should bail out gracefully
|
||||||
@ -433,7 +433,7 @@ class IMAPServer:
|
|||||||
certnames = []
|
certnames = []
|
||||||
|
|
||||||
# cert expired?
|
# cert expired?
|
||||||
notafter = cert.get('notAfter')
|
notafter = cert.get('notAfter')
|
||||||
if notafter:
|
if notafter:
|
||||||
if time.time() >= cert_time_to_seconds(notafter):
|
if time.time() >= cert_time_to_seconds(notafter):
|
||||||
return '%s certificate expired %s' % (errstr, notafter)
|
return '%s certificate expired %s' % (errstr, notafter)
|
||||||
|
@ -277,7 +277,7 @@ class OfflineImap:
|
|||||||
|
|
||||||
if options.logfile:
|
if options.logfile:
|
||||||
sys.stderr = self.ui.logfile
|
sys.stderr = self.ui.logfile
|
||||||
|
|
||||||
socktimeout = config.getdefaultint("general", "socktimeout", 0)
|
socktimeout = config.getdefaultint("general", "socktimeout", 0)
|
||||||
if socktimeout > 0:
|
if socktimeout > 0:
|
||||||
socket.setdefaulttimeout(socktimeout)
|
socket.setdefaulttimeout(socktimeout)
|
||||||
|
@ -70,5 +70,3 @@ def genmbnames():
|
|||||||
file.close()
|
file.close()
|
||||||
finally:
|
finally:
|
||||||
mblock.release()
|
mblock.release()
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ class BaseRepository(CustomConfig.ConfigHelperMixin, object):
|
|||||||
|
|
||||||
def getlocaleval(self):
|
def getlocaleval(self):
|
||||||
return self.account.getlocaleval()
|
return self.account.getlocaleval()
|
||||||
|
|
||||||
def getfolders(self):
|
def getfolders(self):
|
||||||
"""Returns a list of ALL folders on this server."""
|
"""Returns a list of ALL folders on this server."""
|
||||||
return []
|
return []
|
||||||
|
@ -28,7 +28,7 @@ class GmailRepository(IMAPRepository):
|
|||||||
HOSTNAME = "imap.gmail.com"
|
HOSTNAME = "imap.gmail.com"
|
||||||
# Gmail IMAP server port
|
# Gmail IMAP server port
|
||||||
PORT = 993
|
PORT = 993
|
||||||
|
|
||||||
def __init__(self, reposname, account):
|
def __init__(self, reposname, account):
|
||||||
"""Initialize a GmailRepository object."""
|
"""Initialize a GmailRepository object."""
|
||||||
# Enforce SSL usage
|
# Enforce SSL usage
|
||||||
|
@ -362,7 +362,7 @@ class IMAPRepository(BaseRepository):
|
|||||||
OfflineImapError.ERROR.FOLDER)
|
OfflineImapError.ERROR.FOLDER)
|
||||||
finally:
|
finally:
|
||||||
self.imapserver.releaseconnection(imapobj)
|
self.imapserver.releaseconnection(imapobj)
|
||||||
|
|
||||||
class MappedIMAPRepository(IMAPRepository):
|
class MappedIMAPRepository(IMAPRepository):
|
||||||
def getfoldertype(self):
|
def getfoldertype(self):
|
||||||
return MappedIMAPFolder
|
return MappedIMAPFolder
|
||||||
|
@ -91,7 +91,7 @@ class LocalStatusRepository(BaseRepository):
|
|||||||
return folder
|
return folder
|
||||||
|
|
||||||
def getfolders(self):
|
def getfolders(self):
|
||||||
"""Returns a list of all cached folders.
|
"""Returns a list of all cached folders.
|
||||||
|
|
||||||
Does nothing for this backend. We mangle the folder file names
|
Does nothing for this backend. We mangle the folder file names
|
||||||
(see getfolderfilename) so we can not derive folder names from
|
(see getfolderfilename) so we can not derive folder names from
|
||||||
|
@ -85,7 +85,7 @@ class MaildirRepository(BaseRepository):
|
|||||||
if self.account.dryrun:
|
if self.account.dryrun:
|
||||||
return
|
return
|
||||||
full_path = os.path.abspath(os.path.join(self.root, foldername))
|
full_path = os.path.abspath(os.path.join(self.root, foldername))
|
||||||
|
|
||||||
# sanity tests
|
# sanity tests
|
||||||
if self.getsep() == '/':
|
if self.getsep() == '/':
|
||||||
for component in foldername.split('/'):
|
for component in foldername.split('/'):
|
||||||
|
@ -79,7 +79,7 @@ class MachineUI(UIBase):
|
|||||||
s._printData('connecting', "%s\n%s" % (hostname, str(port)))
|
s._printData('connecting', "%s\n%s" % (hostname, str(port)))
|
||||||
|
|
||||||
def syncfolders(s, srcrepos, destrepos):
|
def syncfolders(s, srcrepos, destrepos):
|
||||||
s._printData('syncfolders', "%s\n%s" % (s.getnicename(srcrepos),
|
s._printData('syncfolders', "%s\n%s" % (s.getnicename(srcrepos),
|
||||||
s.getnicename(destrepos)))
|
s.getnicename(destrepos)))
|
||||||
|
|
||||||
def syncingfolder(s, srcrepos, srcfolder, destrepos, destfolder):
|
def syncingfolder(s, srcrepos, srcfolder, destrepos, destfolder):
|
||||||
|
@ -20,7 +20,7 @@ from offlineimap.ui import TTY, Noninteractive, Machine
|
|||||||
|
|
||||||
UI_LIST = {'ttyui': TTY.TTYUI,
|
UI_LIST = {'ttyui': TTY.TTYUI,
|
||||||
'basic': Noninteractive.Basic,
|
'basic': Noninteractive.Basic,
|
||||||
'quiet': Noninteractive.Quiet,
|
'quiet': Noninteractive.Quiet,
|
||||||
'machineui': Machine.MachineUI}
|
'machineui': Machine.MachineUI}
|
||||||
|
|
||||||
#add Blinkenlights UI if it imports correctly (curses installed)
|
#add Blinkenlights UI if it imports correctly (curses installed)
|
||||||
|
@ -25,7 +25,7 @@ class DebuggingLock:
|
|||||||
def __init__(self, name):
|
def __init__(self, name):
|
||||||
self.lock = Lock()
|
self.lock = Lock()
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
def acquire(self, blocking = 1):
|
def acquire(self, blocking = 1):
|
||||||
self.print_tb("Acquire lock")
|
self.print_tb("Acquire lock")
|
||||||
self.lock.acquire(blocking)
|
self.lock.acquire(blocking)
|
||||||
@ -45,5 +45,5 @@ class DebuggingLock:
|
|||||||
self.logmsg(".... %s: Thread %s attempting to %s\n" % \
|
self.logmsg(".... %s: Thread %s attempting to %s\n" % \
|
||||||
(self.name, currentThread().getName(), msg) + \
|
(self.name, currentThread().getName(), msg) + \
|
||||||
"\n".join(traceback.format_list(traceback.extract_stack())))
|
"\n".join(traceback.format_list(traceback.extract_stack())))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user