j n wrote:

This means the client for any_srv is 100% stupid.
And the server except for importing metakit, is also
100% stupid. The advantage is that if metakit changes,
the client/server code doesn't need to know about it.


Cool. It's nice to have more than one implementation!

It also support iterators. Any iterable object
references are kept as that. So, the client can
iterate through the rows as it needs to. The entire
row result from a query is not sent back.

Start the server with:
python any_srv.py

Here is example client code:
   mclient=any_server.Client()
   #Create a database:
   db = mclient.storage("datafile.mk",1)

   print 'Create a view'
   vw = db.getas("people[first:S,last:S,bowling:I]")

   print 'Add a couple of rows'
   vw.append(first='Fred',last='Flint',bowl=250)
   vw.append(first='Barney',last='Rubble',bowl=150)

   print 'Commit the changes to file:'
   db.commit()

print 'Show a list of all people:'
for r in vw: print r.first(), r.last(),r.bowl()


If you make these r.first, r.last, r.bowl it will be an easier transition from straight metakit to your server. Otherwise, good work. I'll be interested in investigating how you are doing your protocol passing.


mclient.any_server_clean()


2 things to think about:
Need to explicity kill the object references with
mclient.any_server_clean()

Currently, attributes as well as methods end in ().

The code is rough and needs to have more
features/documentation added but it seems to work
well.

Any comments would be appreciated.

john


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com




_______________________________________________
metakit mailing list  -  [EMAIL PROTECTED]
http://www.equi4.com/mailman/listinfo/metakit

Reply via email to