[pony-build] in-memory db stuff

C. Titus Brown ctb at msu.edu
Sun Mar 28 13:43:04 PDT 2010


On Sun, Mar 28, 2010 at 04:36:06PM -0400, Max Laite wrote:
> So first dbsqlite.py is using the *.db arg you specify when going to run
> (opens it according to code... )....
> 
> Then it passes the shelve file to IntDictWrapper and we get the
> following....
> IntDictWrapper object at 0x101e0f350
> 
> IntDictWrapper.....I am only going by name but is it Initializing stuff for
> the sending of data in dictionaries?

Yep: 'shelve' modules need string keys, so IntDictWrapper just wraps
integer keys => string keys.

> So after IntDictWrapper call, dbsqlite.py shows the dbfile as catalog.sqlite
> 
> All I can tell from the catalog is it holds the 'MAKE_SHELF' Line 34 in
> dbsqlite.

catalog?

> Then what the Coordinator is using finally for dbfile arg is IncDictWrapper
> object 0x101e0f350
> 
> Can you explain any of those step in server startup a bit more?
> 
> When ever i see 0xjibberish I always figure memory address......

;) Just means it's a not nicely configured Python object.

So, on the server side, pony_build/web/__init__.py lines 481 and 482
take the dbfilename and build a 'shelve'-like dictionary (tied to a
sqlite database) wrapped in an IntDictWrapper:

   http://docs.python.org/library/shelve.html

Here, 'dbfilename' gets passed straight into the sqlite connect function -- you
should be able to use 'print' in dbsqlite.py to verify that.

Is that any help?

cheers,
--titus



More information about the pony-build mailing list