antelopeusersgroup/antelope_contrib — pull request #29 by robnewman (2012-01-27 23:16:28+00:00)
Title: pythondbcentral  branch: new Python class DbCentral

I have written a Python module called pythondbcentral that contains one class, DbCentral (and one unittest subclass, TestDbCentral).

DbCentral takes three arguments:
- the dbpath,
- the clustername,
- an include_times boolean (True or False).

If include_times is True, you will be returned a (unsorted) dictionary where the dbpaths are keys, and a tuple of (time, endtime) are the values. If include_times is False, you will be returned a list (sorted) of just the dbpaths.

I also included several unittests so you can check it works against your own dbcentral databases. Note that there is no dbcentral database in the Antelope demo directory, so if you decide to run the unittests, you will need to change the paths defined in the __init__ method of the TestDbCentral class

One caveat - you need to ensure that the directory where this gets built ($ANTELOPE/local/data/python/utilities/) is in your PYTHONPATH environment variable. Also note that the new Antelope 5.2 structure of contrib may break this - it depends how that code base is finalized.

I hope you find this useful. Feedback welcome.
- Rob Newman