diff options
Diffstat (limited to 'mail/offlineimap/files')
-rw-r--r-- | mail/offlineimap/files/patch-fix-super-usage | 31 | ||||
-rw-r--r-- | mail/offlineimap/files/patch-imaplib2-python-bug3473 | 37 | ||||
-rw-r--r-- | mail/offlineimap/files/patch-use-interpolation | 62 |
3 files changed, 62 insertions, 68 deletions
diff --git a/mail/offlineimap/files/patch-fix-super-usage b/mail/offlineimap/files/patch-fix-super-usage deleted file mode 100644 index ada8d2ddd25e..000000000000 --- a/mail/offlineimap/files/patch-fix-super-usage +++ /dev/null @@ -1,31 +0,0 @@ -From 45c1d4fc6ed09d6e1a5412c2ac902b236b4e212f Mon Sep 17 00:00:00 2001 -From: Eygene Ryabinkin <rea@codelabs.ru> -Date: Sun, 19 Feb 2012 20:55:06 +0400 -Subject: [PATCH] Fix Curses interface for Python 2.6 - -In 2.6 all logging classes are not the new-style ones, so they -have no mro() method and, thus, we can't use super() for them. -Since CursesLogHanler is singly-inherited method, there will -be no problems in usage of the explicit superclass name. - -Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru> ---- - offlineimap/ui/Curses.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/offlineimap/ui/Curses.py b/offlineimap/ui/Curses.py -index af41d35..fa791bb 100644 ---- a/offlineimap/ui/Curses.py -+++ b/offlineimap/ui/Curses.py -@@ -282,7 +282,7 @@ class CursesLogHandler(logging.StreamHandler): - """self.ui has been set to the UI class before anything is invoked""" - - def emit(self, record): -- log_str = super(CursesLogHandler, self).format(record) -+ log_str = logging.StreamHandler.format(self, record) - color = self.ui.gettf().curses_color - # We must acquire both locks. Otherwise, deadlock can result. - # This can happen if one thread calls _msg (locking curses, then --- -1.7.9 - diff --git a/mail/offlineimap/files/patch-imaplib2-python-bug3473 b/mail/offlineimap/files/patch-imaplib2-python-bug3473 deleted file mode 100644 index 154d309176a1..000000000000 --- a/mail/offlineimap/files/patch-imaplib2-python-bug3473 +++ /dev/null @@ -1,37 +0,0 @@ -From b28b53c1367352eb9f634d4f23d13142b9bbbd4d Mon Sep 17 00:00:00 2001 -From: Eygene Ryabinkin <rea@codelabs.ru> -Date: Sun, 19 Feb 2012 17:35:28 +0400 -Subject: [PATCH] Imaplib2: work around the Python bug 3473 - -It was not possible to pass anything, but (*args, **kwargs) -before the following bug was solved, - http://bugs.python.org/issue3473 -so we can't say (*args, key1 = value1, key2 = value2), but we -should pack keys and values to the dictionary and pass it -with **kwargs. - -Python <= 2.5 have this unfixed, so we should fix this in our code. - -Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru> ---- - offlineimap/imaplib2.py | 4 +++- - 1 files changed, 3 insertions(+), 1 deletions(-) - -diff --git a/offlineimap/imaplib2.py b/offlineimap/imaplib2.py -index ffa2676..ed978be 100644 ---- a/offlineimap/imaplib2.py -+++ b/offlineimap/imaplib2.py -@@ -1591,7 +1591,9 @@ class IMAP4(object): - def _simple_command(self, name, *args, **kw): - - if 'callback' in kw: -- self._command(name, *args, callback=self._command_completer, cb_arg=kw, cb_self=True) -+ # http://bugs.python.org/issue3473 -+ kwargs = {'callback':self._command_completer, 'cb_arg':kw, 'cb_self':True} -+ self._command(name, *args, **kwargs) - return (None, None) - return self._command_complete(self._command(name, *args), kw) - --- -1.7.9 - diff --git a/mail/offlineimap/files/patch-use-interpolation b/mail/offlineimap/files/patch-use-interpolation new file mode 100644 index 000000000000..a6004f25e339 --- /dev/null +++ b/mail/offlineimap/files/patch-use-interpolation @@ -0,0 +1,62 @@ +From 8cf576b9edd7f7fe245d4590206ff740d3ed31e3 Mon Sep 17 00:00:00 2001 +From: Eygene Ryabinkin <rea@codelabs.ru> +Date: Wed, 6 Jun 2012 07:45:01 +0400 +Subject: [PATCH] Use '%' instead of String.format() + +Python 2.6 doesn't like empty {} specifications for +String.format(), but the ones that were changed don't +really need the full machinery of String.format() here. + +Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru> +--- + offlineimap/folder/Base.py | 2 +- + offlineimap/ui/UIBase.py | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py +index 6f6f364..4c3f1ca 100644 +--- a/offlineimap/folder/Base.py ++++ b/offlineimap/folder/Base.py +@@ -386,7 +386,7 @@ class BaseFolder(object): + self.getmessageuidlist()) + num_to_copy = len(copylist) + if num_to_copy and self.repository.account.dryrun: +- self.ui.info("[DRYRUN] Copy {} messages from {}[{}] to {}".format( ++ self.ui.info("[DRYRUN] Copy %d messages from %s[%s] to %s" % ( + num_to_copy, self, self.repository, dstfolder.repository)) + return + for num, uid in enumerate(copylist): +diff --git a/offlineimap/ui/UIBase.py b/offlineimap/ui/UIBase.py +index eea929d..6608d6d 100644 +--- a/offlineimap/ui/UIBase.py ++++ b/offlineimap/ui/UIBase.py +@@ -301,7 +301,7 @@ class UIBase(object): + def makefolder(self, repo, foldername): + """Called when a folder is created""" + prefix = "[DRYRUN] " if self.dryrun else "" +- self.info("{}Creating folder {}[{}]".format( ++ self.info("%sCreating folder %s[%s]" % ( + prefix, foldername, repo)) + + def syncingfolder(self, srcrepos, srcfolder, destrepos, destfolder): +@@ -346,7 +346,7 @@ class UIBase(object): + def deletingmessages(self, uidlist, destlist): + ds = self.folderlist(destlist) + prefix = "[DRYRUN] " if self.dryrun else "" +- self.info("{}Deleting {} messages ({}) in {}".format( ++ self.info("%sDeleting %s messages (%s) in %s" % ( + prefix, len(uidlist), + offlineimap.imaputil.uid_sequence(uidlist), ds)) + +@@ -474,7 +474,7 @@ class UIBase(object): + + def callhook(self, msg): + if self.dryrun: +- self.info("[DRYRUN] {}".format(msg)) ++ self.info("[DRYRUN] %s" % (msg)) + else: + self.info(msg) + +-- +1.7.10.3 + |