[ZPatterns] Converting Rack to use BTrees

Phillip J. Eby pje@telecommunity.com
Thu, 07 Jun 2001 10:07:47 -0500


At 06:35 PM 5/29/01 +0100, Steve Alexander wrote:
>Phillip, Ty,
>
>I see that the ZPatterns in CVS still uses the old BTree library.
>
>Making it use the new one looks as simple as changing Rack's
>__writeableStorage method to look like this:
>
>     def __writeableStorage(self):
>         """Create new a mapping-like object for storing 'persistent'
>            stuff and save it in self"""
>         from BTrees.OOBTree import OOBTree
>         s = self.__readableStorage = self.__writeableStorage = OOBTree()
>         return s
>
>Can you see any problems with this?

Nope.  So I've just added it to CVS.

>
>The only problem I can see is the use of len() in Rack.storageInUse().

Why would that be a problem?


>Then, of course, you could also add a method to convert persistent Racks 
>from the old-style BTree to the new BTrees, which would use 
>BTrees/convert.py.

What I've done is change manage_pack to do this upgrade as a side effect.
So you can just click on "Remove orphaned slots" in the "Storage" tab to do
the conversion.

By the way, I've just committed to CVS a new round of revisions to
ZPatterns' management UI, which includes some (very) minor UI bug fixes.

ZPatterns is probably ready to roll now for 2.3.x -- assuming that it
actually works, of course.  :)  I haven't yet tried upgrading a 2.2
ZPatterns app, or done anything with LoginManager for 2.3.x.  (So far all
my work for the 2.3 upgrade has just been UI tinkering on my Windows box,
without actually building/using a real application.)  I'm guessing that
once we've got caught up to 2.3.x, we'll probably immediately begin
checking into 2.4.x compatibility.  I'm guessing that the main areas we're
behind in are security-related, especially the new security declarations
machinery, and probably the restricted execution machinery as well.