[PATCH] Fix sqlite upgrade code to use correct API call

Dave Abrahams dave at boostpro.com
Mon Aug 29 22:29:47 BST 2011


So, I applied this patch, added

  status_backend = sqlite

to every [Account...] stanza in my config, and restarted.  I'm not
seeing errors, but I also have no indication in the output of
offlineimap that it's using sqlite at all, which makes following the
advice here a bit difficult...

  # If you switch the backend, you may want to delete the old cache
  # directory in ~/.offlineimap/Account-<account>/LocalStatus manually
  # once you are sure that things work.

on Mon Aug 29 2011, Sebastian Spaeth <Sebastian-AT-SSpaeth.de> wrote:

> We were using self.getfolderbasename(self.name) but the API is simply
> getfolderbasename(). Fix this glitch.
>
> Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
> ---
>  offlineimap/folder/LocalStatusSQLite.py |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/offlineimap/folder/LocalStatusSQLite.py b/offlineimap/folder/LocalStatusSQLite.py
> index eae5d0c..bd38930 100644
> --- a/offlineimap/folder/LocalStatusSQLite.py
> +++ b/offlineimap/folder/LocalStatusSQLite.py
> @@ -111,7 +111,8 @@ class LocalStatusSQLiteFolder(LocalStatusFolder):
>
>          if hasattr(self, 'connection'):
>              self.connection.close() #close old connections first
> -        self.connection = sqlite.connect(self.filename, check_same_thread = False)
> +        self.connection = sqlite.connect(self.filename,
> +                                         check_same_thread = False)
>
>          if from_ver == 0:
>              # from_ver==0: no db existent: plain text migration?
> @@ -120,7 +121,7 @@ class LocalStatusSQLiteFolder(LocalStatusFolder):
>              plaintextfilename = os.path.join(
>                  self.repository.account.getaccountmeta(),
>                  'LocalStatus',
> -                self.getfolderbasename(self.name))
> +                self.getfolderbasename())
>              # MIGRATE from plaintext if needed
>              if os.path.exists(plaintextfilename):
>                  self.ui._msg('Migrating LocalStatus cache from plain text '

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




More information about the OfflineIMAP-project mailing list