[PATCH 4/9] Re: Inherit LocalStatusSQLFolder from LocalStatusFolder
Sebastian Spaeth
Sebastian at SSpaeth.de
Thu Apr 28 15:04:42 BST 2011
On Wed, 27 Apr 2011 19:27:42 +0200, Nicolas Sebrecht <nicolas.s-dev at laposte.net> wrote:
> On Tue, Apr 26, 2011 at 12:31:35PM +0200, Sebastian Spaeth wrote:
> >
> > - Inherit LocalStatusSQLFolder from LocalStatusFolder
> >
> > - This lets us remove all functions that are available via our ancestors
> > classes and are not needed.
> >
> > - Don't fail if pysql import fails. Fail rather at runtime when needed.
> >
> > - When creating the db file, create a metadata table which contains the
> > format version info, so we can upgrade nicely to other formats.
>
> <...>
>
> > - def getfullname(self):
> > - return self.filename
> > + # testing the existence of the db file won't work. It is created
> > + # as soon as this class instance was intitiated. So say it is a
> > + # new folder when there are no messages at all recorded in it.
> > + return self.getmessagecount() > 0
>
> I'm surprised. Is getfullname() used for _testing_ the existence? Is the
> name of this method so fucked up?
I am surprised now as well. I won't have time to look into this now, but
wil do before the next revision. getfullname is never used for
LocalStatus folders, I believe, but it is also one of those functions
without any code documentation in folder/Base.py, so it's not clear what
it is *supposed* to return :-). We certainly don't want to check for
existence in getfullname(), we do that in "isnewfolder(self)". I will
have to check that.
> Oh, yeah! It's a much better migration plan but we still need more
> advanced. :-)
We can of course migrate the plain text status into the sqlite version,
I was just thinking that recreating the sqlite cache from scratch during
the next sync would be much easier code wise. Especially, since we mark
this optional and experimental :).
But we can do proper migration code, no problem.
Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/offlineimap-project/attachments/20110428/4c41c4f3/attachment-0001.sig>
More information about the OfflineIMAP-project
mailing list